mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor: DCM - const border radius, constructor & switch expressions (#19515)
* enable border radius, switch exp, const constructor * regenerate provider * more formatting --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
05064f87f0
commit
5b0575b956
130 changed files with 338 additions and 264 deletions
|
|
@ -15,7 +15,7 @@ class RemoteThumbProvider extends ImageProvider<RemoteThumbProvider> {
|
|||
final double width;
|
||||
final CacheManager? cacheManager;
|
||||
|
||||
RemoteThumbProvider({
|
||||
const RemoteThumbProvider({
|
||||
required this.assetId,
|
||||
this.height = kTimelineFixedTileExtent,
|
||||
this.width = kTimelineFixedTileExtent,
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import 'package:thumbhash/thumbhash.dart';
|
|||
class ThumbHashProvider extends ImageProvider<ThumbHashProvider> {
|
||||
final String thumbHash;
|
||||
|
||||
ThumbHashProvider({
|
||||
const ThumbHashProvider({
|
||||
required this.thumbHash,
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -15,18 +15,12 @@ abstract class SegmentBuilder {
|
|||
this.groupBy = GroupAssetsBy.day,
|
||||
});
|
||||
|
||||
static double headerExtent(HeaderType header) {
|
||||
switch (header) {
|
||||
case HeaderType.month:
|
||||
return kTimelineHeaderExtent;
|
||||
case HeaderType.day:
|
||||
return kTimelineHeaderExtent * 0.90;
|
||||
case HeaderType.monthAndDay:
|
||||
return kTimelineHeaderExtent * 1.6;
|
||||
case HeaderType.none:
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
static double headerExtent(HeaderType header) => switch (header) {
|
||||
HeaderType.month => kTimelineHeaderExtent,
|
||||
HeaderType.day => kTimelineHeaderExtent * 0.90,
|
||||
HeaderType.monthAndDay => kTimelineHeaderExtent * 1.6,
|
||||
HeaderType.none => 0.0,
|
||||
};
|
||||
|
||||
static Widget buildPlaceholder(
|
||||
BuildContext context,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue