mirror of
https://github.com/immich-app/immich.git
synced 2025-12-30 01:11:52 +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:
@@ -16,45 +16,35 @@ class MemoryBottomInfo extends StatelessWidget {
|
||||
final df = DateFormat.yMMMMd();
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
memory.title,
|
||||
style: TextStyle(
|
||||
color: Colors.grey[400],
|
||||
fontSize: 13.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
memory.title,
|
||||
style: TextStyle(color: Colors.grey[400], fontSize: 13.0, fontWeight: FontWeight.w500),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
df.format(
|
||||
memory.assets[0].fileCreatedAt,
|
||||
Text(
|
||||
df.format(memory.assets[0].fileCreatedAt),
|
||||
style: const TextStyle(color: Colors.white, fontSize: 15.0, fontWeight: FontWeight.w500),
|
||||
),
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 15.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
MaterialButton(
|
||||
minWidth: 0,
|
||||
onPressed: () {
|
||||
context.maybePop();
|
||||
scrollToDateNotifierProvider.scrollToDate(memory.assets[0].fileCreatedAt);
|
||||
},
|
||||
shape: const CircleBorder(),
|
||||
color: Colors.white.withValues(alpha: 0.2),
|
||||
elevation: 0,
|
||||
child: const Icon(
|
||||
Icons.open_in_new,
|
||||
color: Colors.white,
|
||||
],
|
||||
),
|
||||
),
|
||||
]),
|
||||
MaterialButton(
|
||||
minWidth: 0,
|
||||
onPressed: () {
|
||||
context.maybePop();
|
||||
scrollToDateNotifierProvider.scrollToDate(memory.assets[0].fileCreatedAt);
|
||||
},
|
||||
shape: const CircleBorder(),
|
||||
color: Colors.white.withValues(alpha: 0.2),
|
||||
elevation: 0,
|
||||
child: const Icon(Icons.open_in_new, color: Colors.white),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,13 +14,7 @@ class MemoryCard extends StatelessWidget {
|
||||
final bool showTitle;
|
||||
final Function()? onVideoEnded;
|
||||
|
||||
const MemoryCard({
|
||||
required this.asset,
|
||||
required this.title,
|
||||
required this.showTitle,
|
||||
this.onVideoEnded,
|
||||
super.key,
|
||||
});
|
||||
const MemoryCard({required this.asset, required this.title, required this.showTitle, this.onVideoEnded, super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -28,17 +22,12 @@ class MemoryCard extends StatelessWidget {
|
||||
color: Colors.black,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(25.0)),
|
||||
side: BorderSide(
|
||||
color: Colors.black,
|
||||
width: 1.0,
|
||||
),
|
||||
side: BorderSide(color: Colors.black, width: 1.0),
|
||||
),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: Stack(
|
||||
children: [
|
||||
SizedBox.expand(
|
||||
child: _BlurredBackdrop(asset: asset),
|
||||
),
|
||||
SizedBox.expand(child: _BlurredBackdrop(asset: asset)),
|
||||
LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
// Determine the fit using the aspect ratio
|
||||
@@ -56,12 +45,7 @@ class MemoryCard extends StatelessWidget {
|
||||
if (asset.isImage) {
|
||||
return Hero(
|
||||
tag: 'memory-${asset.id}',
|
||||
child: ImmichImage(
|
||||
asset,
|
||||
fit: fit,
|
||||
height: double.infinity,
|
||||
width: double.infinity,
|
||||
),
|
||||
child: ImmichImage(asset, fit: fit, height: double.infinity, width: double.infinity),
|
||||
);
|
||||
} else {
|
||||
return Hero(
|
||||
@@ -74,12 +58,7 @@ class MemoryCard extends StatelessWidget {
|
||||
asset: asset,
|
||||
showControls: false,
|
||||
playbackDelayFactor: 2,
|
||||
image: ImmichImage(
|
||||
asset,
|
||||
width: context.width,
|
||||
height: context.height,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
image: ImmichImage(asset, width: context.width, height: context.height, fit: BoxFit.contain),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -92,10 +71,7 @@ class MemoryCard extends StatelessWidget {
|
||||
bottom: 18.0,
|
||||
child: Text(
|
||||
title,
|
||||
style: context.textTheme.headlineMedium?.copyWith(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
style: context.textTheme.headlineMedium?.copyWith(color: Colors.white, fontWeight: FontWeight.w500),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -116,16 +92,9 @@ class _BlurredBackdrop extends HookWidget {
|
||||
// Use a nice cheap blur hash image decoration
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: MemoryImage(
|
||||
blurhash,
|
||||
),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
child: Container(
|
||||
color: Colors.black.withValues(alpha: 0.2),
|
||||
image: DecorationImage(image: MemoryImage(blurhash), fit: BoxFit.cover),
|
||||
),
|
||||
child: Container(color: Colors.black.withValues(alpha: 0.2)),
|
||||
);
|
||||
} else {
|
||||
// Fall back to using a more expensive image filtered
|
||||
@@ -136,17 +105,11 @@ class _BlurredBackdrop extends HookWidget {
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: ImmichImage.imageProvider(
|
||||
asset: asset,
|
||||
height: context.height,
|
||||
width: context.width,
|
||||
),
|
||||
image: ImmichImage.imageProvider(asset: asset, height: context.height, width: context.width),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
child: Container(
|
||||
color: Colors.black.withValues(alpha: 0.2),
|
||||
),
|
||||
child: Container(color: Colors.black.withValues(alpha: 0.2)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,24 +12,15 @@ class MemoryEpilogue extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MemoryEpilogueState extends State<MemoryEpilogue> with TickerProviderStateMixin {
|
||||
late final _animationController = AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(
|
||||
seconds: 2,
|
||||
),
|
||||
)..repeat(
|
||||
reverse: true,
|
||||
);
|
||||
late final _animationController = AnimationController(vsync: this, duration: const Duration(seconds: 2))
|
||||
..repeat(reverse: true);
|
||||
|
||||
late final Animation _animation;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_animation = CurvedAnimation(
|
||||
parent: _animationController,
|
||||
curve: Curves.easeIn,
|
||||
);
|
||||
_animation = CurvedAnimation(parent: _animationController, curve: Curves.easeIn);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -55,16 +46,12 @@ class _MemoryEpilogueState extends State<MemoryEpilogue> with TickerProviderStat
|
||||
const SizedBox(height: 16.0),
|
||||
Text(
|
||||
"memories_all_caught_up",
|
||||
style: context.textTheme.headlineMedium?.copyWith(
|
||||
color: Colors.white,
|
||||
),
|
||||
style: context.textTheme.headlineMedium?.copyWith(color: Colors.white),
|
||||
).tr(),
|
||||
const SizedBox(height: 16.0),
|
||||
Text(
|
||||
"memories_check_back_tomorrow",
|
||||
style: context.textTheme.bodyMedium?.copyWith(
|
||||
color: Colors.white,
|
||||
),
|
||||
style: context.textTheme.bodyMedium?.copyWith(color: Colors.white),
|
||||
).tr(),
|
||||
const SizedBox(height: 16.0),
|
||||
TextButton(
|
||||
@@ -92,23 +79,14 @@ class _MemoryEpilogueState extends State<MemoryEpilogue> with TickerProviderStat
|
||||
child: AnimatedBuilder(
|
||||
animation: _animation,
|
||||
builder: (context, child) {
|
||||
return Transform.translate(
|
||||
offset: Offset(0, 8 * _animationController.value),
|
||||
child: child,
|
||||
);
|
||||
return Transform.translate(offset: Offset(0, 8 * _animationController.value), child: child);
|
||||
},
|
||||
child: const Icon(
|
||||
size: 32,
|
||||
Icons.expand_less_sharp,
|
||||
color: Colors.white,
|
||||
),
|
||||
child: const Icon(size: 32, Icons.expand_less_sharp, color: Colors.white),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"memories_swipe_to_close",
|
||||
style: context.textTheme.bodyMedium?.copyWith(
|
||||
color: Colors.white,
|
||||
),
|
||||
style: context.textTheme.bodyMedium?.copyWith(color: Colors.white),
|
||||
).tr(),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -22,17 +22,13 @@ class MemoryLane extends HookConsumerWidget {
|
||||
.whenData(
|
||||
(memories) => memories != null
|
||||
? ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxHeight: 200,
|
||||
),
|
||||
constraints: const BoxConstraints(maxHeight: 200),
|
||||
child: CarouselView(
|
||||
itemExtent: 145.0,
|
||||
shrinkExtent: 1.0,
|
||||
elevation: 2,
|
||||
backgroundColor: Colors.black,
|
||||
overlayColor: WidgetStateProperty.all(
|
||||
Colors.white.withValues(alpha: 0.1),
|
||||
),
|
||||
overlayColor: WidgetStateProperty.all(Colors.white.withValues(alpha: 0.1)),
|
||||
onTap: (memoryIndex) {
|
||||
ref.read(hapticFeedbackProvider.notifier).heavyImpact();
|
||||
if (memories[memoryIndex].assets.isNotEmpty) {
|
||||
@@ -42,20 +38,10 @@ class MemoryLane extends HookConsumerWidget {
|
||||
ref.read(videoPlaybackValueProvider.notifier).reset();
|
||||
}
|
||||
}
|
||||
context.pushRoute(
|
||||
MemoryRoute(
|
||||
memories: memories,
|
||||
memoryIndex: memoryIndex,
|
||||
),
|
||||
);
|
||||
context.pushRoute(MemoryRoute(memories: memories, memoryIndex: memoryIndex));
|
||||
},
|
||||
children: memories
|
||||
.mapIndexed<Widget>(
|
||||
(index, memory) => MemoryCard(
|
||||
index: index,
|
||||
memory: memory,
|
||||
),
|
||||
)
|
||||
.mapIndexed<Widget>((index, memory) => MemoryCard(index: index, memory: memory))
|
||||
.toList(),
|
||||
),
|
||||
)
|
||||
@@ -68,11 +54,7 @@ class MemoryLane extends HookConsumerWidget {
|
||||
}
|
||||
|
||||
class MemoryCard extends ConsumerWidget {
|
||||
const MemoryCard({
|
||||
super.key,
|
||||
required this.index,
|
||||
required this.memory,
|
||||
});
|
||||
const MemoryCard({super.key, required this.index, required this.memory});
|
||||
|
||||
final int index;
|
||||
final Memory memory;
|
||||
@@ -83,10 +65,7 @@ class MemoryCard extends ConsumerWidget {
|
||||
child: Stack(
|
||||
children: [
|
||||
ColorFiltered(
|
||||
colorFilter: ColorFilter.mode(
|
||||
Colors.black.withValues(alpha: 0.2),
|
||||
BlendMode.darken,
|
||||
),
|
||||
colorFilter: ColorFilter.mode(Colors.black.withValues(alpha: 0.2), BlendMode.darken),
|
||||
child: Hero(
|
||||
tag: 'memory-${memory.assets[0].id}',
|
||||
child: ImmichImage(
|
||||
@@ -94,10 +73,7 @@ class MemoryCard extends ConsumerWidget {
|
||||
fit: BoxFit.cover,
|
||||
width: 205,
|
||||
height: 200,
|
||||
placeholder: const ThumbnailPlaceholder(
|
||||
width: 105,
|
||||
height: 200,
|
||||
),
|
||||
placeholder: const ThumbnailPlaceholder(width: 105, height: 200),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -105,16 +81,10 @@ class MemoryCard extends ConsumerWidget {
|
||||
bottom: 16,
|
||||
left: 16,
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: 114,
|
||||
),
|
||||
constraints: const BoxConstraints(maxWidth: 114),
|
||||
child: Text(
|
||||
memory.title,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.white,
|
||||
fontSize: 15,
|
||||
),
|
||||
style: const TextStyle(fontWeight: FontWeight.w600, color: Colors.white, fontSize: 15),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -8,11 +8,7 @@ class MemoryProgressIndicator extends StatelessWidget {
|
||||
/// The current value of the indicator
|
||||
final double value;
|
||||
|
||||
const MemoryProgressIndicator({
|
||||
super.key,
|
||||
required this.ticks,
|
||||
required this.value,
|
||||
});
|
||||
const MemoryProgressIndicator({super.key, required this.ticks, required this.value});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -37,14 +33,7 @@ class MemoryProgressIndicator extends StatelessWidget {
|
||||
width: tickWidth,
|
||||
height: 4,
|
||||
decoration: BoxDecoration(
|
||||
border: i == 0
|
||||
? null
|
||||
: const Border(
|
||||
left: BorderSide(
|
||||
color: Colors.black,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
border: i == 0 ? null : const Border(left: BorderSide(color: Colors.black, width: 1)),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user