2024-03-18 13:23:58 +08:00
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
import 'package:sk_base_mobile/store/auth.store.dart';
|
|
|
|
|
|
|
|
class UserInfoController extends GetxController {
|
2024-04-10 11:04:27 +08:00
|
|
|
final nicknameController = TextEditingController(text: '');
|
2024-03-18 13:23:58 +08:00
|
|
|
|
|
|
|
@override
|
|
|
|
void onReady() async {
|
2024-04-10 11:04:27 +08:00
|
|
|
nicknameController.text = AuthStore.to.userInfo.value.nickname ?? '';
|
2024-03-18 13:23:58 +08:00
|
|
|
super.onReady();
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<void> saveUserInfo() async {
|
|
|
|
Map<String, dynamic> data = {
|
2024-04-10 11:04:27 +08:00
|
|
|
'nickname': nicknameController.text,
|
2024-03-18 13:23:58 +08:00
|
|
|
};
|
|
|
|
await AuthStore.to.saveUserInfo(data);
|
|
|
|
}
|
|
|
|
}
|