diff --git a/lib/android/init.dart b/lib/android/init.dart index 3395c8e7..c6105b62 100644 --- a/lib/android/init.dart +++ b/lib/android/init.dart @@ -54,7 +54,7 @@ Future initialize() async { child: YubicoAuthenticatorApp(page: Consumer( builder: (context, ref, child) { // activates the sub page provider - ref.watch(androidSubPageProvider); + ref.read(androidSubPageProvider); return const MainPage(); }, )), diff --git a/lib/app/message.dart b/lib/app/message.dart index ef2250df..ff1b055a 100755 --- a/lib/app/message.dart +++ b/lib/app/message.dart @@ -22,12 +22,11 @@ ScaffoldFeatureController showMessage( Future showBottomMenu( BuildContext context, List actions) async { await showModalBottomSheet( - context: context, - constraints: MediaQuery.of(context).size.width > 540 - ? const BoxConstraints(maxWidth: 380) - : null, - builder: (context) => _BottomMenu(actions), - ); + context: context, + constraints: MediaQuery.of(context).size.width > 540 + ? const BoxConstraints(maxWidth: 380) + : null, + builder: (context) => SafeArea(child: _BottomMenu(actions))); } class _BottomMenu extends ConsumerWidget { @@ -41,23 +40,22 @@ class _BottomMenu extends ConsumerWidget { Navigator.of(context).pop(); }); - return SafeArea( - child: Column( - mainAxisSize: MainAxisSize.min, - children: actions - .map((a) => ListTile( - leading: a.icon, - title: Text(a.text), - enabled: a.action != null, - onTap: a.action == null - ? null - : () { - Navigator.pop(context); - a.action?.call(context); - }, - )) - .toList(), - ), + return Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: actions + .map((a) => ListTile( + leading: a.icon, + title: Text(a.text), + enabled: a.action != null, + onTap: a.action == null + ? null + : () { + Navigator.pop(context); + a.action?.call(context); + }, + )) + .toList(), ); } }