Skip to content

Commit ad14c2a

Browse files
chrisbobbesm-sayedi
authored andcommitted
action_sheet: Implement BottomSheetEmptyContentPlaceholder, to use soon
1 parent bdbaf2d commit ad14c2a

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

lib/widgets/action_sheet.dart

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,39 @@ class BottomSheetHeader extends StatelessWidget {
181181
}
182182
}
183183

184+
/// A "no content here" message for when a bottom sheet has no content to show.
185+
///
186+
/// Show this below a [BottomSheetHeader] if present.
187+
///
188+
/// See also:
189+
/// * [PageBodyEmptyContentPlaceholder], for a similar element to use in
190+
/// pages on the home screen.
191+
// TODO(design) we don't yet have a design for this;
192+
// it was ad-hoc and modeled on [PageBodyEmptyContentPlaceholder].
193+
class BottomSheetEmptyContentPlaceholder extends StatelessWidget {
194+
const BottomSheetEmptyContentPlaceholder({super.key, required this.message});
195+
196+
final String message;
197+
198+
@override
199+
Widget build(BuildContext context) {
200+
final designVariables = DesignVariables.of(context);
201+
202+
return Padding(
203+
padding: EdgeInsets.fromLTRB(24, 48, 24, 16),
204+
child: Align(
205+
alignment: Alignment.topCenter,
206+
child: Text(
207+
textAlign: TextAlign.center,
208+
style: TextStyle(
209+
color: designVariables.labelSearchPrompt,
210+
fontSize: 17,
211+
height: 23 / 17,
212+
).merge(weightVariableTextStyle(context, wght: 500)),
213+
message)));
214+
}
215+
}
216+
184217
/// A button in an action sheet.
185218
///
186219
/// When built from server data, the action sheet ignores changes in that data;

lib/widgets/page.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,10 @@ class LoadingPlaceholderPage extends StatelessWidget {
220220
/// This handles the horizontal device insets
221221
/// and the bottom inset when needed (in a message list with no compose box).
222222
/// The top inset is handled externally by the app bar.
223+
///
224+
/// See also:
225+
/// * [BottomSheetEmptyContentPlaceholder], for a similar element to use in
226+
/// a bottom sheet.
223227
// TODO(#311) If the message list gets a bottom nav, the bottom inset will
224228
// always be handled externally too; simplify implementation and dartdoc.
225229
class PageBodyEmptyContentPlaceholder extends StatelessWidget {

0 commit comments

Comments
 (0)