chore: bump line length to 120 (#20191)
This commit is contained in:
@@ -17,9 +17,7 @@ class AssetPeopleNotifier extends _$AssetPeopleNotifier {
|
||||
return [];
|
||||
}
|
||||
|
||||
final list = await ref
|
||||
.watch(assetServiceProvider)
|
||||
.getRemotePeopleOfAsset(asset.remoteId!);
|
||||
final list = await ref.watch(assetServiceProvider).getRemotePeopleOfAsset(asset.remoteId!);
|
||||
if (list == null) {
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -32,10 +32,8 @@ class AssetStackNotifier extends StateNotifier<List<Asset>> {
|
||||
}
|
||||
}
|
||||
|
||||
final assetStackStateProvider = StateNotifierProvider.autoDispose
|
||||
.family<AssetStackNotifier, List<Asset>, String>(
|
||||
(ref, stackId) =>
|
||||
AssetStackNotifier(ref.watch(assetServiceProvider), stackId),
|
||||
final assetStackStateProvider = StateNotifierProvider.autoDispose.family<AssetStackNotifier, List<Asset>, String>(
|
||||
(ref, stackId) => AssetStackNotifier(ref.watch(assetServiceProvider), stackId),
|
||||
);
|
||||
|
||||
@riverpod
|
||||
|
||||
@@ -62,8 +62,7 @@ class DownloadStateNotifier extends StateNotifier<DownloadState> {
|
||||
if (update.task.metaData.isEmpty) {
|
||||
return;
|
||||
}
|
||||
final livePhotosId =
|
||||
LivePhotosMetadata.fromJson(update.task.metaData).id;
|
||||
final livePhotosId = LivePhotosMetadata.fromJson(update.task.metaData).id;
|
||||
_downloadService.saveLivePhotos(update.task, livePhotosId);
|
||||
_onDownloadComplete(update.task.taskId);
|
||||
break;
|
||||
@@ -191,8 +190,7 @@ class DownloadStateNotifier extends StateNotifier<DownloadState> {
|
||||
}
|
||||
}
|
||||
|
||||
final downloadStateProvider =
|
||||
StateNotifierProvider<DownloadStateNotifier, DownloadState>(
|
||||
final downloadStateProvider = StateNotifierProvider<DownloadStateNotifier, DownloadState>(
|
||||
((ref) => DownloadStateNotifier(
|
||||
ref.watch(downloadServiceProvider),
|
||||
ref.watch(shareServiceProvider),
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
|
||||
/// Whether to display the video part of a motion photo
|
||||
final isPlayingMotionVideoProvider =
|
||||
StateNotifierProvider<IsPlayingMotionVideo, bool>((ref) {
|
||||
final isPlayingMotionVideoProvider = StateNotifierProvider<IsPlayingMotionVideo, bool>((ref) {
|
||||
return IsPlayingMotionVideo(ref);
|
||||
});
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
|
||||
enum RenderListStatusEnum { complete, empty, error, loading }
|
||||
|
||||
final renderListStatusProvider =
|
||||
StateNotifierProvider<RenderListStatus, RenderListStatusEnum>((ref) {
|
||||
final renderListStatusProvider = StateNotifierProvider<RenderListStatus, RenderListStatusEnum>((ref) {
|
||||
return RenderListStatus(ref);
|
||||
});
|
||||
|
||||
|
||||
@@ -9,8 +9,7 @@ import 'package:immich_mobile/routing/router.dart';
|
||||
import 'package:immich_mobile/services/share_intent_service.dart';
|
||||
import 'package:immich_mobile/services/upload.service.dart';
|
||||
|
||||
final shareIntentUploadProvider = StateNotifierProvider<
|
||||
ShareIntentUploadStateNotifier, List<ShareIntentAttachment>>(
|
||||
final shareIntentUploadProvider = StateNotifierProvider<ShareIntentUploadStateNotifier, List<ShareIntentAttachment>>(
|
||||
((ref) => ShareIntentUploadStateNotifier(
|
||||
ref.watch(appRouterProvider),
|
||||
ref.watch(uploadServiceProvider),
|
||||
@@ -18,8 +17,7 @@ final shareIntentUploadProvider = StateNotifierProvider<
|
||||
)),
|
||||
);
|
||||
|
||||
class ShareIntentUploadStateNotifier
|
||||
extends StateNotifier<List<ShareIntentAttachment>> {
|
||||
class ShareIntentUploadStateNotifier extends StateNotifier<List<ShareIntentAttachment>> {
|
||||
final AppRouter router;
|
||||
final UploadService _uploadService;
|
||||
final ShareIntentService _shareIntentService;
|
||||
@@ -53,8 +51,7 @@ class ShareIntentUploadStateNotifier
|
||||
}
|
||||
|
||||
void removeAttachment(ShareIntentAttachment attachment) {
|
||||
final updatedState =
|
||||
state.where((element) => element != attachment).toList();
|
||||
final updatedState = state.where((element) => element != attachment).toList();
|
||||
if (updatedState.length != state.length) {
|
||||
state = updatedState;
|
||||
}
|
||||
@@ -87,27 +84,20 @@ class ShareIntentUploadStateNotifier
|
||||
|
||||
state = [
|
||||
for (final attachment in state)
|
||||
if (attachment.id == taskId.toInt())
|
||||
attachment.copyWith(status: uploadStatus)
|
||||
else
|
||||
attachment,
|
||||
if (attachment.id == taskId.toInt()) attachment.copyWith(status: uploadStatus) else attachment,
|
||||
];
|
||||
}
|
||||
|
||||
void _taskProgressCallback(TaskProgressUpdate update) {
|
||||
// Ignore if the task is canceled or completed
|
||||
if (update.progress == downloadFailed ||
|
||||
update.progress == downloadCompleted) {
|
||||
if (update.progress == downloadFailed || update.progress == downloadCompleted) {
|
||||
return;
|
||||
}
|
||||
|
||||
final taskId = update.task.taskId;
|
||||
state = [
|
||||
for (final attachment in state)
|
||||
if (attachment.id == taskId.toInt())
|
||||
attachment.copyWith(uploadProgress: update.progress)
|
||||
else
|
||||
attachment,
|
||||
if (attachment.id == taskId.toInt()) attachment.copyWith(uploadProgress: update.progress) else attachment,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -13,13 +13,11 @@ class VideoPlaybackControls {
|
||||
final bool restarted;
|
||||
}
|
||||
|
||||
final videoPlayerControlsProvider =
|
||||
StateNotifierProvider<VideoPlayerControls, VideoPlaybackControls>((ref) {
|
||||
final videoPlayerControlsProvider = StateNotifierProvider<VideoPlayerControls, VideoPlaybackControls>((ref) {
|
||||
return VideoPlayerControls(ref);
|
||||
});
|
||||
|
||||
const videoPlayerControlsDefault =
|
||||
VideoPlaybackControls(position: 0, pause: false);
|
||||
const videoPlayerControlsDefault = VideoPlaybackControls(position: 0, pause: false);
|
||||
|
||||
class VideoPlayerControls extends StateNotifier<VideoPlaybackControls> {
|
||||
VideoPlayerControls(this.ref) : super(videoPlayerControlsDefault);
|
||||
@@ -64,17 +62,14 @@ class VideoPlayerControls extends StateNotifier<VideoPlaybackControls> {
|
||||
}
|
||||
|
||||
void togglePlay() {
|
||||
state =
|
||||
VideoPlaybackControls(position: state.position, pause: !state.pause);
|
||||
state = VideoPlaybackControls(position: state.position, pause: !state.pause);
|
||||
}
|
||||
|
||||
void restart() {
|
||||
state =
|
||||
const VideoPlaybackControls(position: 0, pause: false, restarted: true);
|
||||
ref.read(videoPlaybackValueProvider.notifier).value =
|
||||
ref.read(videoPlaybackValueProvider.notifier).value.copyWith(
|
||||
state: VideoPlaybackState.playing,
|
||||
position: Duration.zero,
|
||||
);
|
||||
state = const VideoPlaybackControls(position: 0, pause: false, restarted: true);
|
||||
ref.read(videoPlaybackValueProvider.notifier).value = ref.read(videoPlaybackValueProvider.notifier).value.copyWith(
|
||||
state: VideoPlaybackState.playing,
|
||||
position: Duration.zero,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,8 +75,7 @@ const VideoPlaybackValue videoPlaybackValueDefault = VideoPlaybackValue(
|
||||
volume: 0.0,
|
||||
);
|
||||
|
||||
final videoPlaybackValueProvider =
|
||||
StateNotifierProvider<VideoPlaybackValueState, VideoPlaybackValue>((ref) {
|
||||
final videoPlaybackValueProvider = StateNotifierProvider<VideoPlaybackValueState, VideoPlaybackValue>((ref) {
|
||||
return VideoPlaybackValueState(ref);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user