File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import 'package:flutter/material.dart' ;
2+ import 'package:vector_graphics/vector_graphics.dart' ;
23
34import '../api/model/model.dart' ;
45import '../generated/l10n/zulip_localizations.dart' ;
@@ -192,6 +193,19 @@ class _InboxPageState extends State<InboxPageBody> with PerAccountStoreAwareStat
192193
193194 if (items.isEmpty) {
194195 return PageBodyEmptyContentPlaceholder (
196+ illustration: VectorGraphic (
197+ loader: const AssetBytesLoader (
198+ 'assets/images/empty-inbox.svg.vec' ,
199+ ),
200+ width: 150 ,
201+ height: 150 ,
202+ colorFilter: ColorFilter .mode (
203+ DesignVariables .of (context)
204+ .labelSearchPrompt
205+ .withValues (alpha: 0.8 ),
206+ BlendMode .srcIn,
207+ ),
208+ ),
195209 // TODO(#315) add e.g. "You might be interested in recent conversations."
196210 header: zulipLocalizations.inboxEmptyPlaceholderHeader,
197211 message: zulipLocalizations.inboxEmptyPlaceholderMessage);
Original file line number Diff line number Diff line change @@ -252,22 +252,26 @@ class LoadingPlaceholderPage extends StatelessWidget {
252252class PageBodyEmptyContentPlaceholder extends StatelessWidget {
253253 const PageBodyEmptyContentPlaceholder ({
254254 super .key,
255+ this .illustration,
255256 this .header,
256257 this .headerWithLinkMarkup,
257258 this .onTapHeaderLink,
258259 this .message,
259260 this .messageWithLinkMarkup,
260261 this .onTapMessageLink,
262+ this .trailing,
261263 }) : assert (
262264 (header != null )
263265 ^ (headerWithLinkMarkup != null && onTapHeaderLink != null ));
264266
267+ final Widget ? illustration;
265268 final String ? header;
266269 final String ? headerWithLinkMarkup;
267270 final VoidCallback ? onTapHeaderLink;
268271 final String ? message;
269272 final String ? messageWithLinkMarkup;
270273 final VoidCallback ? onTapMessageLink;
274+ final Widget ? trailing;
271275
272276 TextStyle _headerStyle (BuildContext context) {
273277 final designVariables = DesignVariables .of (context);
@@ -335,10 +339,13 @@ class PageBodyEmptyContentPlaceholder extends StatelessWidget {
335339 spacing: 16 ,
336340 crossAxisAlignment: CrossAxisAlignment .center,
337341 children: [
338- // TODO leading and trailing elements, like in Figma (given as SVGs):
339- // https://www.figma.com/design/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?node-id=5957-167736&m=dev
342+ ? illustration,
340343 header,
341344 ? message,
345+ ...[
346+ const SizedBox (height: 8 ),
347+ ? trailing,
348+ ],
342349 ]))));
343350 }
344351}
Original file line number Diff line number Diff line change 11import 'package:flutter/material.dart' ;
2+ import 'package:vector_graphics/vector_graphics.dart' ;
23
34import '../generated/l10n/zulip_localizations.dart' ;
45import '../model/narrow.dart' ;
@@ -108,8 +109,31 @@ class _RecentDmConversationsPageBodyState extends State<RecentDmConversationsPag
108109 children: [
109110 if (sorted.isEmpty)
110111 PageBodyEmptyContentPlaceholder (
112+ illustration: VectorGraphic (
113+ loader: const AssetBytesLoader (
114+ 'assets/images/empty-dm.svg.vec' ,
115+ ),
116+ width: 150 ,
117+ height: 150 ,
118+ colorFilter: ColorFilter .mode (
119+ DesignVariables .of (context).labelSearchPrompt.withValues (alpha: 0.8 ),
120+ BlendMode .srcIn,
121+ ),
122+ ),
111123 header: zulipLocalizations.recentDmConversationsEmptyPlaceholderHeader,
112- message: zulipLocalizations.recentDmConversationsEmptyPlaceholderMessage)
124+ message: zulipLocalizations.recentDmConversationsEmptyPlaceholderMessage,
125+ trailing: VectorGraphic (
126+ loader: const AssetBytesLoader (
127+ 'assets/images/dm-arrow.svg.vec' ,
128+ ),
129+ width: 150 ,
130+ height: 150 ,
131+ colorFilter: ColorFilter .mode (
132+ DesignVariables .of (context).labelSearchPrompt.withValues (alpha: 0.8 ),
133+ BlendMode .srcIn,
134+ ),
135+ ),
136+ )
113137 else
114138 SafeArea (
115139 // Don't pad the bottom here; we want the list content to do that.
Original file line number Diff line number Diff line change 11import 'package:flutter/material.dart' ;
2+ import 'package:vector_graphics/vector_graphics.dart' ;
23
34import '../api/model/model.dart' ;
45import '../generated/l10n/zulip_localizations.dart' ;
@@ -137,6 +138,19 @@ class _SubscriptionListPageBodyState extends State<SubscriptionListPageBody> wit
137138 if (pinned.isEmpty && unpinned.isEmpty) {
138139 if (includeAllChannelsButton) {
139140 return PageBodyEmptyContentPlaceholder (
141+ illustration: VectorGraphic (
142+ loader: const AssetBytesLoader (
143+ 'assets/images/empty-channel.svg.vec' ,
144+ ),
145+ width: 150 ,
146+ height: 150 ,
147+ colorFilter: ColorFilter .mode (
148+ DesignVariables .of (context)
149+ .labelSearchPrompt
150+ .withValues (alpha: 0.8 ),
151+ BlendMode .srcIn,
152+ ),
153+ ),
140154 header: zulipLocalizations.channelsEmptyPlaceholderHeader,
141155 messageWithLinkMarkup:
142156 zulipLocalizations.channelsEmptyPlaceholderMessage (
Original file line number Diff line number Diff line change @@ -1275,6 +1275,22 @@ packages:
12751275 url: "https://pub.dev"
12761276 source: hosted
12771277 version: "4.5.3"
1278+ vector_graphics:
1279+ dependency: "direct main"
1280+ description:
1281+ name: vector_graphics
1282+ sha256: "2306c03da2ba81724afeb589c351ebbc0aa7d86005925be8f8735856dbe5e42d"
1283+ url: "https://pub.dev"
1284+ source: hosted
1285+ version: "1.2.2"
1286+ vector_graphics_codec:
1287+ dependency: transitive
1288+ description:
1289+ name: vector_graphics_codec
1290+ sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146"
1291+ url: "https://pub.dev"
1292+ source: hosted
1293+ version: "1.1.13"
12781294 vector_math:
12791295 dependency: transitive
12801296 description:
Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ dependencies:
6363 unorm_dart : ^0.3.1+1
6464 url_launcher : ^6.1.11
6565 url_launcher_android : " >=6.1.0"
66+ vector_graphics : 1.2.2
6667 video_player : ^2.10.0
6768 wakelock_plus : ^1.2.8
6869 zulip_plugin :
@@ -121,6 +122,7 @@ flutter:
121122 uses-material-design : true
122123
123124 assets :
125+ - assets/images/
124126 - assets/KaTeX/LICENSE
125127 - assets/Noto_Color_Emoji/LICENSE
126128 - assets/Pygments/AUTHORS.txt
You can’t perform that action at this time.
0 commit comments