Remove outdated Flutter migration documents and add new technical descriptions and profile repository implementation
- Deleted `next_steps_flutter.md` and `teknisk_beskrivning_flutter.md` files as they were outdated. - Added new `next_steps_flutter.md` and `teknisk_beskrivning_flutter.md` files with updated migration plans and technical descriptions for the Flutter frontend. - Implemented `profile_repository.dart` to handle profile data retrieval and updates using the API. Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import '../../../core/api/api_client.dart';
|
||||
import '../../../core/api/guarded_api_call.dart';
|
||||
import '../../../core/api/api_exception.dart';
|
||||
|
||||
final profileRepositoryProvider = Provider<ProfileRepository>((ref) {
|
||||
final apiClient = ref.read(apiClientProvider);
|
||||
return ProfileRepository(apiClient);
|
||||
});
|
||||
|
||||
class ProfileRepository {
|
||||
final ApiClient _apiClient;
|
||||
|
||||
ProfileRepository(this._apiClient);
|
||||
|
||||
Future<Map<String, dynamic>> getProfile() async {
|
||||
return guardedApiCall(
|
||||
() => _apiClient.getJson('/api/profile'),
|
||||
);
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> updateProfile(Map<String, dynamic> profileData) async {
|
||||
return guardedApiCall(
|
||||
() => _apiClient.patchJson('/api/profile', profileData),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user