You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
762B

  1. import 'package:farm_tpf/data/api/dio_provider.dart';
  2. import 'package:farm_tpf/data/api/rest_client.dart';
  3. import 'package:farm_tpf/models/account.dart';
  4. import 'package:farm_tpf/models/password.dart';
  5. class UserRepository {
  6. final dio = DioProvider.instance();
  7. Future<Account> getUser() {
  8. final client = RestClient(dio);
  9. return client.getMe();
  10. }
  11. Future<void> forgotPassword(String email) {
  12. final client = RestClient(dio);
  13. return client.forgotPassword(email);
  14. }
  15. Future<void> changePassword(Password password) {
  16. final client = RestClient(dio);
  17. return client.changePassword(password);
  18. }
  19. Future<Account> updateProfile(Account account) {
  20. final client = RestClient(dio);
  21. return client.updateProfile(account);
  22. }
  23. }