Skip to content

Commit 3f8f832

Browse files
chrisbobbegnprice
authored andcommitted
action_sheet [nfc]: Dartdoc _showActionSheet
1 parent 5da93b2 commit 3f8f832

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/widgets/action_sheet.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,25 @@ import 'text.dart';
3535
import 'theme.dart';
3636
import 'topic_list.dart';
3737

38+
/// Show an action sheet with scrollable menu buttons
39+
/// and an optional scrollable header.
40+
///
41+
/// [header] should not use vertical padding to position itself on the sheet.
42+
/// It will be wrapped in vertical padding,
43+
/// a scroll view, and an [InsetShadowBox] to support scrolling.
3844
void _showActionSheet(
3945
BuildContext pageContext, {
4046
Widget? header,
4147
required List<List<Widget>> buttonSections,
4248
}) {
49+
// This assert does look absurd, but see dartdoc -- [BottomSheetHeader] adds
50+
// vertical padding to position itself on the sheet, so isn't suitable here.
51+
// When it grows a param to omit that padding, soon, it'll be usable here.
52+
// (Currently the only caller that passes `header` is the message action sheet,
53+
// and that header widget only adds internal padding, on a distinct-colored
54+
// surface, not padding for positioning.)
55+
assert(header is! BottomSheetHeader);
56+
4357
// Could omit this if we need _showActionSheet outside a per-account context.
4458
final accountId = PerAccountStoreWidget.accountIdOf(pageContext);
4559

0 commit comments

Comments
 (0)