|
2 | 2 | import 'package:flutter/material.dart';
|
3 | 3 |
|
4 | 4 | import 'store.dart';
|
| 5 | +import 'text.dart'; |
| 6 | +import 'theme.dart'; |
5 | 7 |
|
6 | 8 | /// An [InheritedWidget] for near the root of a page's widget subtree,
|
7 | 9 | /// providing its [BuildContext].
|
@@ -210,3 +212,36 @@ class LoadingPlaceholderPage extends StatelessWidget {
|
210 | 212 | );
|
211 | 213 | }
|
212 | 214 | }
|
| 215 | + |
| 216 | +/// A "no content here" message, for the Inbox, Subscriptions, and DMs pages. |
| 217 | +/// |
| 218 | +/// This should go near the root of the "page body"'s widget subtree. |
| 219 | +/// In particular, it handles the horizontal device insets. |
| 220 | +/// (The vertical insets are handled externally, by the app bar and bottom nav.) |
| 221 | +class PageBodyEmptyContentPlaceholder extends StatelessWidget { |
| 222 | + const PageBodyEmptyContentPlaceholder({super.key, required this.message}); |
| 223 | + |
| 224 | + final String message; |
| 225 | + |
| 226 | + @override |
| 227 | + Widget build(BuildContext context) { |
| 228 | + final designVariables = DesignVariables.of(context); |
| 229 | + |
| 230 | + return SafeArea( |
| 231 | + minimum: EdgeInsets.symmetric(horizontal: 24), |
| 232 | + child: Padding( |
| 233 | + padding: EdgeInsets.only(top: 48, bottom: 16), |
| 234 | + child: Align( |
| 235 | + alignment: Alignment.topCenter, |
| 236 | + // TODO leading and trailing elements, like in Figma (given as SVGs): |
| 237 | + // https://www.figma.com/design/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?node-id=5957-167736&m=dev |
| 238 | + child: Text( |
| 239 | + textAlign: TextAlign.center, |
| 240 | + style: TextStyle( |
| 241 | + color: designVariables.labelSearchPrompt, |
| 242 | + fontSize: 17, |
| 243 | + height: 23 / 17, |
| 244 | + ).merge(weightVariableTextStyle(context, wght: 500)), |
| 245 | + message)))); |
| 246 | + } |
| 247 | +} |
0 commit comments