feat: Implement the home screen with new UI components and assets, and refine authentication screens and routing.

This commit is contained in:
pradeepkumar
2026-02-24 03:19:55 +05:30
parent 4f8ad7fe49
commit 0bc8852c17
31 changed files with 1540 additions and 24 deletions

View File

@@ -52,6 +52,32 @@ class AuthRepository {
}
}
Future<UserModel> getMe() async {
try {
final response = await _dio.get(ApiConstants.authMe);
final data = response.data['data'] as Map<String, dynamic>;
return UserModel.fromJson(data);
} on DioException catch (e) {
if (e.error is ApiException) {
throw e.error as ApiException;
}
throw ApiException(
message: e.message ?? 'Failed to fetch user',
statusCode: e.response?.statusCode,
);
}
}
Future<void> logout() async {
try {
await _dio.post(ApiConstants.authLogout);
} catch (_) {
// Ignore logout API errors — still clear local tokens
} finally {
await SecureStorage.clearTokens();
}
}
Future<UserModel> register(RegisterRequest request) async {
try {
final response = await _dio.post(