@@ -92,7 +92,7 @@ void _showActionSheet(
9292 child: SingleChildScrollView (
9393 padding: const EdgeInsets .symmetric (vertical: 8 ),
9494 child: MenuButtonsShape (buttons: optionButtons)))),
95- const ActionSheetCancelButton ( ),
95+ const BottomSheetDismissButton (style : BottomSheetDismissButtonStyle .cancel ),
9696 ]))),
9797 ]))));
9898 });
@@ -160,12 +160,22 @@ abstract class ActionSheetMenuItemButton extends StatelessWidget {
160160 }
161161}
162162
163- class ActionSheetCancelButton extends StatelessWidget {
164- const ActionSheetCancelButton ({super .key});
163+ /// A stretched gray "Cancel" / "Close" button for the bottom of a bottom sheet.
164+ class BottomSheetDismissButton extends StatelessWidget {
165+ const BottomSheetDismissButton ({super .key, required this .style});
166+
167+ final BottomSheetDismissButtonStyle style;
165168
166169 @override
167170 Widget build (BuildContext context) {
168171 final designVariables = DesignVariables .of (context);
172+ final zulipLocalizations = ZulipLocalizations .of (context);
173+
174+ final label = switch (style) {
175+ BottomSheetDismissButtonStyle .cancel => zulipLocalizations.dialogCancel,
176+ BottomSheetDismissButtonStyle .close => zulipLocalizations.dialogClose,
177+ };
178+
169179 return TextButton (
170180 style: TextButton .styleFrom (
171181 minimumSize: const Size .fromHeight (44 ),
@@ -180,12 +190,20 @@ class ActionSheetCancelButton extends StatelessWidget {
180190 onPressed: () {
181191 Navigator .pop (context);
182192 },
183- child: Text (ZulipLocalizations . of (context).dialogCancel ,
193+ child: Text (label ,
184194 style: const TextStyle (fontSize: 20 , height: 24 / 20 )
185195 .merge (weightVariableTextStyle (context, wght: 600 ))));
186196 }
187197}
188198
199+ enum BottomSheetDismissButtonStyle {
200+ /// The "Cancel" label, for action sheets.
201+ cancel,
202+
203+ /// The "Close" label, for bottom sheets that are read-only or for navigation.
204+ close,
205+ }
206+
189207/// Show a sheet of actions you can take on a channel.
190208///
191209/// Needs a [PageRoot] ancestor.
0 commit comments