setSelfInfo method
Implementation
Future<void> setSelfInfo({
String? avatar,
String? nickname,
int? gender,
String? motto,
String? birthday,
}) async {
await _net.http.post('/api/v1/user/detail-update', data: {
'avatar': ?avatar,
'nickname': ?nickname,
'gender': ?gender,
'motto': ?motto,
'birthday': ?birthday,
});
if (_self != null) {
_self = _self!.copyWith(
avatar: avatar,
nickname: nickname,
gender: gender,
motto: motto,
birthday: birthday,
);
await _store.setKv(
LocalStorage.keyUserInfo,
encodeJsonString(_self!.toJson()),
);
_listener?.selfInfoUpdated(_self!);
}
}