@@ -181,6 +181,52 @@ class BottomSheetHeader extends StatelessWidget {
181
181
}
182
182
}
183
183
184
+ /// A placeholder for when a bottom sheet has no content to show.
185
+ ///
186
+ /// Pass [message] for a "no-content-here" message,
187
+ /// or pass true for [loading] if the content hasn't finished loading yet,
188
+ /// but don't pass both.
189
+ ///
190
+ /// Show this below a [BottomSheetHeader] if present.
191
+ ///
192
+ /// See also:
193
+ /// * [PageBodyEmptyContentPlaceholder] , for a similar element to use in
194
+ /// pages on the home screen.
195
+ // TODO(design) we don't yet have a design for this;
196
+ // it was ad-hoc and modeled on [PageBodyEmptyContentPlaceholder].
197
+ class BottomSheetEmptyContentPlaceholder extends StatelessWidget {
198
+ const BottomSheetEmptyContentPlaceholder ({
199
+ super .key,
200
+ this .message,
201
+ this .loading = false ,
202
+ }) : assert (message == null || ! loading);
203
+
204
+ final String ? message;
205
+ final bool loading;
206
+
207
+ @override
208
+ Widget build (BuildContext context) {
209
+ final designVariables = DesignVariables .of (context);
210
+
211
+ final child = loading
212
+ ? CircularProgressIndicator ()
213
+ : Text (
214
+ textAlign: TextAlign .center,
215
+ style: TextStyle (
216
+ color: designVariables.labelSearchPrompt,
217
+ fontSize: 17 ,
218
+ height: 23 / 17 ,
219
+ ).merge (weightVariableTextStyle (context, wght: 500 )),
220
+ message! );
221
+
222
+ return Padding (
223
+ padding: EdgeInsets .fromLTRB (24 , 48 , 24 , 16 ),
224
+ child: Align (
225
+ alignment: Alignment .topCenter,
226
+ child: child));
227
+ }
228
+ }
229
+
184
230
/// A button in an action sheet.
185
231
///
186
232
/// When built from server data, the action sheet ignores changes in that data;
0 commit comments