mobile_skt/lib/screens/mine/useinfo/userinfo.controller.dart

23 lines
659 B
Dart
Raw Normal View History

import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:sk_base_mobile/models/user_info.model.dart';
import 'package:sk_base_mobile/store/auth.store.dart';
2024-03-26 15:30:43 +08:00
import 'package:sk_base_mobile/apis/index.dart';
class UserInfoController extends GetxController {
final nickNameController = TextEditingController(text: '');
@override
void onReady() async {
nickNameController.text = AuthStore.to.userInfo.value.nickname ?? '';
super.onReady();
}
Future<void> saveUserInfo() async {
Map<String, dynamic> data = {
'nickname': nickNameController.text,
};
await AuthStore.to.saveUserInfo(data);
}
}