29 lines
685 B
Dart
29 lines
685 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class DialogActions {
|
|
static List<Widget> confirm({
|
|
required VoidCallback onConfirm,
|
|
required VoidCallback onCancel,
|
|
String confirmText = '확인',
|
|
String cancelText = '취소',
|
|
bool destructive = false,
|
|
}) {
|
|
return [
|
|
TextButton(
|
|
onPressed: onCancel,
|
|
child: Text(cancelText),
|
|
),
|
|
ElevatedButton(
|
|
style: destructive
|
|
? ElevatedButton.styleFrom(
|
|
backgroundColor: Colors.redAccent,
|
|
foregroundColor: Colors.white,
|
|
)
|
|
: null,
|
|
onPressed: onConfirm,
|
|
child: Text(confirmText),
|
|
),
|
|
];
|
|
}
|
|
}
|