Skip to content

Commit 1efea3e

Browse files
committed
feat(mobile): add create screens for medications, wellness, and relations
- Add medication create screen with pill name and time picker - Add wellness log create screen with status selector and summary - Add relation create screen with host/caregiver ID and role selector - Add FABs to medications, wellness, and relations list screens - Update navigation screen to show start form when no active session - Enhance host/concierge home screens with navigation and profile access - Add 18 new i18n keys across en/ko/ja locales - Register new routes in go_router
1 parent a793bac commit 1efea3e

17 files changed

Lines changed: 1069 additions & 111 deletions

File tree

apps/mobile/lib/core/router/router.dart

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ import 'package:mobile/features/concierge/presentation/screens/concierge_home_sc
77
import 'package:mobile/features/host/presentation/screens/host_home_screen.dart';
88
import 'package:mobile/features/live/presentation/screens/concierge_live_screen.dart';
99
import 'package:mobile/features/live/presentation/screens/host_live_screen.dart';
10+
import 'package:mobile/features/medications/presentation/screens/medication_create_screen.dart';
1011
import 'package:mobile/features/medications/presentation/screens/medications_screen.dart';
1112
import 'package:mobile/features/navigation/presentation/screens/navigation_screen.dart';
1213
import 'package:mobile/features/notifications/presentation/screens/notification_settings_screen.dart';
14+
import 'package:mobile/features/relations/presentation/screens/relation_create_screen.dart';
1315
import 'package:mobile/features/relations/presentation/screens/relations_screen.dart';
1416
import 'package:mobile/features/users/presentation/screens/profile_screen.dart';
17+
import 'package:mobile/features/wellness/presentation/screens/wellness_create_screen.dart';
1518
import 'package:mobile/features/wellness/presentation/screens/wellness_screen.dart';
1619
import 'package:riverpod_annotation/riverpod_annotation.dart';
1720

