mirror of
				https://github.com/immich-app/immich.git
				synced 2025-10-30 18:22:37 -04:00 
			
		
		
		
	* Refactor sharing to album * Added library page in the bottom navigation bar * Refactor SharedAlbumService to album service * Refactor apiProvider to its file * Added image grid * render album thumbnail * Using the wrap to render thumbnail and album info better * Navigate to album viewer * After deletion, navigate to the respective page of the shared and non-shared album * Correctly remove album in local state * Refactor create album page * Implemented create non-shared album
		
			
				
	
	
		
			52 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			52 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
| import 'package:flutter/material.dart';
 | |
| import 'package:hooks_riverpod/hooks_riverpod.dart';
 | |
| import 'package:http/http.dart';
 | |
| import 'package:http_parser/http_parser.dart';
 | |
| import 'package:image_picker/image_picker.dart';
 | |
| import 'package:immich_mobile/shared/providers/api.provider.dart';
 | |
| import 'package:immich_mobile/shared/services/api.service.dart';
 | |
| import 'package:immich_mobile/utils/files_helper.dart';
 | |
| import 'package:openapi/api.dart';
 | |
| 
 | |
| final userServiceProvider = Provider(
 | |
|   (ref) => UserService(
 | |
|     ref.watch(apiServiceProvider),
 | |
|   ),
 | |
| );
 | |
| 
 | |
| class UserService {
 | |
|   final ApiService _apiService;
 | |
| 
 | |
|   UserService(this._apiService);
 | |
| 
 | |
|   Future<List<UserResponseDto>?> getAllUsersInfo({required bool isAll}) async {
 | |
|     try {
 | |
|       return await _apiService.userApi.getAllUsers(isAll);
 | |
|     } catch (e) {
 | |
|       debugPrint("Error [getAllUsersInfo]  ${e.toString()}");
 | |
|       return null;
 | |
|     }
 | |
|   }
 | |
| 
 | |
|   Future<CreateProfileImageResponseDto?> uploadProfileImage(XFile image) async {
 | |
|     try {
 | |
|       var mimeType = FileHelper.getMimeType(image.path);
 | |
| 
 | |
|       return await _apiService.userApi.createProfileImage(
 | |
|         MultipartFile.fromBytes(
 | |
|           'file',
 | |
|           await image.readAsBytes(),
 | |
|           filename: image.name,
 | |
|           contentType: MediaType(
 | |
|             mimeType["type"],
 | |
|             mimeType["subType"],
 | |
|           ),
 | |
|         ),
 | |
|       );
 | |
|     } catch (e) {
 | |
|       debugPrint("Error [uploadProfileImage] ${e.toString()}");
 | |
|       return null;
 | |
|     }
 | |
|   }
 | |
| }
 |