import 'dart:async';
import 'package:flutter/material.dart';
import 'package:mypoint_flutter_app/networking/restful_api_request.dart';
import '../../base/restful_api_viewmodel.dart';

abstract class ICreatePasswordRepository {
  late String phoneNumber;
  Future<bool?> createPassword(String newPassword);
  Future<bool> signup(String password);
}

class SignUpCreatePasswordRepository extends RestfulApiViewModel implements ICreatePasswordRepository {
  @override
  late String phoneNumber;

  SignUpCreatePasswordRepository(this.phoneNumber);

  @override
  Future<bool> signup(String password) async {
    showLoading();
    return client.signup(phoneNumber, password).then((value) {
      hideLoading();
      return value.isSuccess;
    });
  }

  @override
  Future<bool?> createPassword(String newPassword) {
    // TODO: implement createPassword
    throw UnimplementedError();
  }
}
