feat: add onboarding flow with visual redesign
Introduce 6-step onboarding screen (Goal → Gender → DOB → Height+Weight → Activity → Calories) with per-step accent colors, hero illustration area (concentric circles + icon), and white card content panel. Backend user entity and service updated to support onboarding fields (goal, activity, height, weight, DOB, dailyCalories). Router guards unauthenticated and onboarding-incomplete users. Profile service and screen updated to expose language and onboarding preferences. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1215
client/lib/features/onboarding/onboarding_screen.dart
Normal file
1215
client/lib/features/onboarding/onboarding_screen.dart
Normal file
File diff suppressed because it is too large
Load Diff
@@ -51,12 +51,12 @@ class ProfileScreen extends ConsumerWidget {
|
||||
|
||||
// ── Profile body ──────────────────────────────────────────────
|
||||
|
||||
class _ProfileBody extends StatelessWidget {
|
||||
class _ProfileBody extends ConsumerWidget {
|
||||
final User user;
|
||||
const _ProfileBody({required this.user});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
return ListView(
|
||||
padding: const EdgeInsets.fromLTRB(16, 8, 16, 32),
|
||||
children: [
|
||||
|
||||
@@ -17,6 +17,7 @@ class UpdateProfileRequest {
|
||||
final String? activity;
|
||||
final String? goal;
|
||||
final String? language;
|
||||
final int? dailyCalories;
|
||||
|
||||
const UpdateProfileRequest({
|
||||
this.name,
|
||||
@@ -27,6 +28,7 @@ class UpdateProfileRequest {
|
||||
this.activity,
|
||||
this.goal,
|
||||
this.language,
|
||||
this.dailyCalories,
|
||||
});
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -39,6 +41,7 @@ class UpdateProfileRequest {
|
||||
if (activity != null) map['activity'] = activity;
|
||||
if (goal != null) map['goal'] = goal;
|
||||
if (language != null) map['preferences'] = {'language': language};
|
||||
if (dailyCalories != null) map['daily_calories'] = dailyCalories;
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user