🚀 Launch 2.0.0+10

📱 Responsive home page
This commit is contained in:
LittleSheep 2024-11-28 00:29:53 +08:00
parent aa9724102b
commit 23301764ee
3 changed files with 49 additions and 34 deletions

View File

@ -45,22 +45,31 @@ class _HomeScreenState extends State<HomeScreen> {
appBar: AppBar(
title: Text("screenHome").tr(),
),
body: SingleChildScrollView(
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: [
MaterialBanner(
if (constraints.maxWidth <= 640) const Gap(8),
Card(
child: ListTile(
isThreeLine: true,
leading: const Icon(Symbols.construction),
content: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('nextVersionAlert').tr().bold(),
Text('nextVersionNotice').tr(),
],
).padding(vertical: 16),
actions: [
const SizedBox(),
],
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,
@ -77,6 +86,10 @@ class _HomeScreenState extends State<HomeScreen> {
],
),
),
),
);
},
),
);
}
}
@ -210,7 +223,11 @@ class _HomeDashCheckInWidgetState extends State<_HomeDashCheckInWidget> {
@override
void initState() {
super.initState();
_pullCheckIn();
final ua = context.read<UserProvider>();
Future.delayed(const Duration(milliseconds: 500), () async {
if (!ua.isAuthorized) return;
await _pullCheckIn();
});
}
@override

View File

@ -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<ThemeData> createAppTheme(
appBarTheme: AppBarTheme(
centerTitle: true,
),
textTheme: GoogleFonts.robotoTextTheme(),
scaffoldBackgroundColor: Colors.transparent,
);
}

View File

@ -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