@@ -70,7 +70,6 @@ class _AboutScreenState extends State<AboutScreen> {
7070 _buildHeader (context),
7171 _buildAppInfo (context),
7272 _buildBuildInfo (context),
73- _buildDataInfo (context, provider),
7473 _buildSettings (context, provider),
7574 _buildLinks (context),
7675 _buildLegalInfo (context),
@@ -266,106 +265,6 @@ class _AboutScreenState extends State<AboutScreen> {
266265 }
267266 }
268267
269- Widget _buildDataInfo (BuildContext context, BeerProvider provider) {
270- final theme = Theme .of (context);
271- final lastRefresh = provider.lastDrinksRefresh;
272-
273- String refreshText;
274- if (lastRefresh == null ) {
275- refreshText = 'Not yet loaded' ;
276- } else {
277- final now = DateTime .now ();
278- final difference = now.difference (lastRefresh);
279-
280- if (difference.inMinutes < 1 ) {
281- refreshText = 'Just now' ;
282- } else if (difference.inHours < 1 ) {
283- refreshText = '${difference .inMinutes } minute${difference .inMinutes == 1 ? '' : 's' } ago' ;
284- } else if (difference.inDays < 1 ) {
285- refreshText = '${difference .inHours } hour${difference .inHours == 1 ? '' : 's' } ago' ;
286- } else {
287- refreshText = DateFormat ('MMM d, yyyy \' at\' h:mm a' ).format (lastRefresh);
288- }
289- }
290-
291- return Padding (
292- padding: const EdgeInsets .symmetric (horizontal: 16 ),
293- child: Column (
294- crossAxisAlignment: CrossAxisAlignment .start,
295- children: [
296- Text ('Data' , style: theme.textTheme.titleMedium),
297- const SizedBox (height: 8 ),
298- Card (
299- child: Padding (
300- padding: const EdgeInsets .all (16 ),
301- child: Column (
302- children: [
303- Row (
304- mainAxisAlignment: MainAxisAlignment .spaceBetween,
305- children: [
306- Text (
307- 'Last Updated' ,
308- style: theme.textTheme.bodyMedium? .copyWith (
309- color: theme.colorScheme.onSurfaceVariant,
310- ),
311- ),
312- Text (
313- refreshText,
314- style: theme.textTheme.bodyMedium? .copyWith (
315- fontWeight: FontWeight .w500,
316- ),
317- ),
318- ],
319- ),
320- const SizedBox (height: 12 ),
321- Row (
322- mainAxisAlignment: MainAxisAlignment .spaceBetween,
323- children: [
324- Text (
325- 'Current Festival' ,
326- style: theme.textTheme.bodyMedium? .copyWith (
327- color: theme.colorScheme.onSurfaceVariant,
328- ),
329- ),
330- Flexible (
331- child: Text (
332- provider.currentFestival.name,
333- style: theme.textTheme.bodyMedium? .copyWith (
334- fontWeight: FontWeight .w500,
335- ),
336- textAlign: TextAlign .right,
337- ),
338- ),
339- ],
340- ),
341- const SizedBox (height: 12 ),
342- Row (
343- mainAxisAlignment: MainAxisAlignment .spaceBetween,
344- children: [
345- Text (
346- 'Total Drinks' ,
347- style: theme.textTheme.bodyMedium? .copyWith (
348- color: theme.colorScheme.onSurfaceVariant,
349- ),
350- ),
351- Text (
352- '${provider .allDrinks .length }' ,
353- style: theme.textTheme.bodyMedium? .copyWith (
354- fontWeight: FontWeight .w500,
355- ),
356- ),
357- ],
358- ),
359- ],
360- ),
361- ),
362- ),
363- const SizedBox (height: 16 ),
364- ],
365- ),
366- );
367- }
368-
369268 Widget _buildSettings (BuildContext context, BeerProvider provider) {
370269 final theme = Theme .of (context);
371270 final themeMode = provider.themeMode;
0 commit comments