Skip to content

Commit 3dc212b

Browse files
committed
fix: Smaller UI stylings
1 parent 55a721e commit 3dc212b

File tree

6 files changed

+63
-9
lines changed

6 files changed

+63
-9
lines changed

kitchenowl/lib/enums/views_enum.dart

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,17 @@ enum ViewsEnum {
4040
IconData toIcon(BuildContext context) {
4141
return [
4242
Icons.shopping_bag_outlined,
43-
Icons.receipt,
43+
Icons.receipt_outlined,
44+
Icons.calendar_today_outlined,
45+
Icons.account_balance_outlined,
46+
App.isOffline ? Icons.cloud_off_rounded : Icons.person_outline_rounded,
47+
][index];
48+
}
49+
50+
IconData toSelectedIcon(BuildContext context) {
51+
return [
52+
Icons.shopping_bag_rounded,
53+
Icons.receipt_rounded,
4454
Icons.calendar_today_rounded,
4555
Icons.account_balance_rounded,
4656
App.isOffline ? Icons.cloud_off_rounded : Icons.person_rounded,

kitchenowl/lib/pages/household_page.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ class _HouseholdPageState extends State<HouseholdPage> {
198198
destinations: pages
199199
.map((e) => NavigationDestination(
200200
icon: Icon(e.toIcon(context)),
201+
selectedIcon: Icon(e.toSelectedIcon(context)),
201202
label: e.toLocalizedShortString(context),
202203
tooltip: e.toLocalizedString(context),
203204
))

kitchenowl/lib/pages/household_page/household_drawer.dart

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter_bloc/flutter_bloc.dart';
3+
import 'package:flutter_blurhash/flutter_blurhash.dart';
34
import 'package:go_router/go_router.dart';
45
import 'package:kitchenowl/app.dart';
56
import 'package:kitchenowl/cubits/auth_cubit.dart';
67
import 'package:kitchenowl/cubits/household_cubit.dart';
78
import 'package:kitchenowl/enums/update_enum.dart';
89
import 'package:kitchenowl/enums/views_enum.dart';
910
import 'package:kitchenowl/kitchenowl.dart';
11+
import 'package:transparent_image/transparent_image.dart';
1012

1113
class HouseholdDrawer extends StatelessWidget {
1214
final int selectedIndex;
@@ -55,11 +57,36 @@ class HouseholdDrawer extends StatelessWidget {
5557
BlocBuilder<HouseholdCubit, HouseholdState>(
5658
builder: (context, state) => Padding(
5759
padding: const EdgeInsets.fromLTRB(28, 16, 16, 10),
58-
child: Text(
59-
state.household.name,
60-
style: Theme.of(context).textTheme.titleSmall,
61-
maxLines: 1,
62-
overflow: TextOverflow.ellipsis,
60+
child: Column(
61+
crossAxisAlignment: CrossAxisAlignment.stretch,
62+
children: [
63+
if (state.household.image != null)
64+
Padding(
65+
padding: const EdgeInsets.only(bottom: 16),
66+
child: ClipRRect(
67+
borderRadius: BorderRadius.circular(14),
68+
child: SizedBox(
69+
height: 150,
70+
child: FadeInImage(
71+
fit: BoxFit.cover,
72+
placeholder: state.household.imageHash != null
73+
? BlurHashImage(state.household.imageHash!)
74+
: MemoryImage(kTransparentImage) as ImageProvider,
75+
image: getImageProvider(
76+
context,
77+
state.household.image!,
78+
),
79+
),
80+
),
81+
),
82+
),
83+
Text(
84+
state.household.name,
85+
style: Theme.of(context).textTheme.titleSmall,
86+
maxLines: 1,
87+
overflow: TextOverflow.ellipsis,
88+
),
89+
],
6390
),
6491
),
6592
),
@@ -72,6 +99,7 @@ class HouseholdDrawer extends StatelessWidget {
7299
overflow: TextOverflow.ellipsis,
73100
),
74101
icon: Icon(destination.toIcon(context)),
102+
selectedIcon: Icon(destination.toSelectedIcon(context)),
75103
);
76104
},
77105
),

kitchenowl/lib/pages/household_page/household_navigation_rail.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ class HouseholdNavigationRail extends StatelessWidget {
3838
label: Text(AppLocalizations.of(context)!.more),
3939
),
4040
...pages.map((e) => NavigationRailDestination(
41-
icon: Icon(e.toIcon(context)),
4241
label: Text(e.toLocalizedString(context)),
42+
icon: Icon(e.toIcon(context)),
43+
selectedIcon: Icon(e.toSelectedIcon(context)),
4344
)),
4445
],
4546
selectedIndex: selectedIndex + 1,

kitchenowl/lib/pages/settings_user_page.dart

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,20 @@ class _SettingsUserPageState extends State<SettingsUserPage> {
191191
labelText: AppLocalizations.of(context)!.name,
192192
),
193193
),
194+
if (cubit.userId == null && App.isDefaultServer) ...[
195+
const SizedBox(height: 8),
196+
Text(
197+
AppLocalizations.of(context)!.accountCreateHint,
198+
style:
199+
Theme.of(context).textTheme.labelMedium?.copyWith(
200+
color: Theme.of(context)
201+
.textTheme
202+
.labelMedium
203+
?.color
204+
?.withOpacity(0.8),
205+
),
206+
),
207+
],
194208
const SizedBox(height: 8),
195209
if (cubit.userId != null)
196210
BlocBuilder<SettingsUserCubit, SettingsUserState>(
@@ -211,7 +225,7 @@ class _SettingsUserPageState extends State<SettingsUserPage> {
211225
),
212226
const SizedBox(height: 8),
213227
Padding(
214-
padding: const EdgeInsets.only(bottom: 32),
228+
padding: const EdgeInsets.only(bottom: 24),
215229
child: LoadingElevatedButton(
216230
onPressed: () => cubit.updateUser(
217231
context: context,

kitchenowl/lib/widgets/settings_household/view_settings_list_tile.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ViewSettingsListTile<Cubit extends HouseholdAddUpdateCubit>
2323
title: Text(
2424
view.toLocalizedString(context),
2525
),
26-
leading: Icon(view.toIcon(context)),
26+
leading: Icon(view.toSelectedIcon(context)),
2727
contentPadding: EdgeInsets.only(left: 16),
2828
trailing: Row(
2929
mainAxisSize: MainAxisSize.min,

0 commit comments

Comments
 (0)