@@ -23,6 +23,42 @@ import 'store.dart';
23
23
import 'text.dart' ;
24
24
import 'theme.dart' ;
25
25
26
+ void _showActionSheet (
27
+ BuildContext context, {
28
+ required List <ActionSheetMenuItemButton > optionButtons,
29
+ }) {
30
+ showModalBottomSheet <void >(
31
+ context: context,
32
+ // Clip.hardEdge looks bad; Clip.antiAliasWithSaveLayer looks pixel-perfect
33
+ // on my iPhone 13 Pro but is marked as "much slower":
34
+ // https://api.flutter.dev/flutter/dart-ui/Clip.html
35
+ clipBehavior: Clip .antiAlias,
36
+ useSafeArea: true ,
37
+ isScrollControlled: true ,
38
+ builder: (BuildContext _) {
39
+ return SafeArea (
40
+ minimum: const EdgeInsets .only (bottom: 16 ),
41
+ child: Padding (
42
+ padding: const EdgeInsets .fromLTRB (16 , 0 , 16 , 0 ),
43
+ child: Column (
44
+ crossAxisAlignment: CrossAxisAlignment .stretch,
45
+ mainAxisSize: MainAxisSize .min,
46
+ children: [
47
+ // TODO(#217): show message text
48
+ Flexible (child: InsetShadowBox (
49
+ top: 8 , bottom: 8 ,
50
+ color: DesignVariables .of (context).bgContextMenu,
51
+ child: SingleChildScrollView (
52
+ padding: const EdgeInsets .only (top: 16 , bottom: 8 ),
53
+ child: ClipRRect (
54
+ borderRadius: BorderRadius .circular (7 ),
55
+ child: Column (spacing: 1 ,
56
+ children: optionButtons))))),
57
+ const ActionSheetCancelButton (),
58
+ ])));
59
+ });
60
+ }
61
+
26
62
abstract class ActionSheetMenuItemButton extends StatelessWidget {
27
63
const ActionSheetMenuItemButton ({super .key, required this .pageContext});
28
64
@@ -145,36 +181,7 @@ void showMessageActionSheet({required BuildContext context, required Message mes
145
181
ShareButton (message: message, pageContext: context),
146
182
];
147
183
148
- showModalBottomSheet <void >(
149
- context: context,
150
- // Clip.hardEdge looks bad; Clip.antiAliasWithSaveLayer looks pixel-perfect
151
- // on my iPhone 13 Pro but is marked as "much slower":
152
- // https://api.flutter.dev/flutter/dart-ui/Clip.html
153
- clipBehavior: Clip .antiAlias,
154
- useSafeArea: true ,
155
- isScrollControlled: true ,
156
- builder: (BuildContext _) {
157
- return SafeArea (
158
- minimum: const EdgeInsets .only (bottom: 16 ),
159
- child: Padding (
160
- padding: const EdgeInsets .fromLTRB (16 , 0 , 16 , 0 ),
161
- child: Column (
162
- crossAxisAlignment: CrossAxisAlignment .stretch,
163
- mainAxisSize: MainAxisSize .min,
164
- children: [
165
- // TODO(#217): show message text
166
- Flexible (child: InsetShadowBox (
167
- top: 8 , bottom: 8 ,
168
- color: DesignVariables .of (context).bgContextMenu,
169
- child: SingleChildScrollView (
170
- padding: const EdgeInsets .only (top: 16 , bottom: 8 ),
171
- child: ClipRRect (
172
- borderRadius: BorderRadius .circular (7 ),
173
- child: Column (spacing: 1 ,
174
- children: optionButtons))))),
175
- const ActionSheetCancelButton (),
176
- ])));
177
- });
184
+ _showActionSheet (context, optionButtons: optionButtons);
178
185
}
179
186
180
187
abstract class MessageActionSheetMenuItemButton extends ActionSheetMenuItemButton {
0 commit comments