mirror of
https://github.com/immich-app/immich.git
synced 2025-12-18 01:11:07 +03:00
chore: bump line length to 120 (#20191)
This commit is contained in:
@@ -58,9 +58,7 @@ class ImmichAppBarDialog extends HookConsumerWidget {
|
||||
),
|
||||
Center(
|
||||
child: Image.asset(
|
||||
context.isDarkTheme
|
||||
? 'assets/immich-text-dark.png'
|
||||
: 'assets/immich-text-light.png',
|
||||
context.isDarkTheme ? 'assets/immich-text-dark.png' : 'assets/immich-text-light.png',
|
||||
height: 16,
|
||||
),
|
||||
),
|
||||
@@ -131,10 +129,7 @@ class ImmichAppBarDialog extends HookConsumerWidget {
|
||||
ok: "yes",
|
||||
onOk: () async {
|
||||
isLoggingOut.value = true;
|
||||
await ref
|
||||
.read(authProvider.notifier)
|
||||
.logout()
|
||||
.whenComplete(() => isLoggingOut.value = false);
|
||||
await ref.read(authProvider.notifier).logout().whenComplete(() => isLoggingOut.value = false);
|
||||
|
||||
ref.read(manualUploadProvider.notifier).cancelBackup();
|
||||
ref.read(backupProvider.notifier).cancelBackup();
|
||||
@@ -196,14 +191,12 @@ class ImmichAppBarDialog extends HookConsumerWidget {
|
||||
child: LinearProgressIndicator(
|
||||
minHeight: 10.0,
|
||||
value: percentage,
|
||||
borderRadius:
|
||||
const BorderRadius.all(Radius.circular(10.0)),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(10.0)),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 12.0),
|
||||
child:
|
||||
const Text('backup_controller_page_storage_format').tr(
|
||||
child: const Text('backup_controller_page_storage_format').tr(
|
||||
namedArgs: {
|
||||
'used': usedDiskSpace,
|
||||
'total': totalDiskSpace,
|
||||
|
||||
@@ -17,8 +17,7 @@ class AppBarProfileInfoBox extends HookConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final authState = ref.watch(authProvider);
|
||||
final uploadProfileImageStatus =
|
||||
ref.watch(uploadProfileImageProvider).status;
|
||||
final uploadProfileImageStatus = ref.watch(uploadProfileImageProvider).status;
|
||||
final user = ref.watch(currentUserProvider);
|
||||
|
||||
buildUserProfileImage() {
|
||||
@@ -55,12 +54,10 @@ class AppBarProfileInfoBox extends HookConsumerWidget {
|
||||
);
|
||||
|
||||
if (image != null) {
|
||||
var success =
|
||||
await ref.watch(uploadProfileImageProvider.notifier).upload(image);
|
||||
var success = await ref.watch(uploadProfileImageProvider.notifier).upload(image);
|
||||
|
||||
if (success) {
|
||||
final profileImagePath =
|
||||
ref.read(uploadProfileImageProvider).profileImagePath;
|
||||
final profileImagePath = ref.read(uploadProfileImageProvider).profileImagePath;
|
||||
ref.watch(authProvider.notifier).updateUserProfileImagePath(
|
||||
profileImagePath,
|
||||
);
|
||||
|
||||
@@ -173,12 +173,10 @@ class AppBarServerInfo extends HookConsumerWidget {
|
||||
verticalOffset: 0,
|
||||
decoration: BoxDecoration(
|
||||
color: context.primaryColor.withValues(alpha: 0.9),
|
||||
borderRadius:
|
||||
const BorderRadius.all(Radius.circular(10)),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(10)),
|
||||
),
|
||||
textStyle: TextStyle(
|
||||
color:
|
||||
context.isDarkTheme ? Colors.black : Colors.white,
|
||||
color: context.isDarkTheme ? Colors.black : Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
message: getServerUrl() ?? '--',
|
||||
|
||||
@@ -73,10 +73,7 @@ class _DateTimePicker extends HookWidget {
|
||||
|
||||
// returns a list of location<name> along with it's offset in duration
|
||||
List<_TimeZoneOffset> getAllTimeZones() {
|
||||
return tz.timeZoneDatabase.locations.values
|
||||
.map(_TimeZoneOffset.fromLocation)
|
||||
.sorted()
|
||||
.toList();
|
||||
return tz.timeZoneDatabase.locations.values.map(_TimeZoneOffset.fromLocation).sorted().toList();
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -125,11 +122,9 @@ class _DateTimePicker extends HookWidget {
|
||||
}
|
||||
|
||||
void popWithDateTime() {
|
||||
final formattedDateTime =
|
||||
DateFormat("yyyy-MM-dd'T'HH:mm:ss").format(date.value);
|
||||
final dtWithOffset = formattedDateTime +
|
||||
Duration(milliseconds: tzOffset.value.offsetInMilliseconds)
|
||||
.formatAsOffset();
|
||||
final formattedDateTime = DateFormat("yyyy-MM-dd'T'HH:mm:ss").format(date.value);
|
||||
final dtWithOffset =
|
||||
formattedDateTime + Duration(milliseconds: tzOffset.value.offsetInMilliseconds).formatAsOffset();
|
||||
context.pop(dtWithOffset);
|
||||
}
|
||||
|
||||
@@ -245,19 +240,15 @@ class _TimeZoneOffset implements Comparable<_TimeZoneOffset> {
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() =>
|
||||
'_TimeZoneOffset(display: $display, location: $location)';
|
||||
String toString() => '_TimeZoneOffset(display: $display, location: $location)';
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) return true;
|
||||
|
||||
return other is _TimeZoneOffset &&
|
||||
other.display == display &&
|
||||
other.offsetInMilliseconds == offsetInMilliseconds;
|
||||
return other is _TimeZoneOffset && other.display == display && other.offsetInMilliseconds == offsetInMilliseconds;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
display.hashCode ^ offsetInMilliseconds.hashCode ^ location.hashCode;
|
||||
int get hashCode => display.hashCode ^ offsetInMilliseconds.hashCode ^ location.hashCode;
|
||||
}
|
||||
|
||||
@@ -33,8 +33,7 @@ class ControlBoxButton extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final minWidth =
|
||||
context.isMobile ? MediaQuery.sizeOf(context).width / 4.5 : 75.0;
|
||||
final minWidth = context.isMobile ? MediaQuery.sizeOf(context).width / 4.5 : 75.0;
|
||||
|
||||
return MaterialButton(
|
||||
padding: const EdgeInsets.all(10),
|
||||
|
||||
@@ -30,8 +30,7 @@ class DropdownSearchMenu<T> extends HookWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final selectedItem = useState<DropdownMenuEntry<T>?>(
|
||||
dropdownMenuEntries
|
||||
.firstWhereOrNull((item) => item.value == initialSelection),
|
||||
dropdownMenuEntries.firstWhereOrNull((item) => item.value == initialSelection),
|
||||
);
|
||||
final showTimeZoneDropdown = useState<bool>(false);
|
||||
|
||||
@@ -77,10 +76,7 @@ class DropdownSearchMenu<T> extends HookWidget {
|
||||
displayStringForOption: (option) => option.label,
|
||||
optionsBuilder: (textEditingValue) {
|
||||
return dropdownMenuEntries.where(
|
||||
(item) => item.label
|
||||
.toLowerCase()
|
||||
.trim()
|
||||
.contains(textEditingValue.text.toLowerCase().trim()),
|
||||
(item) => item.label.toLowerCase().trim().contains(textEditingValue.text.toLowerCase().trim()),
|
||||
);
|
||||
},
|
||||
onSelected: (option) {
|
||||
@@ -127,9 +123,7 @@ class DropdownSearchMenu<T> extends HookWidget {
|
||||
onTap: () => onSelected(option),
|
||||
child: Builder(
|
||||
builder: (BuildContext context) {
|
||||
final bool highlight =
|
||||
AutocompleteHighlightedOption.of(context) ==
|
||||
index;
|
||||
final bool highlight = AutocompleteHighlightedOption.of(context) == index;
|
||||
if (highlight) {
|
||||
SchedulerBinding.instance.addPostFrameCallback(
|
||||
(Duration timeStamp) {
|
||||
@@ -142,12 +136,7 @@ class DropdownSearchMenu<T> extends HookWidget {
|
||||
);
|
||||
}
|
||||
return Container(
|
||||
color: highlight
|
||||
? Theme.of(context)
|
||||
.colorScheme
|
||||
.onSurface
|
||||
.withValues(alpha: 0.12)
|
||||
: null,
|
||||
color: highlight ? Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.12) : null,
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Text(
|
||||
option.label,
|
||||
|
||||
@@ -27,8 +27,7 @@ class ImmichAppBar extends ConsumerWidget implements PreferredSizeWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final BackUpState backupState = ref.watch(backupProvider);
|
||||
final bool isEnableAutoBackup =
|
||||
backupState.backgroundBackup || backupState.autoBackup;
|
||||
final bool isEnableAutoBackup = backupState.backgroundBackup || backupState.autoBackup;
|
||||
final ServerInfo serverInfoState = ref.watch(serverInfoProvider);
|
||||
final user = ref.watch(currentUserProvider);
|
||||
final isDarkTheme = context.isDarkTheme;
|
||||
@@ -57,9 +56,8 @@ class ImmichAppBar extends ConsumerWidget implements PreferredSizeWidget {
|
||||
),
|
||||
backgroundColor: Colors.transparent,
|
||||
alignment: Alignment.bottomRight,
|
||||
isLabelVisible: serverInfoState.isVersionMismatch ||
|
||||
((user?.isAdmin ?? false) &&
|
||||
serverInfoState.isNewReleaseAvailable),
|
||||
isLabelVisible:
|
||||
serverInfoState.isVersionMismatch || ((user?.isAdmin ?? false) && serverInfoState.isNewReleaseAvailable),
|
||||
offset: const Offset(-2, -12),
|
||||
child: user == null
|
||||
? const Icon(
|
||||
@@ -92,8 +90,7 @@ class ImmichAppBar extends ConsumerWidget implements PreferredSizeWidget {
|
||||
semanticsLabel: 'backup_controller_page_backup'.tr(),
|
||||
),
|
||||
);
|
||||
} else if (backupState.backupProgress !=
|
||||
BackUpProgressEnum.inBackground &&
|
||||
} else if (backupState.backupProgress != BackUpProgressEnum.inBackground &&
|
||||
backupState.backupProgress != BackUpProgressEnum.manualInProgress) {
|
||||
return Icon(
|
||||
Icons.check_outlined,
|
||||
|
||||
@@ -59,8 +59,7 @@ class ImmichImage extends StatelessWidget {
|
||||
|
||||
// Whether to use the local asset image provider or a remote one
|
||||
static bool useLocal(Asset asset) =>
|
||||
!asset.isRemote ||
|
||||
asset.isLocal && !Store.get(StoreKey.preferRemoteImage, false);
|
||||
!asset.isRemote || asset.isLocal && !Store.get(StoreKey.preferRemoteImage, false);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@@ -41,8 +41,7 @@ class ImmichSliverAppBar extends ConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final isCasting = ref.watch(castProvider.select((c) => c.isCasting));
|
||||
final isMultiSelectEnabled =
|
||||
ref.watch(multiSelectProvider.select((s) => s.isEnabled));
|
||||
final isMultiSelectEnabled = ref.watch(multiSelectProvider.select((s) => s.isEnabled));
|
||||
|
||||
return SliverAnimatedOpacity(
|
||||
duration: Durations.medium1,
|
||||
@@ -116,8 +115,7 @@ class _ImmichLogoWithText extends StatelessWidget {
|
||||
Builder(
|
||||
builder: (context) {
|
||||
return Badge(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 6, vertical: 4),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 4),
|
||||
backgroundColor: context.primaryColor,
|
||||
alignment: Alignment.centerRight,
|
||||
offset: const Offset(16, -8),
|
||||
@@ -180,8 +178,8 @@ class _ProfileIndicator extends ConsumerWidget {
|
||||
),
|
||||
backgroundColor: Colors.transparent,
|
||||
alignment: Alignment.bottomRight,
|
||||
isLabelVisible: serverInfoState.isVersionMismatch ||
|
||||
((user?.isAdmin ?? false) && serverInfoState.isNewReleaseAvailable),
|
||||
isLabelVisible:
|
||||
serverInfoState.isVersionMismatch || ((user?.isAdmin ?? false) && serverInfoState.isNewReleaseAvailable),
|
||||
offset: const Offset(-2, -12),
|
||||
child: user == null
|
||||
? const Icon(
|
||||
@@ -241,8 +239,7 @@ class _BackupIndicator extends ConsumerWidget {
|
||||
|
||||
Widget? _getBackupBadgeIcon(BuildContext context, WidgetRef ref) {
|
||||
final BackUpState backupState = ref.watch(backupProvider);
|
||||
final bool isEnableAutoBackup =
|
||||
backupState.backgroundBackup || backupState.autoBackup;
|
||||
final bool isEnableAutoBackup = backupState.backgroundBackup || backupState.autoBackup;
|
||||
final isDarkTheme = context.isDarkTheme;
|
||||
final iconColor = isDarkTheme ? Colors.white : Colors.black;
|
||||
|
||||
@@ -257,8 +254,7 @@ class _BackupIndicator extends ConsumerWidget {
|
||||
semanticsLabel: 'backup_controller_page_backup'.tr(),
|
||||
),
|
||||
);
|
||||
} else if (backupState.backupProgress !=
|
||||
BackUpProgressEnum.inBackground &&
|
||||
} else if (backupState.backupProgress != BackUpProgressEnum.inBackground &&
|
||||
backupState.backupProgress != BackUpProgressEnum.manualInProgress) {
|
||||
return Icon(
|
||||
Icons.check_outlined,
|
||||
@@ -286,12 +282,10 @@ class _SyncStatusIndicator extends ConsumerStatefulWidget {
|
||||
const _SyncStatusIndicator();
|
||||
|
||||
@override
|
||||
ConsumerState<_SyncStatusIndicator> createState() =>
|
||||
_SyncStatusIndicatorState();
|
||||
ConsumerState<_SyncStatusIndicator> createState() => _SyncStatusIndicatorState();
|
||||
}
|
||||
|
||||
class _SyncStatusIndicatorState extends ConsumerState<_SyncStatusIndicator>
|
||||
with TickerProviderStateMixin {
|
||||
class _SyncStatusIndicatorState extends ConsumerState<_SyncStatusIndicator> with TickerProviderStateMixin {
|
||||
late AnimationController _rotationController;
|
||||
late AnimationController _dismissalController;
|
||||
late Animation<double> _rotationAnimation;
|
||||
@@ -349,8 +343,7 @@ class _SyncStatusIndicatorState extends ConsumerState<_SyncStatusIndicator>
|
||||
}
|
||||
|
||||
// Don't show anything if not syncing and dismissal animation is complete
|
||||
if (!isSyncing &&
|
||||
_dismissalController.status == AnimationStatus.completed) {
|
||||
if (!isSyncing && _dismissalController.status == AnimationStatus.completed) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
@@ -364,10 +357,7 @@ class _SyncStatusIndicatorState extends ConsumerState<_SyncStatusIndicator>
|
||||
child: Opacity(
|
||||
opacity: isSyncing ? 1.0 : _dismissalAnimation.value,
|
||||
child: Transform.rotate(
|
||||
angle: _rotationAnimation.value *
|
||||
2 *
|
||||
3.14159 *
|
||||
-1, // Rotate counter-clockwise
|
||||
angle: _rotationAnimation.value * 2 * 3.14159 * -1, // Rotate counter-clockwise
|
||||
child: Icon(
|
||||
Icons.sync,
|
||||
size: 24,
|
||||
|
||||
@@ -93,8 +93,7 @@ class ImmichThumbnail extends HookConsumerWidget {
|
||||
customErrorBuilder(BuildContext ctx, Object error, StackTrace? stackTrace) {
|
||||
thumbnailProviderInstance.evict();
|
||||
|
||||
final originalErrorWidgetBuilder =
|
||||
blurHashErrorBuilder(blurhash, fit: fit);
|
||||
final originalErrorWidgetBuilder = blurHashErrorBuilder(blurhash, fit: fit);
|
||||
return originalErrorWidgetBuilder(ctx, error, stackTrace);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,9 +15,7 @@ class ImmichTitleText extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Image(
|
||||
image: AssetImage(
|
||||
context.isDarkTheme
|
||||
? 'assets/immich-text-dark.png'
|
||||
: 'assets/immich-text-light.png',
|
||||
context.isDarkTheme ? 'assets/immich-text-dark.png' : 'assets/immich-text-light.png',
|
||||
),
|
||||
width: fontSize * 4,
|
||||
filterQuality: FilterQuality.high,
|
||||
|
||||
@@ -56,8 +56,7 @@ class _LocationPicker extends HookWidget {
|
||||
? _MapPicker(
|
||||
key: ValueKey(latlng),
|
||||
latlng: latlng,
|
||||
onModeSwitch: () =>
|
||||
pickerMode.value = _LocationPickerMode.manual,
|
||||
onModeSwitch: () => pickerMode.value = _LocationPickerMode.manual,
|
||||
onMapTap: onMapTap,
|
||||
)
|
||||
: _ManualPicker(
|
||||
@@ -141,8 +140,7 @@ class _ManualPickerInput extends HookWidget {
|
||||
errorText: isValid.value ? null : errorText.tr(),
|
||||
),
|
||||
onEditingComplete: onEditingComplete,
|
||||
keyboardType:
|
||||
const TextInputType.numberWithOptions(decimal: true, signed: true),
|
||||
keyboardType: const TextInputType.numberWithOptions(decimal: true, signed: true),
|
||||
inputFormatters: [LengthLimitingTextInputFormatter(8)],
|
||||
onTapOutside: (_) => focusNode.unfocus(),
|
||||
);
|
||||
|
||||
@@ -23,12 +23,10 @@ class MesmerizingSliverAppBar extends ConsumerStatefulWidget {
|
||||
final String title;
|
||||
final IconData icon;
|
||||
@override
|
||||
ConsumerState<MesmerizingSliverAppBar> createState() =>
|
||||
_MesmerizingSliverAppBarState();
|
||||
ConsumerState<MesmerizingSliverAppBar> createState() => _MesmerizingSliverAppBarState();
|
||||
}
|
||||
|
||||
class _MesmerizingSliverAppBarState
|
||||
extends ConsumerState<MesmerizingSliverAppBar> {
|
||||
class _MesmerizingSliverAppBarState extends ConsumerState<MesmerizingSliverAppBar> {
|
||||
double _scrollProgress = 0.0;
|
||||
|
||||
double _calculateScrollProgress(FlexibleSpaceBarSettings? settings) {
|
||||
@@ -41,14 +39,12 @@ class _MesmerizingSliverAppBarState
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
return (1.0 - (settings.currentExtent - settings.minExtent) / deltaExtent)
|
||||
.clamp(0.0, 1.0);
|
||||
return (1.0 - (settings.currentExtent - settings.minExtent) / deltaExtent).clamp(0.0, 1.0);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isMultiSelectEnabled =
|
||||
ref.watch(multiSelectProvider.select((s) => s.isEnabled));
|
||||
final isMultiSelectEnabled = ref.watch(multiSelectProvider.select((s) => s.isEnabled));
|
||||
|
||||
return isMultiSelectEnabled
|
||||
? SliverToBoxAdapter(
|
||||
@@ -65,9 +61,7 @@ class _MesmerizingSliverAppBarState
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Platform.isIOS
|
||||
? Icons.arrow_back_ios_new_rounded
|
||||
: Icons.arrow_back,
|
||||
Platform.isIOS ? Icons.arrow_back_ios_new_rounded : Icons.arrow_back,
|
||||
color: Color.lerp(
|
||||
Colors.white,
|
||||
context.primaryColor,
|
||||
@@ -93,8 +87,7 @@ class _MesmerizingSliverAppBarState
|
||||
),
|
||||
flexibleSpace: Builder(
|
||||
builder: (context) {
|
||||
final settings = context.dependOnInheritedWidgetOfExactType<
|
||||
FlexibleSpaceBarSettings>();
|
||||
final settings = context.dependOnInheritedWidgetOfExactType<FlexibleSpaceBarSettings>();
|
||||
final scrollProgress = _calculateScrollProgress(settings);
|
||||
|
||||
// Update scroll progress for the leading button
|
||||
@@ -145,12 +138,10 @@ class _ExpandedBackground extends ConsumerStatefulWidget {
|
||||
});
|
||||
|
||||
@override
|
||||
ConsumerState<_ExpandedBackground> createState() =>
|
||||
_ExpandedBackgroundState();
|
||||
ConsumerState<_ExpandedBackground> createState() => _ExpandedBackgroundState();
|
||||
}
|
||||
|
||||
class _ExpandedBackgroundState extends ConsumerState<_ExpandedBackground>
|
||||
with SingleTickerProviderStateMixin {
|
||||
class _ExpandedBackgroundState extends ConsumerState<_ExpandedBackground> with SingleTickerProviderStateMixin {
|
||||
late AnimationController _slideController;
|
||||
late Animation<Offset> _slideAnimation;
|
||||
|
||||
@@ -278,8 +269,7 @@ class _ItemCountTextState extends ConsumerState<_ItemCountText> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_reloadSubscription =
|
||||
EventStream.shared.listen<TimelineReloadEvent>((_) => setState(() {}));
|
||||
_reloadSubscription = EventStream.shared.listen<TimelineReloadEvent>((_) => setState(() {}));
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -328,8 +318,7 @@ class _RandomAssetBackground extends StatefulWidget {
|
||||
State<_RandomAssetBackground> createState() => _RandomAssetBackgroundState();
|
||||
}
|
||||
|
||||
class _RandomAssetBackgroundState extends State<_RandomAssetBackground>
|
||||
with TickerProviderStateMixin {
|
||||
class _RandomAssetBackgroundState extends State<_RandomAssetBackground> with TickerProviderStateMixin {
|
||||
late AnimationController _zoomController;
|
||||
late AnimationController _crossFadeController;
|
||||
late Animation<double> _zoomAnimation;
|
||||
@@ -500,8 +489,7 @@ class _RandomAssetBackgroundState extends State<_RandomAssetBackground>
|
||||
alignment: Alignment.topRight,
|
||||
image: getFullImageProvider(_currentAsset!),
|
||||
fit: BoxFit.cover,
|
||||
frameBuilder:
|
||||
(context, child, frame, wasSynchronouslyLoaded) {
|
||||
frameBuilder: (context, child, frame, wasSynchronouslyLoaded) {
|
||||
if (wasSynchronouslyLoaded || frame != null) {
|
||||
return child;
|
||||
}
|
||||
@@ -532,8 +520,7 @@ class _RandomAssetBackgroundState extends State<_RandomAssetBackground>
|
||||
alignment: Alignment.topRight,
|
||||
image: getFullImageProvider(_nextAsset!),
|
||||
fit: BoxFit.cover,
|
||||
frameBuilder:
|
||||
(context, child, frame, wasSynchronouslyLoaded) {
|
||||
frameBuilder: (context, child, frame, wasSynchronouslyLoaded) {
|
||||
if (wasSynchronouslyLoaded || frame != null) {
|
||||
return child;
|
||||
}
|
||||
|
||||
@@ -35,12 +35,10 @@ class RemoteAlbumSliverAppBar extends ConsumerStatefulWidget {
|
||||
final void Function()? onEditTitle;
|
||||
|
||||
@override
|
||||
ConsumerState<RemoteAlbumSliverAppBar> createState() =>
|
||||
_MesmerizingSliverAppBarState();
|
||||
ConsumerState<RemoteAlbumSliverAppBar> createState() => _MesmerizingSliverAppBarState();
|
||||
}
|
||||
|
||||
class _MesmerizingSliverAppBarState
|
||||
extends ConsumerState<RemoteAlbumSliverAppBar> {
|
||||
class _MesmerizingSliverAppBarState extends ConsumerState<RemoteAlbumSliverAppBar> {
|
||||
double _scrollProgress = 0.0;
|
||||
|
||||
double _calculateScrollProgress(FlexibleSpaceBarSettings? settings) {
|
||||
@@ -53,14 +51,12 @@ class _MesmerizingSliverAppBarState
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
return (1.0 - (settings.currentExtent - settings.minExtent) / deltaExtent)
|
||||
.clamp(0.0, 1.0);
|
||||
return (1.0 - (settings.currentExtent - settings.minExtent) / deltaExtent).clamp(0.0, 1.0);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isMultiSelectEnabled =
|
||||
ref.watch(multiSelectProvider.select((s) => s.isEnabled));
|
||||
final isMultiSelectEnabled = ref.watch(multiSelectProvider.select((s) => s.isEnabled));
|
||||
|
||||
final currentAlbum = ref.watch(currentRemoteAlbumProvider);
|
||||
if (currentAlbum == null) {
|
||||
@@ -103,9 +99,7 @@ class _MesmerizingSliverAppBarState
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
Platform.isIOS
|
||||
? Icons.arrow_back_ios_new_rounded
|
||||
: Icons.arrow_back,
|
||||
Platform.isIOS ? Icons.arrow_back_ios_new_rounded : Icons.arrow_back,
|
||||
color: actionIconColor,
|
||||
shadows: actionIconShadows,
|
||||
),
|
||||
@@ -136,8 +130,7 @@ class _MesmerizingSliverAppBarState
|
||||
],
|
||||
flexibleSpace: Builder(
|
||||
builder: (context) {
|
||||
final settings = context.dependOnInheritedWidgetOfExactType<
|
||||
FlexibleSpaceBarSettings>();
|
||||
final settings = context.dependOnInheritedWidgetOfExactType<FlexibleSpaceBarSettings>();
|
||||
final scrollProgress = _calculateScrollProgress(settings);
|
||||
|
||||
// Update scroll progress for the leading button
|
||||
@@ -188,12 +181,10 @@ class _ExpandedBackground extends ConsumerStatefulWidget {
|
||||
});
|
||||
|
||||
@override
|
||||
ConsumerState<_ExpandedBackground> createState() =>
|
||||
_ExpandedBackgroundState();
|
||||
ConsumerState<_ExpandedBackground> createState() => _ExpandedBackgroundState();
|
||||
}
|
||||
|
||||
class _ExpandedBackgroundState extends ConsumerState<_ExpandedBackground>
|
||||
with SingleTickerProviderStateMixin {
|
||||
class _ExpandedBackgroundState extends ConsumerState<_ExpandedBackground> with SingleTickerProviderStateMixin {
|
||||
late AnimationController _slideController;
|
||||
late Animation<Offset> _slideAnimation;
|
||||
|
||||
@@ -405,8 +396,7 @@ class _ItemCountTextState extends ConsumerState<_ItemCountText> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_reloadSubscription =
|
||||
EventStream.shared.listen<TimelineReloadEvent>((_) => setState(() {}));
|
||||
_reloadSubscription = EventStream.shared.listen<TimelineReloadEvent>((_) => setState(() {}));
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -453,8 +443,7 @@ class _RandomAssetBackground extends StatefulWidget {
|
||||
State<_RandomAssetBackground> createState() => _RandomAssetBackgroundState();
|
||||
}
|
||||
|
||||
class _RandomAssetBackgroundState extends State<_RandomAssetBackground>
|
||||
with TickerProviderStateMixin {
|
||||
class _RandomAssetBackgroundState extends State<_RandomAssetBackground> with TickerProviderStateMixin {
|
||||
late AnimationController _zoomController;
|
||||
late AnimationController _crossFadeController;
|
||||
late Animation<double> _zoomAnimation;
|
||||
@@ -625,8 +614,7 @@ class _RandomAssetBackgroundState extends State<_RandomAssetBackground>
|
||||
alignment: Alignment.topRight,
|
||||
image: getFullImageProvider(_currentAsset!),
|
||||
fit: BoxFit.cover,
|
||||
frameBuilder:
|
||||
(context, child, frame, wasSynchronouslyLoaded) {
|
||||
frameBuilder: (context, child, frame, wasSynchronouslyLoaded) {
|
||||
if (wasSynchronouslyLoaded || frame != null) {
|
||||
return child;
|
||||
}
|
||||
@@ -657,8 +645,7 @@ class _RandomAssetBackgroundState extends State<_RandomAssetBackground>
|
||||
alignment: Alignment.topRight,
|
||||
image: getFullImageProvider(_nextAsset!),
|
||||
fit: BoxFit.cover,
|
||||
frameBuilder:
|
||||
(context, child, frame, wasSynchronouslyLoaded) {
|
||||
frameBuilder: (context, child, frame, wasSynchronouslyLoaded) {
|
||||
if (wasSynchronouslyLoaded || frame != null) {
|
||||
return child;
|
||||
}
|
||||
|
||||
@@ -27,8 +27,7 @@ class ScaffoldErrorBody extends StatelessWidget {
|
||||
child: Icon(
|
||||
Icons.error_outline,
|
||||
size: 100,
|
||||
color:
|
||||
context.themeData.iconTheme.color?.withValues(alpha: 0.5),
|
||||
color: context.themeData.iconTheme.color?.withValues(alpha: 0.5),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -12,8 +12,7 @@ class SelectionSliverAppBar extends ConsumerStatefulWidget {
|
||||
});
|
||||
|
||||
@override
|
||||
ConsumerState<SelectionSliverAppBar> createState() =>
|
||||
_SelectionSliverAppBarState();
|
||||
ConsumerState<SelectionSliverAppBar> createState() => _SelectionSliverAppBarState();
|
||||
}
|
||||
|
||||
class _SelectionSliverAppBarState extends ConsumerState<SelectionSliverAppBar> {
|
||||
|
||||
@@ -13,8 +13,7 @@ OctoSet blurHashOrPlaceholder(
|
||||
}) {
|
||||
return OctoSet(
|
||||
placeholderBuilder: blurHashPlaceholderBuilder(blurhash, fit: fit),
|
||||
errorBuilder:
|
||||
blurHashErrorBuilder(blurhash, fit: fit, message: errorMessage),
|
||||
errorBuilder: blurHashErrorBuilder(blurhash, fit: fit, message: errorMessage),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,8 +7,7 @@ import 'package:immich_mobile/extensions/build_context_extensions.dart';
|
||||
import 'package:immich_mobile/services/api.service.dart';
|
||||
|
||||
Widget userAvatar(BuildContext context, UserDto u, {double? radius}) {
|
||||
final url =
|
||||
"${Store.get(StoreKey.serverEndpoint)}/users/${u.id}/profile-image";
|
||||
final url = "${Store.get(StoreKey.serverEndpoint)}/users/${u.id}/profile-image";
|
||||
final nameFirstLetter = u.name.isNotEmpty ? u.name[0] : "";
|
||||
return CircleAvatar(
|
||||
radius: radius,
|
||||
|
||||
@@ -34,9 +34,7 @@ class UserCircleAvatar extends ConsumerWidget {
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 12,
|
||||
color: userAvatarColor.computeLuminance() > 0.5
|
||||
? Colors.black
|
||||
: Colors.white,
|
||||
color: userAvatarColor.computeLuminance() > 0.5 ? Colors.black : Colors.white,
|
||||
),
|
||||
child: Text(user.name[0].toUpperCase()),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user