| 1234567891011121314151617181920212223242526272829 |
- import 'package:e2ee_chat/common/api.dart';
- import 'package:e2ee_chat/model/user.dart';
- import 'package:flutter/cupertino.dart';
- import 'contact_list.dart';
- class UserProfilePresenter extends ChangeNotifier {
- UserProfilePresenter(this.user);
- final User user;
- Future<bool> refresh() async {
- bool _result = true;
- try {
- var json = (await Api().userProfile(user.username))!;
- user.bio = json["bio"];
- user.phone = json["phone"];
- notifyListeners();
- // TODO: avatar
- } catch (e) {
- _result = false;
- }
- return _result;
- }
- @override
- void notifyListeners() {
- super.notifyListeners();
- }
- }
|