登录流程已全部重构
This commit is contained in:
14
lib/stores/user_store.dart
Normal file
14
lib/stores/user_store.dart
Normal file
@@ -0,0 +1,14 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:food_health/api/dto/user_profile_dto.dart';
|
||||
import 'package:food_health/api/endpoints/profile_api.dart';
|
||||
|
||||
class UserStore with ChangeNotifier {
|
||||
UserProfileDto profile = UserProfileDto();
|
||||
|
||||
//初始化数据
|
||||
Future<void> init() async {
|
||||
var res = await getUserProfileApi();
|
||||
profile = res;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user