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

21 lines
549 B
Dart

import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:sk_base_mobile/store/auth.store.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);
}
}