37 lines
1.0 KiB
Dart
37 lines
1.0 KiB
Dart
import 'network_manager.dart';
|
|
|
|
class AuthService {
|
|
AuthService({required NetworkManager networkManager})
|
|
: _networkManager = networkManager;
|
|
|
|
final NetworkManager _networkManager;
|
|
|
|
Future<Map<String, dynamic>> login(String email, String password) async {
|
|
// شبیهسازی API Call
|
|
await Future.delayed(const Duration(seconds: 2));
|
|
|
|
if (email == 'test@example.com' && password == 'password123') {
|
|
return {'token': 'xyz123', 'name': 'John Doe'};
|
|
} else {
|
|
throw Exception('Invalid credentials');
|
|
}
|
|
}
|
|
}
|
|
|
|
// Future<Result<OnlineGalleryResponse>> getImages(String projectId) async {
|
|
// try {
|
|
// final result = await networkManager.makeRequest(
|
|
// '/api/v1/projects/$projectId/files',
|
|
// (json) {
|
|
// Logger().i(json);
|
|
// return OnlineGalleryResponse.fromJson(json);
|
|
// },
|
|
// method: 'GET',
|
|
// );
|
|
|
|
// return Result.ok(result);
|
|
// } on DioException catch (e) {
|
|
// return Result.error(e);
|
|
// }
|
|
// }
|