signIn method

Future<FirebaseResponse> signIn()
override

Implementation

Future<FirebaseResponse> signIn() async{
  assert(_debugAssertNotDisposed());
  if(this.email.isEmpty) return FirebaseResponse(result: "", error: FirebaseResponseErrorDetail(errorCheck: FirebaseResponseError.Error, errorData: "EMail isEmpty"));
  if(this.pw.isEmpty) return FirebaseResponse(result: "", error: FirebaseResponseErrorDetail(errorCheck: FirebaseResponseError.Error, errorData: "PW isEmpty"));
  const String _endPoint = "https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=";
  try{
    final http.Response _res = await this.connect(endPoint: _endPoint, apiKey: this.firebaseApiKey, bodyData: this._bodyData(this.email, this.pw));
    if(_res.statusCode != 200) return this._error(_res.body, FirebaseResponseError.Error);
    return this._parse(_res.body);
  }
  catch(e){
    return FirebaseResponse(result: "", error: FirebaseResponseErrorDetail(errorCheck: FirebaseResponseError.Error, errorData: "ERROR"));
  }
}