13 lines
380 B
Dart
13 lines
380 B
Dart
class AuthService {
|
|
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');
|
|
}
|
|
}
|
|
}
|