mirror of
https://github.com/immich-app/immich.git
synced 2025-12-22 09:15:34 +03:00
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:
@@ -15,16 +15,10 @@ extension TZExtension on Asset {
|
||||
final location = getLocation(exifInfo!.timeZone!);
|
||||
dt = TZDateTime.from(dt, location);
|
||||
} on LocationNotFoundException {
|
||||
RegExp re = RegExp(
|
||||
r'^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$',
|
||||
caseSensitive: false,
|
||||
);
|
||||
RegExp re = RegExp(r'^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$', caseSensitive: false);
|
||||
final m = re.firstMatch(exifInfo!.timeZone!);
|
||||
if (m != null) {
|
||||
final duration = Duration(
|
||||
hours: int.parse(m.group(1) ?? '0'),
|
||||
minutes: int.parse(m.group(2) ?? '0'),
|
||||
);
|
||||
final duration = Duration(hours: int.parse(m.group(1) ?? '0'), minutes: int.parse(m.group(2) ?? '0'));
|
||||
dt = dt.add(duration);
|
||||
return (dt, duration);
|
||||
}
|
||||
|
||||
@@ -6,10 +6,7 @@ import 'package:immich_mobile/entities/asset.entity.dart';
|
||||
import 'package:immich_mobile/utils/hash.dart';
|
||||
|
||||
extension ListExtension<E> on List<E> {
|
||||
List<E> uniqueConsecutive({
|
||||
int Function(E a, E b)? compare,
|
||||
void Function(E a, E b)? onDuplicate,
|
||||
}) {
|
||||
List<E> uniqueConsecutive({int Function(E a, E b)? compare, void Function(E a, E b)? onDuplicate}) {
|
||||
compare ??= (E a, E b) => a == b ? 0 : 1;
|
||||
int i = 1, j = 1;
|
||||
for (; i < length; i++) {
|
||||
@@ -45,9 +42,7 @@ extension IntListExtension on Iterable<int> {
|
||||
|
||||
extension AssetListExtension on Iterable<Asset> {
|
||||
/// Returns the assets that are already available in the Immich server
|
||||
Iterable<Asset> remoteOnly({
|
||||
void Function()? errorCallback,
|
||||
}) {
|
||||
Iterable<Asset> remoteOnly({void Function()? errorCallback}) {
|
||||
final bool onlyRemote = every((e) => e.isRemote);
|
||||
if (!onlyRemote) {
|
||||
if (errorCallback != null) errorCallback();
|
||||
@@ -58,10 +53,7 @@ extension AssetListExtension on Iterable<Asset> {
|
||||
|
||||
/// Returns the assets that are owned by the user passed to the [owner] param
|
||||
/// If [owner] is null, an empty list is returned
|
||||
Iterable<Asset> ownedOnly(
|
||||
UserDto? owner, {
|
||||
void Function()? errorCallback,
|
||||
}) {
|
||||
Iterable<Asset> ownedOnly(UserDto? owner, {void Function()? errorCallback}) {
|
||||
if (owner == null) return [];
|
||||
final isarUserId = fastHash(owner.id);
|
||||
final bool onlyOwned = every((e) => e.ownerId == isarUserId);
|
||||
|
||||
@@ -47,11 +47,7 @@ extension DateRangeFormatting on DateTime {
|
||||
/// - Date range of this year: "Mar 23-May 31"
|
||||
/// - Date range of other year: "Aug 28 - Sep 30, 2023"
|
||||
/// - Date range over multiple years: "Apr 17, 2021 - Apr 9, 2022"
|
||||
static String formatDateRange(
|
||||
DateTime startDate,
|
||||
DateTime endDate,
|
||||
Locale? locale,
|
||||
) {
|
||||
static String formatDateRange(DateTime startDate, DateTime endDate, Locale? locale) {
|
||||
final now = DateTime.now();
|
||||
final currentYear = now.year;
|
||||
final localeString = locale?.toString() ?? 'en_US';
|
||||
|
||||
@@ -13,9 +13,7 @@ extension MapMarkers on MapLibreMapController {
|
||||
Future<void> addGeoJSONSourceForMarkers(List<MapMarker> markers) async {
|
||||
return addSource(
|
||||
MapUtils.defaultSourceId,
|
||||
GeojsonSourceProperties(
|
||||
data: MapUtils.generateGeoJsonForMarkers(markers.toList()),
|
||||
),
|
||||
GeojsonSourceProperties(data: MapUtils.generateGeoJsonForMarkers(markers.toList())),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -73,23 +71,13 @@ extension MapMarkers on MapLibreMapController {
|
||||
try {
|
||||
final ByteData bytes = await rootBundle.load("assets/location-pin.png");
|
||||
await addImage("mapMarker", bytes.buffer.asUint8List());
|
||||
return addSymbol(
|
||||
SymbolOptions(
|
||||
geometry: centre,
|
||||
iconImage: "mapMarker",
|
||||
iconSize: 0.15,
|
||||
iconAnchor: "bottom",
|
||||
),
|
||||
);
|
||||
return addSymbol(SymbolOptions(geometry: centre, iconImage: "mapMarker", iconSize: 0.15, iconAnchor: "bottom"));
|
||||
} finally {
|
||||
// no-op
|
||||
}
|
||||
}
|
||||
|
||||
Future<LatLngBounds> getBoundsFromPoint(
|
||||
Point<double> point,
|
||||
double distance,
|
||||
) async {
|
||||
Future<LatLngBounds> getBoundsFromPoint(Point<double> point, double distance) async {
|
||||
final southWestPx = Point(point.x - distance, point.y + distance);
|
||||
final northEastPx = Point(point.x + distance, point.y - distance);
|
||||
|
||||
|
||||
@@ -10,11 +10,7 @@ class FastScrollPhysics extends ScrollPhysics {
|
||||
}
|
||||
|
||||
@override
|
||||
SpringDescription get spring => const SpringDescription(
|
||||
mass: 1,
|
||||
stiffness: 402.49984375,
|
||||
damping: 40,
|
||||
);
|
||||
SpringDescription get spring => const SpringDescription(mass: 1, stiffness: 402.49984375, damping: 40);
|
||||
}
|
||||
|
||||
class FastClampingScrollPhysics extends ClampingScrollPhysics {
|
||||
@@ -27,12 +23,12 @@ class FastClampingScrollPhysics extends ClampingScrollPhysics {
|
||||
|
||||
@override
|
||||
SpringDescription get spring => const SpringDescription(
|
||||
// When swiping between videos on Android, the placeholder of the first opened video
|
||||
// can briefly be seen and cause a flicker effect if the video begins to initialize
|
||||
// before the animation finishes - probably a bug in PhotoViewGallery's animation handling
|
||||
// Making the animation faster is not just stylistic, but also helps to avoid this flicker
|
||||
mass: 1,
|
||||
stiffness: 1601.2499609375,
|
||||
damping: 80,
|
||||
);
|
||||
// When swiping between videos on Android, the placeholder of the first opened video
|
||||
// can briefly be seen and cause a flicker effect if the video begins to initialize
|
||||
// before the animation finishes - probably a bug in PhotoViewGallery's animation handling
|
||||
// Making the animation faster is not just stylistic, but also helps to avoid this flicker
|
||||
mass: 1,
|
||||
stiffness: 1601.2499609375,
|
||||
damping: 80,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
extension StringExtension on String {
|
||||
String capitalize() {
|
||||
return split(" ")
|
||||
.map(
|
||||
(str) => str.isEmpty ? str : str[0].toUpperCase() + str.substring(1),
|
||||
)
|
||||
.join(" ");
|
||||
return split(" ").map((str) => str.isEmpty ? str : str[0].toUpperCase() + str.substring(1)).join(" ");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,16 +7,10 @@ extension ImmichColorSchemeExtensions on ColorScheme {
|
||||
|
||||
extension ColorExtensions on Color {
|
||||
Color lighten({double amount = 0.1}) {
|
||||
return Color.alphaBlend(
|
||||
Colors.white.withValues(alpha: amount),
|
||||
this,
|
||||
);
|
||||
return Color.alphaBlend(Colors.white.withValues(alpha: amount), this);
|
||||
}
|
||||
|
||||
Color darken({double amount = 0.1}) {
|
||||
return Color.alphaBlend(
|
||||
Colors.black.withValues(alpha: amount),
|
||||
this,
|
||||
);
|
||||
return Color.alphaBlend(Colors.black.withValues(alpha: amount), this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,11 +29,7 @@ extension TextTranslateExtension on Text {
|
||||
}
|
||||
}
|
||||
|
||||
String _translateHelper(
|
||||
BuildContext? context,
|
||||
String key, [
|
||||
Map<String, Object>? args,
|
||||
]) {
|
||||
String _translateHelper(BuildContext? context, String key, [Map<String, Object>? args]) {
|
||||
if (key.isEmpty) {
|
||||
return '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user