diff --git a/lib/screens/home.dart b/lib/screens/home.dart index a01aef4..c80ee22 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -45,37 +45,50 @@ class _HomeScreenState extends State { appBar: AppBar( title: Text("screenHome").tr(), ), - body: SingleChildScrollView( - child: Column( - children: [ - MaterialBanner( - leading: const Icon(Symbols.construction), - content: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text('nextVersionAlert').tr().bold(), - Text('nextVersionNotice').tr(), - ], - ).padding(vertical: 16), - actions: [ - const SizedBox(), - ], + body: LayoutBuilder( + builder: (context, constraints) { + return Align( + alignment: constraints.maxWidth > 640 + ? Alignment.center + : Alignment.topCenter, + child: Container( + constraints: const BoxConstraints(maxWidth: 640), + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: constraints.maxWidth > 640 + ? MainAxisAlignment.center + : MainAxisAlignment.start, + children: [ + if (constraints.maxWidth <= 640) const Gap(8), + Card( + child: ListTile( + isThreeLine: true, + leading: const Icon(Symbols.construction), + title: Text('nextVersionAlert').tr(), + subtitle: Text('nextVersionNotice').tr(), + contentPadding: const EdgeInsets.symmetric( + vertical: 8, horizontal: 16), + ), + ).padding(horizontal: 8), + _HomeDashSpecialDayWidget().padding(top: 8, horizontal: 8), + StaggeredGrid.count( + crossAxisCount: 2, + mainAxisSpacing: 8, + crossAxisSpacing: 8, + children: kCards.map((card) { + return StaggeredGridTile.count( + crossAxisCellCount: card.cols, + mainAxisCellCount: card.rows, + child: card.child, + ); + }).toList(), + ).padding(horizontal: 8), + ], + ), + ), ), - _HomeDashSpecialDayWidget().padding(top: 8, horizontal: 8), - StaggeredGrid.count( - crossAxisCount: 2, - mainAxisSpacing: 8, - crossAxisSpacing: 8, - children: kCards.map((card) { - return StaggeredGridTile.count( - crossAxisCellCount: card.cols, - mainAxisCellCount: card.rows, - child: card.child, - ); - }).toList(), - ).padding(horizontal: 8), - ], - ), + ); + }, ), ); } @@ -210,7 +223,11 @@ class _HomeDashCheckInWidgetState extends State<_HomeDashCheckInWidget> { @override void initState() { super.initState(); - _pullCheckIn(); + final ua = context.read(); + Future.delayed(const Duration(milliseconds: 500), () async { + if (!ua.isAuthorized) return; + await _pullCheckIn(); + }); } @override diff --git a/lib/theme.dart b/lib/theme.dart index e590f54..9575efd 100644 --- a/lib/theme.dart +++ b/lib/theme.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; import 'package:shared_preferences/shared_preferences.dart'; const kMaterialYouToggleStoreKey = 'app_theme_material_you'; @@ -43,7 +42,6 @@ Future createAppTheme( appBarTheme: AppBarTheme( centerTitle: true, ), - textTheme: GoogleFonts.robotoTextTheme(), scaffoldBackgroundColor: Colors.transparent, ); } diff --git a/pubspec.yaml b/pubspec.yaml index 1a664dc..8ebd366 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 2.0.0+9 +version: 2.0.0+10 environment: sdk: ^3.5.4