diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 7827ee13c..41fa826b8 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -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? 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(), diff --git a/flutter/lib/common/widgets/login.dart b/flutter/lib/common/widgets/login.dart index 9b00c4cc3..d5e2a9ba3 100644 --- a/flutter/lib/common/widgets/login.dart +++ b/flutter/lib/common/widgets/login.dart @@ -499,8 +499,28 @@ Future 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 loginDialog() async { thirdAuthWidget(), ], ), - actions: [dialogButton('Close', onPressed: onDialogCancel)], onCancel: onDialogCancel, ); });