💄 Optimize designs and bug fixes with background image

This commit is contained in:
LittleSheep 2024-10-06 22:38:31 +08:00
parent c5258cb9ca
commit 2e9c4d166e
5 changed files with 320 additions and 304 deletions

View File

@ -108,7 +108,7 @@ class _AccountScreenState extends State<AccountScreen> {
child: ListView(
children: [
if (auth.userProfile.value != null)
const AccountHeading().paddingOnly(bottom: 8, top: 8),
const AccountHeading().paddingOnly(bottom: 8, top: 16),
...(actionItems.map(
(x) => ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 34),

View File

@ -220,6 +220,8 @@ class _SignInScreenState extends State<SignInScreen> {
return RootContainer(
child: CenteredContainer(
maxWidth: 360,
child: Theme(
data: Theme.of(context).copyWith(canvasColor: Colors.transparent),
child: PageTransitionSwitcher(
transitionBuilder: (
Widget child,
@ -241,9 +243,10 @@ class _SignInScreenState extends State<SignInScreen> {
Align(
alignment: Alignment.centerLeft,
child: ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(8)),
child:
Image.asset('assets/logo.png', width: 64, height: 64),
borderRadius:
const BorderRadius.all(Radius.circular(8)),
child: Image.asset('assets/logo.png',
width: 64, height: 64),
).paddingOnly(bottom: 8, left: 4),
),
Text(
@ -269,7 +272,8 @@ class _SignInScreenState extends State<SignInScreen> {
Icons.question_mark,
),
title: Text(
_factorLabelMap[x.type]?.$1 ?? 'unknown'.tr,
_factorLabelMap[x.type]?.$1 ??
'unknown'.tr,
),
enabled: !_currentTicket!.factorTrail
.contains(x.id),
@ -299,8 +303,8 @@ class _SignInScreenState extends State<SignInScreen> {
onPressed: (_isBusy || _period > 1)
? null
: () => _previousStep(),
style:
TextButton.styleFrom(foregroundColor: Colors.grey),
style: TextButton.styleFrom(
foregroundColor: Colors.grey),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
@ -331,9 +335,10 @@ class _SignInScreenState extends State<SignInScreen> {
Align(
alignment: Alignment.centerLeft,
child: ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(8)),
child:
Image.asset('assets/logo.png', width: 64, height: 64),
borderRadius:
const BorderRadius.all(Radius.circular(8)),
child: Image.asset('assets/logo.png',
width: 64, height: 64),
).paddingOnly(bottom: 8, left: 4),
),
Text(
@ -367,7 +372,8 @@ class _SignInScreenState extends State<SignInScreen> {
),
onTapOutside: (_) =>
FocusManager.instance.primaryFocus?.unfocus(),
onSubmitted: _isBusy ? null : (_) => _performCheckTicket(),
onSubmitted:
_isBusy ? null : (_) => _performCheckTicket(),
),
const Gap(12),
Row(
@ -375,8 +381,8 @@ class _SignInScreenState extends State<SignInScreen> {
children: [
TextButton(
onPressed: _isBusy ? null : () => _previousStep(),
style:
TextButton.styleFrom(foregroundColor: Colors.grey),
style: TextButton.styleFrom(
foregroundColor: Colors.grey),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
@ -386,7 +392,8 @@ class _SignInScreenState extends State<SignInScreen> {
),
),
TextButton(
onPressed: _isBusy ? null : () => _performCheckTicket(),
onPressed:
_isBusy ? null : () => _performCheckTicket(),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
@ -406,9 +413,10 @@ class _SignInScreenState extends State<SignInScreen> {
Align(
alignment: Alignment.centerLeft,
child: ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(8)),
child:
Image.asset('assets/logo.png', width: 64, height: 64),
borderRadius:
const BorderRadius.all(Radius.circular(8)),
child: Image.asset('assets/logo.png',
width: 64, height: 64),
).paddingOnly(bottom: 8, left: 4),
),
Text(
@ -440,8 +448,8 @@ class _SignInScreenState extends State<SignInScreen> {
TextButton(
onPressed:
_isBusy ? null : () => _requestResetPassword(),
style:
TextButton.styleFrom(foregroundColor: Colors.grey),
style: TextButton.styleFrom(
foregroundColor: Colors.grey),
child: Text('forgotPassword'.tr),
),
TextButton(
@ -467,8 +475,10 @@ class _SignInScreenState extends State<SignInScreen> {
Text(
'termAcceptNextWithAgree'.tr,
textAlign: TextAlign.end,
style:
Theme.of(context).textTheme.bodySmall!.copyWith(
style: Theme.of(context)
.textTheme
.bodySmall!
.copyWith(
color: Theme.of(context)
.colorScheme
.onSurface
@ -499,6 +509,7 @@ class _SignInScreenState extends State<SignInScreen> {
),
},
),
),
).paddingAll(24),
);
}

View File

@ -147,7 +147,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
),
Text(DateFormat('yyyy/MM/dd').format(DateTime.now().toUtc())),
],
).paddingOnly(top: 8, left: 18, right: 18, bottom: 12),
).paddingOnly(top: 16, left: 18, right: 18, bottom: 12),
Card(
child: Column(
children: [

View File

@ -99,6 +99,7 @@ class _RealmListScreenState extends State<RealmListScreen> {
child: RefreshIndicator(
onRefresh: () => _getRealms(),
child: ListView.builder(
padding: const EdgeInsets.symmetric(vertical: 16),
itemCount: _realms.length,
itemBuilder: (context, index) {
final element = _realms[index];

View File

@ -27,7 +27,9 @@ class _AppNavigationRailState extends State<AppNavigationRail> {
@override
Widget build(BuildContext context) {
return NavigationRail(
return Material(
color: Theme.of(context).colorScheme.surface,
child: NavigationRail(
selectedIndex: _currentIndex,
labelType: NavigationRailLabelType.selected,
groupAlignment: -1,
@ -48,7 +50,8 @@ class _AppNavigationRailState extends State<AppNavigationRail> {
tooltip: AppNavigation.destinations.last.label,
onPressed: () {
setState(() => _currentIndex = null);
AppRouter.instance.goNamed(AppNavigation.destinations.last.page);
AppRouter.instance
.goNamed(AppNavigation.destinations.last.page);
},
),
),
@ -60,6 +63,7 @@ class _AppNavigationRailState extends State<AppNavigationRail> {
).paddingOnly(
top: max(16, MediaQuery.of(context).padding.top),
bottom: max(16, MediaQuery.of(context).padding.bottom),
),
);
}
}