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