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.
20 lines
462 B
20 lines
462 B
2 weeks ago
|
import 'package:dio/dio.dart';
|
||
|
import 'package:problem_check_system/data/models/login_model.dart';
|
||
|
|
||
|
class AuthProvider {
|
||
|
final String _signInUrl = '/api/Accounts/SignIn';
|
||
|
|
||
|
final Dio _dio;
|
||
|
|
||
|
AuthProvider({required Dio dio}) : _dio = dio;
|
||
|
|
||
|
Future<Response> signIn(LoginModel loginModel) async {
|
||
|
try {
|
||
|
final response = await _dio.post(_signInUrl, data: loginModel.toMap());
|
||
|
return response;
|
||
|
} on DioException {
|
||
|
rethrow;
|
||
|
}
|
||
|
}
|
||
|
}
|