This commit is contained in:
zhutao
2025-09-01 16:24:34 +08:00
parent b110d1439c
commit bdfd051a47
8 changed files with 284 additions and 241 deletions

View File

@@ -1,9 +1,14 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:provider/provider.dart';
import 'package:remixicon/remixicon.dart';
import '../page/home/home_page.dart';
import '../page/profile/my/my_page.dart';
import '../page/record/list/record_list_page.dart';
import '../providers/user_store.dart';
import '../router/config/route_paths.dart';
import 'tabbar.dart';
class LayoutPage extends StatefulWidget {
@@ -41,6 +46,44 @@ class _LayoutPageState extends State<LayoutPage> {
),
];
@override
void initState() {
super.initState();
_init();
}
void _init() async {
UserStore userStore = context.read<UserStore>();
await userStore.init();
print(userStore.profile.toString());
if (userStore.profile.qStatus != 1) {
showCupertinoDialog(
context: context,
builder: (_) => CupertinoAlertDialog(
title: Text("Complete Your Profile"),
content: Text("Lets get to know you better! Please take a quick survey to personalize your experience."),
actions: [
CupertinoDialogAction(
child: Text("Take Survey"),
onPressed: () {
context.pop();
_goEditProfile();
},
),
],
),
);
}
}
void _goEditProfile() async {
var isUpload = await context.push(RoutePaths.myEdit);
if (isUpload == true) {
UserStore userStore = context.read<UserStore>();
userStore.init();
}
}
@override
Widget build(BuildContext context) {
return Scaffold(