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