You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tangheem/lib/api/authentication_api_client.dart

19 lines
677 B
Dart

import 'package:tangheem/classes/consts.dart';
import 'package:tangheem/models/authentication_user_model.dart';
import 'api_client.dart';
class AuthenticationApiClient {
static final AuthenticationApiClient _instance = AuthenticationApiClient._internal();
AuthenticationApiClient._internal();
factory AuthenticationApiClient() => _instance;
Future<AuthenticationUserModel> authenticateUser(String email, String password) async {
String url = "${ApiConsts.authentication}Login";
var postParams = {"email": email, "password": password};
return await ApiClient().postJsonForObject((json) => AuthenticationUserModel.fromJson(json), url, postParams);
}
}