Merge pull request #4811 from dignow/refact/login_dialog
refact login dialog
This commit is contained in:
commit
24539c1241
@ -828,6 +828,7 @@ class CustomAlertDialog extends StatelessWidget {
|
||||
const CustomAlertDialog(
|
||||
{Key? key,
|
||||
this.title,
|
||||
this.titlePadding,
|
||||
required this.content,
|
||||
this.actions,
|
||||
this.contentPadding,
|
||||
@ -837,6 +838,7 @@ class CustomAlertDialog extends StatelessWidget {
|
||||
: super(key: key);
|
||||
|
||||
final Widget? title;
|
||||
final EdgeInsetsGeometry? titlePadding;
|
||||
final Widget content;
|
||||
final List<Widget>? actions;
|
||||
final double? contentPadding;
|
||||
@ -885,7 +887,7 @@ class CustomAlertDialog extends StatelessWidget {
|
||||
child: content,
|
||||
),
|
||||
actions: actions,
|
||||
titlePadding: MyTheme.dialogTitlePadding(),
|
||||
titlePadding: titlePadding ?? MyTheme.dialogTitlePadding(),
|
||||
contentPadding:
|
||||
MyTheme.dialogContentPadding(actions: actions is List),
|
||||
actionsPadding: MyTheme.dialogActionsPadding(),
|
||||
|
@ -499,8 +499,28 @@ Future<bool?> loginDialog() async {
|
||||
);
|
||||
});
|
||||
|
||||
final title = Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
translate('Login'),
|
||||
).marginOnly(top: MyTheme.dialogPadding),
|
||||
TextButton(
|
||||
child: Icon(
|
||||
Icons.close,
|
||||
size: 20,
|
||||
color: Colors.black54,
|
||||
),
|
||||
onPressed: onDialogCancel,
|
||||
).marginOnly(top: 5),
|
||||
],
|
||||
);
|
||||
final titlePadding = EdgeInsets.fromLTRB(MyTheme.dialogPadding, 0, 0, 0);
|
||||
|
||||
return CustomAlertDialog(
|
||||
title: Text(translate('Login')),
|
||||
title: title,
|
||||
titlePadding: titlePadding,
|
||||
contentBoxConstraints: BoxConstraints(minWidth: 400),
|
||||
content: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
@ -521,7 +541,6 @@ Future<bool?> loginDialog() async {
|
||||
thirdAuthWidget(),
|
||||
],
|
||||
),
|
||||
actions: [dialogButton('Close', onPressed: onDialogCancel)],
|
||||
onCancel: onDialogCancel,
|
||||
);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user