|
1 | 1 | import 'package:flutter/material.dart'; |
2 | 2 |
|
3 | 3 | import 'compose_box.dart'; |
| 4 | +import 'draggable_scrollable_modal_bottom_sheet.dart'; |
4 | 5 | import 'login.dart'; |
5 | 6 | import 'message_list.dart'; |
6 | 7 | import 'page.dart'; |
@@ -87,18 +88,43 @@ class ChooseAccountPage extends StatelessWidget { |
87 | 88 | SafeArea( |
88 | 89 | minimum: const EdgeInsets.all(8), |
89 | 90 | child: Column(children: [ |
90 | | - MenuItemButton( |
91 | | - // round corners; not flush with device edge (SafeArea padding) |
92 | | - style: const ButtonStyle(shape: MaterialStatePropertyAll(StadiumBorder())), |
| 91 | + _BottomMenuButton( |
93 | 92 | leadingIcon: const Icon(Icons.add), |
94 | 93 | onPressed: () => Navigator.push(context, |
95 | 94 | AddAccountPage.buildRoute()), |
96 | 95 | child: const Text('Add an account')), |
| 96 | + _BottomMenuButton( |
| 97 | + leadingIcon: const Icon(Icons.help_outline), |
| 98 | + onPressed: () { |
| 99 | + // Could make a whole page for global help. |
| 100 | + showDraggableScrollableModalBottomSheet(context: context, |
| 101 | + builder: (context) => Column(children: [ |
| 102 | + // TODO button for https://zulip.com/help/ |
| 103 | + MenuItemButton( |
| 104 | + onPressed: () { |
| 105 | + // TODO: Fill in [AboutDialog] data: app version, icon, etc: |
| 106 | + // https://api.flutter.dev/flutter/material/AboutDialog/AboutDialog.html |
| 107 | + showAboutDialog(context: context); |
| 108 | + }, |
| 109 | + child: const Text('About Zulip')), |
| 110 | + ])); |
| 111 | + }, |
| 112 | + child: const Text('Help')), |
97 | 113 | ])), |
98 | 114 | ])); |
99 | 115 | } |
100 | 116 | } |
101 | 117 |
|
| 118 | +class _BottomMenuButton extends MenuItemButton { |
| 119 | + const _BottomMenuButton({ |
| 120 | + required super.onPressed, |
| 121 | + required super.leadingIcon, |
| 122 | + required super.child, |
| 123 | + }) : super( |
| 124 | + // round corners; not flush with device edge (SafeArea padding) |
| 125 | + style: const ButtonStyle(shape: MaterialStatePropertyAll(StadiumBorder()))); |
| 126 | +} |
| 127 | + |
102 | 128 | class HomePage extends StatelessWidget { |
103 | 129 | const HomePage({super.key}); |
104 | 130 |
|
|
0 commit comments