|
@@ -77,6 +77,52 @@ class _CreateTextFieldDialog extends State<TextFieldDialog> {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+class FlowyAlertDialog extends StatefulWidget {
|
|
|
+ final String title;
|
|
|
+ final void Function()? cancel;
|
|
|
+ final void Function()? confirm;
|
|
|
+
|
|
|
+ const FlowyAlertDialog({
|
|
|
+ required this.title,
|
|
|
+ this.confirm,
|
|
|
+ this.cancel,
|
|
|
+ Key? key,
|
|
|
+ }) : super(key: key);
|
|
|
+
|
|
|
+ @override
|
|
|
+ State<FlowyAlertDialog> createState() => _CreateFlowyAlertDialog();
|
|
|
+}
|
|
|
+
|
|
|
+class _CreateFlowyAlertDialog extends State<FlowyAlertDialog> {
|
|
|
+ @override
|
|
|
+ void initState() {
|
|
|
+ super.initState();
|
|
|
+ }
|
|
|
+
|
|
|
+ @override
|
|
|
+ Widget build(BuildContext context) {
|
|
|
+ final theme = context.watch<AppTheme>();
|
|
|
+ return StyledDialog(
|
|
|
+ child: Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ children: <Widget>[
|
|
|
+ ...[
|
|
|
+ FlowyText.medium(widget.title, color: theme.shader4),
|
|
|
+ ],
|
|
|
+ if (widget.confirm != null) ...[
|
|
|
+ const VSpace(20),
|
|
|
+ OkCancelButton(
|
|
|
+ onOkPressed: widget.confirm!,
|
|
|
+ onCancelPressed: widget.confirm,
|
|
|
+ )
|
|
|
+ ]
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
class OkCancelDialog extends StatelessWidget {
|
|
|
final VoidCallback? onOkPressed;
|
|
|
final VoidCallback? onCancelPressed;
|