review updates

This commit is contained in:
Adam Velebil 2022-04-05 16:11:01 +02:00
parent 5ce2f53fe6
commit 4d30727c79
No known key found for this signature in database
GPG Key ID: AC6D6B9D715FC084
2 changed files with 22 additions and 24 deletions

View File

@ -54,7 +54,7 @@ Future<Widget> initialize() async {
child: YubicoAuthenticatorApp(page: Consumer(
builder: (context, ref, child) {
// activates the sub page provider
ref.watch(androidSubPageProvider);
ref.read(androidSubPageProvider);
return const MainPage();
},
)),

View File

@ -22,12 +22,11 @@ ScaffoldFeatureController showMessage(
Future<void> showBottomMenu(
BuildContext context, List<MenuAction> 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(),
);
}
}