mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
chore(mobile): clean up linter problems (#1000)
This commit is contained in:
parent
bc9ee1d611
commit
39b7ab66d4
32 changed files with 188 additions and 173 deletions
|
|
@ -1,3 +1,5 @@
|
|||
// ignore_for_file: implementation_imports
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:easy_localization/src/asset_loader.dart';
|
||||
import 'package:easy_localization/src/easy_localization_controller.dart';
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class AlbumInfoCard extends HookConsumerWidget {
|
|||
ColorFilter unselectedFilter =
|
||||
const ColorFilter.mode(Colors.black, BlendMode.color);
|
||||
|
||||
_buildSelectedTextBox() {
|
||||
buildSelectedTextBox() {
|
||||
if (isSelected) {
|
||||
return Chip(
|
||||
visualDensity: VisualDensity.compact,
|
||||
|
|
@ -67,7 +67,7 @@ class AlbumInfoCard extends HookConsumerWidget {
|
|||
return const SizedBox();
|
||||
}
|
||||
|
||||
_buildImageFilter() {
|
||||
buildImageFilter() {
|
||||
if (isSelected) {
|
||||
return selectedFilter;
|
||||
} else if (isExcluded) {
|
||||
|
|
@ -163,7 +163,7 @@ class AlbumInfoCard extends HookConsumerWidget {
|
|||
topRight: Radius.circular(12),
|
||||
),
|
||||
image: DecorationImage(
|
||||
colorFilter: _buildImageFilter(),
|
||||
colorFilter: buildImageFilter(),
|
||||
image: imageData != null
|
||||
? MemoryImage(imageData!)
|
||||
: const AssetImage(
|
||||
|
|
@ -177,7 +177,7 @@ class AlbumInfoCard extends HookConsumerWidget {
|
|||
Positioned(
|
||||
bottom: 10,
|
||||
left: 25,
|
||||
child: _buildSelectedTextBox(),
|
||||
child: buildSelectedTextBox(),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -15,14 +15,16 @@ class AlbumPreviewPage extends HookConsumerWidget {
|
|||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final assets = useState<List<AssetEntity>>([]);
|
||||
|
||||
_getAssetsInAlbum() async {
|
||||
getAssetsInAlbum() async {
|
||||
assets.value = await album.getAssetListRange(
|
||||
start: 0, end: await album.assetCountAsync);
|
||||
start: 0,
|
||||
end: await album.assetCountAsync,
|
||||
);
|
||||
}
|
||||
|
||||
useEffect(
|
||||
() {
|
||||
_getAssetsInAlbum();
|
||||
getAssetsInAlbum();
|
||||
return null;
|
||||
},
|
||||
[],
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class BackupAlbumSelectionPage extends HookConsumerWidget {
|
|||
[],
|
||||
);
|
||||
|
||||
_buildAlbumSelectionList() {
|
||||
buildAlbumSelectionList() {
|
||||
if (availableAlbums.isEmpty) {
|
||||
return const Center(
|
||||
child: ImmichLoadingIndicator(),
|
||||
|
|
@ -56,7 +56,7 @@ class BackupAlbumSelectionPage extends HookConsumerWidget {
|
|||
);
|
||||
}
|
||||
|
||||
_buildSelectedAlbumNameChip() {
|
||||
buildSelectedAlbumNameChip() {
|
||||
return selectedBackupAlbums.map((album) {
|
||||
void removeSelection() {
|
||||
if (ref.watch(backupProvider).selectedBackupAlbums.length == 1) {
|
||||
|
|
@ -104,7 +104,7 @@ class BackupAlbumSelectionPage extends HookConsumerWidget {
|
|||
}).toSet();
|
||||
}
|
||||
|
||||
_buildExcludedAlbumNameChip() {
|
||||
buildExcludedAlbumNameChip() {
|
||||
return excludedBackupAlbums.map((album) {
|
||||
void removeSelection() {
|
||||
ref
|
||||
|
|
@ -177,8 +177,8 @@ class BackupAlbumSelectionPage extends HookConsumerWidget {
|
|||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: Wrap(
|
||||
children: [
|
||||
..._buildSelectedAlbumNameChip(),
|
||||
..._buildExcludedAlbumNameChip()
|
||||
...buildSelectedAlbumNameChip(),
|
||||
...buildExcludedAlbumNameChip()
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
@ -286,7 +286,7 @@ class BackupAlbumSelectionPage extends HookConsumerWidget {
|
|||
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16.0),
|
||||
child: _buildAlbumSelectionList(),
|
||||
child: buildAlbumSelectionList(),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class BackupControllerPage extends HookConsumerWidget {
|
|||
[],
|
||||
);
|
||||
|
||||
Widget _buildStorageInformation() {
|
||||
Widget buildStorageInformation() {
|
||||
return ListTile(
|
||||
leading: Icon(
|
||||
Icons.storage_rounded,
|
||||
|
|
@ -84,7 +84,7 @@ class BackupControllerPage extends HookConsumerWidget {
|
|||
);
|
||||
}
|
||||
|
||||
ListTile _buildAutoBackupController() {
|
||||
ListTile buildAutoBackupController() {
|
||||
var backUpOption = authenticationState.deviceInfo.isAutoBackup
|
||||
? "backup_controller_page_status_on".tr()
|
||||
: "backup_controller_page_status_off".tr();
|
||||
|
|
@ -143,7 +143,7 @@ class BackupControllerPage extends HookConsumerWidget {
|
|||
);
|
||||
}
|
||||
|
||||
void _showErrorToUser(String msg) {
|
||||
void showErrorToUser(String msg) {
|
||||
final snackBar = SnackBar(
|
||||
content: Text(
|
||||
msg.tr(),
|
||||
|
|
@ -153,7 +153,7 @@ class BackupControllerPage extends HookConsumerWidget {
|
|||
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
||||
}
|
||||
|
||||
void _showBatteryOptimizationInfoToUser() {
|
||||
void showBatteryOptimizationInfoToUser() {
|
||||
showDialog<void>(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
|
|
@ -193,7 +193,7 @@ class BackupControllerPage extends HookConsumerWidget {
|
|||
);
|
||||
}
|
||||
|
||||
ListTile _buildBackgroundBackupController() {
|
||||
ListTile buildBackgroundBackupController() {
|
||||
final bool isBackgroundEnabled = backupState.backgroundBackup;
|
||||
final bool isWifiRequired = backupState.backupRequireWifi;
|
||||
final bool isChargingRequired = backupState.backupRequireCharging;
|
||||
|
|
@ -238,8 +238,8 @@ class BackupControllerPage extends HookConsumerWidget {
|
|||
.read(backupProvider.notifier)
|
||||
.configureBackgroundBackup(
|
||||
requireWifi: isChecked,
|
||||
onError: _showErrorToUser,
|
||||
onBatteryInfo: _showBatteryOptimizationInfoToUser,
|
||||
onError: showErrorToUser,
|
||||
onBatteryInfo: showBatteryOptimizationInfoToUser,
|
||||
)
|
||||
: null,
|
||||
),
|
||||
|
|
@ -259,8 +259,8 @@ class BackupControllerPage extends HookConsumerWidget {
|
|||
.read(backupProvider.notifier)
|
||||
.configureBackgroundBackup(
|
||||
requireCharging: isChecked,
|
||||
onError: _showErrorToUser,
|
||||
onBatteryInfo: _showBatteryOptimizationInfoToUser,
|
||||
onError: showErrorToUser,
|
||||
onBatteryInfo: showBatteryOptimizationInfoToUser,
|
||||
)
|
||||
: null,
|
||||
),
|
||||
|
|
@ -268,8 +268,8 @@ class BackupControllerPage extends HookConsumerWidget {
|
|||
onPressed: () =>
|
||||
ref.read(backupProvider.notifier).configureBackgroundBackup(
|
||||
enabled: !isBackgroundEnabled,
|
||||
onError: _showErrorToUser,
|
||||
onBatteryInfo: _showBatteryOptimizationInfoToUser,
|
||||
onError: showErrorToUser,
|
||||
onBatteryInfo: showBatteryOptimizationInfoToUser,
|
||||
),
|
||||
child: Text(
|
||||
isBackgroundEnabled
|
||||
|
|
@ -284,7 +284,7 @@ class BackupControllerPage extends HookConsumerWidget {
|
|||
);
|
||||
}
|
||||
|
||||
Widget _buildSelectedAlbumName() {
|
||||
Widget buildSelectedAlbumName() {
|
||||
var text = "backup_controller_page_backup_selected".tr();
|
||||
var albums = ref.watch(backupProvider).selectedBackupAlbums;
|
||||
|
||||
|
|
@ -323,7 +323,7 @@ class BackupControllerPage extends HookConsumerWidget {
|
|||
}
|
||||
}
|
||||
|
||||
Widget _buildExcludedAlbumName() {
|
||||
Widget buildExcludedAlbumName() {
|
||||
var text = "backup_controller_page_excluded".tr();
|
||||
var albums = ref.watch(backupProvider).excludedBackupAlbums;
|
||||
|
||||
|
|
@ -348,7 +348,7 @@ class BackupControllerPage extends HookConsumerWidget {
|
|||
}
|
||||
}
|
||||
|
||||
_buildFolderSelectionTile() {
|
||||
buildFolderSelectionTile() {
|
||||
return Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(5), // if you need this
|
||||
|
|
@ -374,8 +374,8 @@ class BackupControllerPage extends HookConsumerWidget {
|
|||
"backup_controller_page_to_backup",
|
||||
style: TextStyle(fontSize: 12),
|
||||
).tr(),
|
||||
_buildSelectedAlbumName(),
|
||||
_buildExcludedAlbumName()
|
||||
buildSelectedAlbumName(),
|
||||
buildExcludedAlbumName()
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
@ -398,7 +398,7 @@ class BackupControllerPage extends HookConsumerWidget {
|
|||
);
|
||||
}
|
||||
|
||||
_buildCurrentBackupAssetInfoCard() {
|
||||
buildCurrentBackupAssetInfoCard() {
|
||||
return ListTile(
|
||||
leading: Icon(
|
||||
Icons.info_outline_rounded,
|
||||
|
|
@ -606,7 +606,7 @@ class BackupControllerPage extends HookConsumerWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
_buildFolderSelectionTile(),
|
||||
buildFolderSelectionTile(),
|
||||
BackupInfoCard(
|
||||
title: "backup_controller_page_total".tr(),
|
||||
subtitle: "backup_controller_page_total_sub".tr(),
|
||||
|
|
@ -624,13 +624,13 @@ class BackupControllerPage extends HookConsumerWidget {
|
|||
"${backupState.allUniqueAssets.length - backupState.selectedAlbumsBackupAssetsIds.length}",
|
||||
),
|
||||
const Divider(),
|
||||
_buildAutoBackupController(),
|
||||
buildAutoBackupController(),
|
||||
if (Platform.isAndroid) const Divider(),
|
||||
if (Platform.isAndroid) _buildBackgroundBackupController(),
|
||||
if (Platform.isAndroid) buildBackgroundBackupController(),
|
||||
const Divider(),
|
||||
_buildStorageInformation(),
|
||||
buildStorageInformation(),
|
||||
const Divider(),
|
||||
_buildCurrentBackupAssetInfoCard(),
|
||||
buildCurrentBackupAssetInfoCard(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 24,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue