chore: bump dart sdk to 3.8 (#20355)

* chore: bump dart sdk to 3.8

* chore: make build

* make pigeon

* chore: format files

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
shenlong 2025-07-29 00:34:03 +05:30 committed by GitHub
parent 9b3718120b
commit e52b9d15b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
643 changed files with 32561 additions and 35292 deletions

View file

@ -6,26 +6,15 @@ import 'package:image_picker/image_picker.dart';
import 'package:immich_mobile/domain/services/user.service.dart';
import 'package:immich_mobile/providers/infrastructure/user.provider.dart';
enum UploadProfileStatus {
idle,
loading,
success,
failure,
}
enum UploadProfileStatus { idle, loading, success, failure }
class UploadProfileImageState {
// enum
final UploadProfileStatus status;
final String profileImagePath;
const UploadProfileImageState({
required this.status,
required this.profileImagePath,
});
const UploadProfileImageState({required this.status, required this.profileImagePath});
UploadProfileImageState copyWith({
UploadProfileStatus? status,
String? profileImagePath,
}) {
UploadProfileImageState copyWith({UploadProfileStatus? status, String? profileImagePath}) {
return UploadProfileImageState(
status: status ?? this.status,
profileImagePath: profileImagePath ?? this.profileImagePath,
@ -68,29 +57,18 @@ class UploadProfileImageState {
class UploadProfileImageNotifier extends StateNotifier<UploadProfileImageState> {
UploadProfileImageNotifier(this._userService)
: super(
const UploadProfileImageState(
profileImagePath: '',
status: UploadProfileStatus.idle,
),
);
: super(const UploadProfileImageState(profileImagePath: '', status: UploadProfileStatus.idle));
final UserService _userService;
Future<bool> upload(XFile file) async {
state = state.copyWith(status: UploadProfileStatus.loading);
var profileImagePath = await _userService.createProfileImage(
file.name,
await file.readAsBytes(),
);
var profileImagePath = await _userService.createProfileImage(file.name, await file.readAsBytes());
if (profileImagePath != null) {
debugPrint("Successfully upload profile image");
state = state.copyWith(
status: UploadProfileStatus.success,
profileImagePath: profileImagePath,
);
state = state.copyWith(status: UploadProfileStatus.success, profileImagePath: profileImagePath);
return true;
}