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'; import 'package:sk_base_mobile/apis/api.dart' as Api; class UserInfoController extends GetxController { final nickNameController = TextEditingController(text: ''); @override void onReady() async { nickNameController.text = AuthStore.to.userInfo.value.nickname ?? ''; super.onReady(); } Future saveUserInfo() async { Map data = { 'nickname': nickNameController.text, }; await AuthStore.to.saveUserInfo(data); } }