mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-22 16:32:01 +03:00
review updates
This commit is contained in:
parent
5ce2f53fe6
commit
4d30727c79
@ -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();
|
||||
},
|
||||
)),
|
||||
|
@ -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(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user