@@ -74,13 +77,27 @@ GoRouter router(Ref ref) {
7477
return MedicationsScreen(hostId: hostId);
7578
},
7679
),
80+
GoRoute(
81+
path: '/medications/create',
82+
builder: (context, state) {
83+
final hostId = state.uri.queryParameters['hostId'] ?? '';
84+
return MedicationCreateScreen(hostId: hostId);
85+
},
86+
),
7787
GoRoute(
7888
path: '/wellness',
7989
builder: (context, state) {
8090
final hostId = state.uri.queryParameters['hostId'] ?? '';
8191
return WellnessScreen(hostId: hostId);
8292
},
8393
),
94+
GoRoute(
95+
path: '/wellness/create',
96+
builder: (context, state) {
97+
final hostId = state.uri.queryParameters['hostId'] ?? '';
98+
return WellnessCreateScreen(hostId: hostId);
99+
},
100+
),
84101
GoRoute(
85102
path: '/relations',
86103
builder: (context, state) {
@@ -89,6 +106,10 @@ GoRouter router(Ref ref) {
89106
return RelationsScreen(hostId: hostId, caregiverId: caregiverId);
90107
},
91108
),
109+
GoRoute(
110+
path: '/relations/create',
111+
builder: (context, state) => const RelationCreateScreen(),
112+
),
92113
GoRoute(
93114
path: '/navigation',
94115
builder: (context, state) {

apps/mobile/lib/features/concierge/presentation/screens/concierge_home_screen.dart

Lines changed: 95 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ class ConciergeHomeScreen extends ConsumerWidget {
2020
appBar: AppBar(
2121
title: Text(l10n.welcomeConcierge),
2222
actions: [
23+
IconButton(
24+
icon: const Icon(Icons.notifications, size: 28),
25+
tooltip: l10n.notifications,
26+
onPressed: () => context.push('/notifications/settings'),
27+
),
28+
IconButton(
29+
icon: const Icon(Icons.person, size: 28),
30+
tooltip: l10n.profile,
31+
onPressed: () => context.push('/profile'),
32+
),
2333
IconButton(
2434
icon: const Icon(Icons.logout, size: 28),
2535
tooltip: l10n.logout,
@@ -28,101 +38,97 @@ class ConciergeHomeScreen extends ConsumerWidget {
2838
],
2939
),
3040
body: SafeArea(
31-
child: Padding(
41+
child: ListView(
3242
padding: const EdgeInsets.all(16),
43+
children: [
44+
_DashboardCard(
45+
icon: Icons.videocam,
46+
iconColor: const Color(0xFF0055FF),
47+
title: l10n.liveSession,
48+
onTap: () => context.push('/live/concierge'),
49+
trailing: FilledButton.icon(
50+
onPressed: () => context.push('/live/concierge'),
51+
icon: const Icon(Icons.visibility, size: 24),
52+
label: Text(l10n.watchLive),
53+
),
54+
),
55+
_DashboardCard(
56+
icon: Icons.people,
57+
iconColor: const Color(0xFF7B1FA2),
58+
title: l10n.careRelations,
59+
onTap: () => context.push('/relations'),
60+
),
61+
_DashboardCard(
62+
icon: Icons.medication,
63+
iconColor: const Color(0xFF4CAF50),
64+
title: l10n.medications,
65+
onTap: () => context.push('/medications'),
66+
),
67+
_DashboardCard(
68+
icon: Icons.favorite,
69+
iconColor: const Color(0xFFFF7043),
70+
title: l10n.wellness,
71+
onTap: () => context.push('/wellness'),
72+
),
73+
_DashboardCard(
74+
icon: Icons.navigation,
75+
iconColor: const Color(0xFF1565C0),
76+
title: l10n.navigation,
77+
onTap: () => context.push('/navigation'),
78+
),
79+
],
80+
),
81+
),
82+
);
83+
}
84+
}
85+
86+
class _DashboardCard extends StatelessWidget {
87+
const _DashboardCard({
88+
required this.icon,
89+
required this.iconColor,
90+
required this.title,
91+
required this.onTap,
92+
this.trailing,
93+
});
94+
95+
final IconData icon;
96+
final Color iconColor;
97+
final String title;
98+
final VoidCallback onTap;
99+
final Widget? trailing;
100+
101+
@override
102+
Widget build(BuildContext context) {
103+
return Card(
104+
child: InkWell(
105+
onTap: onTap,
106+
borderRadius: BorderRadius.circular(16),
107+
child: Padding(
108+
padding: const EdgeInsets.all(20),
33109
child: Column(
34-
crossAxisAlignment: CrossAxisAlignment.stretch,
110+
crossAxisAlignment: CrossAxisAlignment.start,
35111
children: [
36-
Card(
37-
child: Padding(
38-
padding: const EdgeInsets.all(20),
39-
child: Column(
40-
crossAxisAlignment: CrossAxisAlignment.start,
41-
children: [
42-
Row(
43-
children: [
44-
const Icon(
45-
Icons.videocam,
46-
size: 28,
47-
color: Color(0xFF0055FF),
48-
),
49-
const SizedBox(width: 12),
50-
Text(
51-
l10n.liveSession,
52-
style: Theme.of(context).textTheme.titleLarge,
53-
),
54-
],
55-
),
56-
const SizedBox(height: 16),
57-
FilledButton.icon(
58-
onPressed: () => context.go('/live/concierge'),
59-
icon: const Icon(Icons.visibility, size: 24),
60-
label: Text(l10n.watchLive),
61-
),
62-
],
63-
),
64-
),
65-
),
66-
const SizedBox(height: 8),
67-
Card(
68-
child: Padding(
69-
padding: const EdgeInsets.all(20),
70-
child: Column(
71-
crossAxisAlignment: CrossAxisAlignment.start,
72-
children: [
73-
Row(
74-
children: [
75-
const Icon(
76-
Icons.medication,
77-
size: 28,
78-
color: Color(0xFF4CAF50),
79-
),
80-
const SizedBox(width: 12),
81-
Text(
82-
l10n.medications,
83-
style: Theme.of(context).textTheme.titleLarge,
84-
),
85-
],
86-
),
87-
const SizedBox(height: 12),
88-
Text(
89-
l10n.noMedications,
90-
style: Theme.of(context).textTheme.bodyMedium,
91-
),
92-
],
112+
Row(
113+
children: [
114+
Icon(icon, size: 28, color: iconColor),
115+
const SizedBox(width: 12),
116+
Expanded(
117+
child: Text(
118+
title,
119+
style: Theme.of(context).textTheme.titleLarge,
120+
),
93121
),
94-
),
95-
),
96-
const SizedBox(height: 8),
97-
Card(
98-
child: Padding(
99-
padding: const EdgeInsets.all(20),
100-
child: Column(
101-
crossAxisAlignment: CrossAxisAlignment.start,
102-
children: [
103-
Row(
104-
children: [
105-
const Icon(
106-
Icons.favorite,
107-
size: 28,
108-
color: Color(0xFFFF7043),
109-
),
110-
const SizedBox(width: 12),
111-
Text(
112-
l10n.wellness,
113-
style: Theme.of(context).textTheme.titleLarge,
114-
),
115-
],
116-
),
117-
const SizedBox(height: 12),
118-
Text(
119-
l10n.noWellnessLogs,
120-
style: Theme.of(context).textTheme.bodyMedium,
121-
),
122-
],
122+
Icon(
123+
Icons.chevron_right,
124+
color: Theme.of(context).colorScheme.outline,
123125
),
124-
),
126+
],
125127
),
128+
if (trailing != null) ...[
129+
const SizedBox(height: 16),
130+
trailing!,
131+
],
126132
],
127133
),
128134
),

apps/mobile/lib/features/host/presentation/screens/host_home_screen.dart

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ class HostHomeScreen extends ConsumerWidget {
2020
appBar: AppBar(
2121
title: Text(l10n.appTitle),
2222
actions: [
23+
IconButton(
24+
icon: const Icon(Icons.notifications, size: 28),
25+
tooltip: l10n.notifications,
26+
onPressed: () => context.push('/notifications/settings'),
27+
),
28+
IconButton(
29+
icon: const Icon(Icons.person, size: 28),
30+
tooltip: l10n.profile,
31+
onPressed: () => context.push('/profile'),
32+
),
2333
IconButton(
2434
icon: const Icon(Icons.logout, size: 28),
2535
tooltip: l10n.logout,
@@ -51,14 +61,21 @@ class HostHomeScreen extends ConsumerWidget {
5161
icon: Icons.medication,
5262
label: l10n.medications,
5363
color: const Color(0xFF4CAF50),
54-
onPressed: () => context.go('/medications'),
64+
onPressed: () => context.push('/medications'),
5565
),
5666
const SizedBox(height: 20),
5767
_HomeButton(
5868
icon: Icons.favorite,
5969
label: l10n.wellness,
6070
color: const Color(0xFFFF7043),
61-
onPressed: () => context.go('/wellness'),
71+
onPressed: () => context.push('/wellness'),
72+
),
73+
const SizedBox(height: 20),
74+
_HomeButton(
75+
icon: Icons.navigation,
76+
label: l10n.navigation,
77+
color: const Color(0xFF1565C0),
78+
onPressed: () => context.push('/navigation'),
6279
),
6380
],
6481
),

0 commit comments

Comments
 (0)