flutter vNext prep
This commit is contained in:
parent
129b76e488
commit
6d997c438a
11 changed files with 245 additions and 353 deletions
|
@ -8,13 +8,11 @@ extension ExtraNameConflictStrategy on NameConflictStrategy {
|
|||
String toPlatform() => name;
|
||||
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case NameConflictStrategy.rename:
|
||||
return context.l10n.nameConflictStrategyRename;
|
||||
case NameConflictStrategy.replace:
|
||||
return context.l10n.nameConflictStrategyReplace;
|
||||
case NameConflictStrategy.skip:
|
||||
return context.l10n.nameConflictStrategySkip;
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
return switch (this) {
|
||||
NameConflictStrategy.rename => l10n.nameConflictStrategyRename,
|
||||
NameConflictStrategy.replace => l10n.nameConflictStrategyReplace,
|
||||
NameConflictStrategy.skip => l10n.nameConflictStrategySkip,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,293 +5,241 @@ import 'package:flutter/widgets.dart';
|
|||
|
||||
extension ExtraAccessibilityAnimationsView on AccessibilityAnimations {
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case AccessibilityAnimations.system:
|
||||
return context.l10n.settingsSystemDefault;
|
||||
case AccessibilityAnimations.disabled:
|
||||
return context.l10n.accessibilityAnimationsRemove;
|
||||
case AccessibilityAnimations.enabled:
|
||||
return context.l10n.accessibilityAnimationsKeep;
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
return switch (this) {
|
||||
AccessibilityAnimations.system => l10n.settingsSystemDefault,
|
||||
AccessibilityAnimations.disabled => l10n.accessibilityAnimationsRemove,
|
||||
AccessibilityAnimations.enabled => l10n.accessibilityAnimationsKeep,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
extension ExtraAccessibilityTimeoutView on AccessibilityTimeout {
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case AccessibilityTimeout.system:
|
||||
return context.l10n.settingsSystemDefault;
|
||||
case AccessibilityTimeout.s1:
|
||||
return context.l10n.timeSeconds(1);
|
||||
case AccessibilityTimeout.s3:
|
||||
return context.l10n.timeSeconds(3);
|
||||
case AccessibilityTimeout.s5:
|
||||
return context.l10n.timeSeconds(5);
|
||||
case AccessibilityTimeout.s10:
|
||||
return context.l10n.timeSeconds(10);
|
||||
case AccessibilityTimeout.s30:
|
||||
return context.l10n.timeSeconds(30);
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
return switch (this) {
|
||||
AccessibilityTimeout.system => l10n.settingsSystemDefault,
|
||||
AccessibilityTimeout.s1 => l10n.timeSeconds(1),
|
||||
AccessibilityTimeout.s3 => l10n.timeSeconds(3),
|
||||
AccessibilityTimeout.s5 => l10n.timeSeconds(5),
|
||||
AccessibilityTimeout.s10 => l10n.timeSeconds(10),
|
||||
AccessibilityTimeout.s30 => l10n.timeSeconds(30),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
extension ExtraAvesThemeBrightnessView on AvesThemeBrightness {
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case AvesThemeBrightness.system:
|
||||
return context.l10n.settingsSystemDefault;
|
||||
case AvesThemeBrightness.light:
|
||||
return context.l10n.themeBrightnessLight;
|
||||
case AvesThemeBrightness.dark:
|
||||
return context.l10n.themeBrightnessDark;
|
||||
case AvesThemeBrightness.black:
|
||||
return context.l10n.themeBrightnessBlack;
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
return switch (this) {
|
||||
AvesThemeBrightness.system => l10n.settingsSystemDefault,
|
||||
AvesThemeBrightness.light => l10n.themeBrightnessLight,
|
||||
AvesThemeBrightness.dark => l10n.themeBrightnessDark,
|
||||
AvesThemeBrightness.black => l10n.themeBrightnessBlack,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
extension ExtraCoordinateFormatView on CoordinateFormat {
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case CoordinateFormat.dms:
|
||||
return context.l10n.coordinateFormatDms;
|
||||
case CoordinateFormat.decimal:
|
||||
return context.l10n.coordinateFormatDecimal;
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
return switch (this) {
|
||||
CoordinateFormat.dms => l10n.coordinateFormatDms,
|
||||
CoordinateFormat.decimal => l10n.coordinateFormatDecimal,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
extension ExtraDisplayRefreshRateModeView on DisplayRefreshRateMode {
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case DisplayRefreshRateMode.auto:
|
||||
return context.l10n.settingsSystemDefault;
|
||||
case DisplayRefreshRateMode.highest:
|
||||
return context.l10n.displayRefreshRatePreferHighest;
|
||||
case DisplayRefreshRateMode.lowest:
|
||||
return context.l10n.displayRefreshRatePreferLowest;
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
return switch (this) {
|
||||
DisplayRefreshRateMode.auto => l10n.settingsSystemDefault,
|
||||
DisplayRefreshRateMode.highest => l10n.displayRefreshRatePreferHighest,
|
||||
DisplayRefreshRateMode.lowest => l10n.displayRefreshRatePreferLowest,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
extension ExtraEntryMapStyleView on EntryMapStyle {
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case EntryMapStyle.googleNormal:
|
||||
return context.l10n.mapStyleGoogleNormal;
|
||||
case EntryMapStyle.googleHybrid:
|
||||
return context.l10n.mapStyleGoogleHybrid;
|
||||
case EntryMapStyle.googleTerrain:
|
||||
return context.l10n.mapStyleGoogleTerrain;
|
||||
case EntryMapStyle.hmsNormal:
|
||||
return context.l10n.mapStyleHuaweiNormal;
|
||||
case EntryMapStyle.hmsTerrain:
|
||||
return context.l10n.mapStyleHuaweiTerrain;
|
||||
case EntryMapStyle.osmHot:
|
||||
return context.l10n.mapStyleOsmHot;
|
||||
case EntryMapStyle.stamenToner:
|
||||
return context.l10n.mapStyleStamenToner;
|
||||
case EntryMapStyle.stamenWatercolor:
|
||||
return context.l10n.mapStyleStamenWatercolor;
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
return switch (this) {
|
||||
EntryMapStyle.googleNormal => l10n.mapStyleGoogleNormal,
|
||||
EntryMapStyle.googleHybrid => l10n.mapStyleGoogleHybrid,
|
||||
EntryMapStyle.googleTerrain => l10n.mapStyleGoogleTerrain,
|
||||
EntryMapStyle.hmsNormal => l10n.mapStyleHuaweiNormal,
|
||||
EntryMapStyle.hmsTerrain => l10n.mapStyleHuaweiTerrain,
|
||||
EntryMapStyle.osmHot => l10n.mapStyleOsmHot,
|
||||
EntryMapStyle.stamenToner => l10n.mapStyleStamenToner,
|
||||
EntryMapStyle.stamenWatercolor => l10n.mapStyleStamenWatercolor,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
extension ExtraHomePageSettingView on HomePageSetting {
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case HomePageSetting.collection:
|
||||
return context.l10n.drawerCollectionAll;
|
||||
case HomePageSetting.albums:
|
||||
return context.l10n.drawerAlbumPage;
|
||||
case HomePageSetting.tags:
|
||||
return context.l10n.drawerTagPage;
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
return switch (this) {
|
||||
HomePageSetting.collection => l10n.drawerCollectionAll,
|
||||
HomePageSetting.albums => l10n.drawerAlbumPage,
|
||||
HomePageSetting.tags => l10n.drawerTagPage,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
extension ExtraKeepScreenOnView on KeepScreenOn {
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case KeepScreenOn.never:
|
||||
return context.l10n.keepScreenOnNever;
|
||||
case KeepScreenOn.videoPlayback:
|
||||
return context.l10n.keepScreenOnVideoPlayback;
|
||||
case KeepScreenOn.viewerOnly:
|
||||
return context.l10n.keepScreenOnViewerOnly;
|
||||
case KeepScreenOn.always:
|
||||
return context.l10n.keepScreenOnAlways;
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
return switch (this) {
|
||||
KeepScreenOn.never => l10n.keepScreenOnNever,
|
||||
KeepScreenOn.videoPlayback => l10n.keepScreenOnVideoPlayback,
|
||||
KeepScreenOn.viewerOnly => l10n.keepScreenOnViewerOnly,
|
||||
KeepScreenOn.always => l10n.keepScreenOnAlways,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
extension ExtraMaxBrightnessView on MaxBrightness {
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case MaxBrightness.never:
|
||||
return context.l10n.maxBrightnessNever;
|
||||
case MaxBrightness.viewerOnly:
|
||||
return context.l10n.keepScreenOnViewerOnly;
|
||||
case MaxBrightness.always:
|
||||
return context.l10n.maxBrightnessAlways;
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
return switch (this) {
|
||||
MaxBrightness.never => l10n.maxBrightnessNever,
|
||||
MaxBrightness.viewerOnly => l10n.keepScreenOnViewerOnly,
|
||||
MaxBrightness.always => l10n.maxBrightnessAlways,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
extension ExtraSlideshowVideoPlaybackView on SlideshowVideoPlayback {
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case SlideshowVideoPlayback.skip:
|
||||
return context.l10n.videoPlaybackSkip;
|
||||
case SlideshowVideoPlayback.playMuted:
|
||||
return context.l10n.videoPlaybackMuted;
|
||||
case SlideshowVideoPlayback.playWithSound:
|
||||
return context.l10n.videoPlaybackWithSound;
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
return switch (this) {
|
||||
SlideshowVideoPlayback.skip => l10n.videoPlaybackSkip,
|
||||
SlideshowVideoPlayback.playMuted => l10n.videoPlaybackMuted,
|
||||
SlideshowVideoPlayback.playWithSound => l10n.videoPlaybackWithSound,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
extension ExtraOverlayHistogramStyleView on OverlayHistogramStyle {
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case OverlayHistogramStyle.none:
|
||||
return context.l10n.overlayHistogramNone;
|
||||
case OverlayHistogramStyle.rgb:
|
||||
return context.l10n.overlayHistogramRGB;
|
||||
case OverlayHistogramStyle.luminance:
|
||||
return context.l10n.overlayHistogramLuminance;
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
return switch (this) {
|
||||
OverlayHistogramStyle.none => l10n.overlayHistogramNone,
|
||||
OverlayHistogramStyle.rgb => l10n.overlayHistogramRGB,
|
||||
OverlayHistogramStyle.luminance => l10n.overlayHistogramLuminance,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
extension ExtraSubtitlePositionView on SubtitlePosition {
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case SubtitlePosition.top:
|
||||
return context.l10n.subtitlePositionTop;
|
||||
case SubtitlePosition.bottom:
|
||||
return context.l10n.subtitlePositionBottom;
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
return switch (this) {
|
||||
SubtitlePosition.top => l10n.subtitlePositionTop,
|
||||
SubtitlePosition.bottom => l10n.subtitlePositionBottom,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
extension ExtraUnitSystemView on UnitSystem {
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case UnitSystem.metric:
|
||||
return context.l10n.unitSystemMetric;
|
||||
case UnitSystem.imperial:
|
||||
return context.l10n.unitSystemImperial;
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
return switch (this) {
|
||||
UnitSystem.metric => l10n.unitSystemMetric,
|
||||
UnitSystem.imperial => l10n.unitSystemImperial,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
extension ExtraVideoAutoPlayModeView on VideoAutoPlayMode {
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case VideoAutoPlayMode.disabled:
|
||||
return context.l10n.settingsDisabled;
|
||||
case VideoAutoPlayMode.playMuted:
|
||||
return context.l10n.videoPlaybackMuted;
|
||||
case VideoAutoPlayMode.playWithSound:
|
||||
return context.l10n.videoPlaybackWithSound;
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
return switch (this) {
|
||||
VideoAutoPlayMode.disabled => l10n.settingsDisabled,
|
||||
VideoAutoPlayMode.playMuted => l10n.videoPlaybackMuted,
|
||||
VideoAutoPlayMode.playWithSound => l10n.videoPlaybackWithSound,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
extension ExtraVideoBackgroundModeView on VideoBackgroundMode {
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case VideoBackgroundMode.disabled:
|
||||
return context.l10n.settingsDisabled;
|
||||
case VideoBackgroundMode.pip:
|
||||
return context.l10n.settingsVideoEnablePip;
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
return switch (this) {
|
||||
VideoBackgroundMode.disabled => l10n.settingsDisabled,
|
||||
VideoBackgroundMode.pip => l10n.settingsVideoEnablePip,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
extension ExtraVideoControlsView on VideoControls {
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case VideoControls.play:
|
||||
return context.l10n.videoControlsPlay;
|
||||
case VideoControls.playSeek:
|
||||
return context.l10n.videoControlsPlaySeek;
|
||||
case VideoControls.playOutside:
|
||||
return context.l10n.videoControlsPlayOutside;
|
||||
case VideoControls.none:
|
||||
return context.l10n.videoControlsNone;
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
return switch (this) {
|
||||
VideoControls.play => l10n.videoControlsPlay,
|
||||
VideoControls.playSeek => l10n.videoControlsPlaySeek,
|
||||
VideoControls.playOutside => l10n.videoControlsPlayOutside,
|
||||
VideoControls.none => l10n.videoControlsNone,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
extension ExtraVideoLoopModeView on VideoLoopMode {
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case VideoLoopMode.never:
|
||||
return context.l10n.videoLoopModeNever;
|
||||
case VideoLoopMode.shortOnly:
|
||||
return context.l10n.videoLoopModeShortOnly;
|
||||
case VideoLoopMode.always:
|
||||
return context.l10n.videoLoopModeAlways;
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
return switch (this) {
|
||||
VideoLoopMode.never => l10n.videoLoopModeNever,
|
||||
VideoLoopMode.shortOnly => l10n.videoLoopModeShortOnly,
|
||||
VideoLoopMode.always => l10n.videoLoopModeAlways,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
extension ExtraVideoResumptionModeView on VideoResumptionMode {
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case VideoResumptionMode.never:
|
||||
return context.l10n.videoResumptionModeNever;
|
||||
case VideoResumptionMode.ask:
|
||||
return context.l10n.settingsAskEverytime;
|
||||
case VideoResumptionMode.always:
|
||||
return context.l10n.videoResumptionModeAlways;
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
return switch (this) {
|
||||
VideoResumptionMode.never => l10n.videoResumptionModeNever,
|
||||
VideoResumptionMode.ask => l10n.settingsAskEverytime,
|
||||
VideoResumptionMode.always => l10n.videoResumptionModeAlways,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
extension ExtraViewerTransitionView on ViewerTransition {
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case ViewerTransition.slide:
|
||||
return context.l10n.viewerTransitionSlide;
|
||||
case ViewerTransition.parallax:
|
||||
return context.l10n.viewerTransitionParallax;
|
||||
case ViewerTransition.fade:
|
||||
return context.l10n.viewerTransitionFade;
|
||||
case ViewerTransition.zoomIn:
|
||||
return context.l10n.viewerTransitionZoomIn;
|
||||
case ViewerTransition.none:
|
||||
return context.l10n.viewerTransitionNone;
|
||||
case ViewerTransition.random:
|
||||
return context.l10n.widgetDisplayedItemRandom;
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
return switch (this) {
|
||||
ViewerTransition.slide => l10n.viewerTransitionSlide,
|
||||
ViewerTransition.parallax => l10n.viewerTransitionParallax,
|
||||
ViewerTransition.fade => l10n.viewerTransitionFade,
|
||||
ViewerTransition.zoomIn => l10n.viewerTransitionZoomIn,
|
||||
ViewerTransition.none => l10n.viewerTransitionNone,
|
||||
ViewerTransition.random => l10n.widgetDisplayedItemRandom,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
extension ExtraWidgetDisplayedItemView on WidgetDisplayedItem {
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case WidgetDisplayedItem.random:
|
||||
return context.l10n.widgetDisplayedItemRandom;
|
||||
case WidgetDisplayedItem.mostRecent:
|
||||
return context.l10n.widgetDisplayedItemMostRecent;
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
return switch (this) {
|
||||
WidgetDisplayedItem.random => l10n.widgetDisplayedItemRandom,
|
||||
WidgetDisplayedItem.mostRecent => l10n.widgetDisplayedItemMostRecent,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
extension ExtraWidgetOpenPageView on WidgetOpenPage {
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case WidgetOpenPage.home:
|
||||
return context.l10n.widgetOpenPageHome;
|
||||
case WidgetOpenPage.collection:
|
||||
return context.l10n.widgetOpenPageCollection;
|
||||
case WidgetOpenPage.viewer:
|
||||
return context.l10n.widgetOpenPageViewer;
|
||||
case WidgetOpenPage.updateWidget:
|
||||
return context.l10n.widgetTapUpdateWidget;
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
return switch (this) {
|
||||
WidgetOpenPage.home => l10n.widgetOpenPageHome,
|
||||
WidgetOpenPage.collection => l10n.widgetOpenPageCollection,
|
||||
WidgetOpenPage.viewer => l10n.widgetOpenPageViewer,
|
||||
WidgetOpenPage.updateWidget => l10n.widgetTapUpdateWidget,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,23 +5,18 @@ import 'package:flutter/widgets.dart';
|
|||
|
||||
extension ExtraThumbnailOverlayLocationIconView on ThumbnailOverlayLocationIcon {
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case ThumbnailOverlayLocationIcon.located:
|
||||
return context.l10n.filterLocatedLabel;
|
||||
case ThumbnailOverlayLocationIcon.unlocated:
|
||||
return context.l10n.filterNoLocationLabel;
|
||||
case ThumbnailOverlayLocationIcon.none:
|
||||
return context.l10n.settingsDisabled;
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
return switch (this) {
|
||||
ThumbnailOverlayLocationIcon.located => l10n.filterLocatedLabel,
|
||||
ThumbnailOverlayLocationIcon.unlocated => l10n.filterNoLocationLabel,
|
||||
ThumbnailOverlayLocationIcon.none => l10n.settingsDisabled,
|
||||
};
|
||||
}
|
||||
|
||||
IconData getIcon(BuildContext context) {
|
||||
switch (this) {
|
||||
case ThumbnailOverlayLocationIcon.unlocated:
|
||||
return AIcons.locationUnlocated;
|
||||
case ThumbnailOverlayLocationIcon.located:
|
||||
case ThumbnailOverlayLocationIcon.none:
|
||||
return AIcons.location;
|
||||
}
|
||||
return switch (this) {
|
||||
ThumbnailOverlayLocationIcon.unlocated => AIcons.locationUnlocated,
|
||||
ThumbnailOverlayLocationIcon.located || ThumbnailOverlayLocationIcon.none => AIcons.location,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,24 +5,19 @@ import 'package:flutter/widgets.dart';
|
|||
|
||||
extension ExtraThumbnailOverlayTagIconView on ThumbnailOverlayTagIcon {
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case ThumbnailOverlayTagIcon.tagged:
|
||||
return context.l10n.filterTaggedLabel;
|
||||
case ThumbnailOverlayTagIcon.untagged:
|
||||
return context.l10n.filterNoTagLabel;
|
||||
case ThumbnailOverlayTagIcon.none:
|
||||
return context.l10n.settingsDisabled;
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
return switch (this) {
|
||||
ThumbnailOverlayTagIcon.tagged => l10n.filterTaggedLabel,
|
||||
ThumbnailOverlayTagIcon.untagged => l10n.filterNoTagLabel,
|
||||
ThumbnailOverlayTagIcon.none => l10n.settingsDisabled,
|
||||
};
|
||||
}
|
||||
|
||||
IconData getIcon(BuildContext context) {
|
||||
switch (this) {
|
||||
case ThumbnailOverlayTagIcon.tagged:
|
||||
return AIcons.tag;
|
||||
case ThumbnailOverlayTagIcon.untagged:
|
||||
return AIcons.tagUntagged;
|
||||
case ThumbnailOverlayTagIcon.none:
|
||||
return AIcons.tag;
|
||||
}
|
||||
return switch (this) {
|
||||
ThumbnailOverlayTagIcon.tagged => AIcons.tag,
|
||||
ThumbnailOverlayTagIcon.untagged => AIcons.tagUntagged,
|
||||
ThumbnailOverlayTagIcon.none => AIcons.tag,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,57 +6,41 @@ import 'package:flutter/widgets.dart';
|
|||
extension ExtraEntryGroupFactorView on EntryGroupFactor {
|
||||
String getName(BuildContext context) {
|
||||
final l10n = context.l10n;
|
||||
switch (this) {
|
||||
case EntryGroupFactor.album:
|
||||
return l10n.collectionGroupAlbum;
|
||||
case EntryGroupFactor.month:
|
||||
return l10n.collectionGroupMonth;
|
||||
case EntryGroupFactor.day:
|
||||
return l10n.collectionGroupDay;
|
||||
case EntryGroupFactor.none:
|
||||
return l10n.collectionGroupNone;
|
||||
}
|
||||
return switch (this) {
|
||||
EntryGroupFactor.album => l10n.collectionGroupAlbum,
|
||||
EntryGroupFactor.month => l10n.collectionGroupMonth,
|
||||
EntryGroupFactor.day => l10n.collectionGroupDay,
|
||||
EntryGroupFactor.none => l10n.collectionGroupNone,
|
||||
};
|
||||
}
|
||||
|
||||
IconData get icon {
|
||||
switch (this) {
|
||||
case EntryGroupFactor.album:
|
||||
return AIcons.album;
|
||||
case EntryGroupFactor.month:
|
||||
return AIcons.dateByMonth;
|
||||
case EntryGroupFactor.day:
|
||||
return AIcons.dateByDay;
|
||||
case EntryGroupFactor.none:
|
||||
return AIcons.clear;
|
||||
}
|
||||
return switch (this) {
|
||||
EntryGroupFactor.album => AIcons.album,
|
||||
EntryGroupFactor.month => AIcons.dateByMonth,
|
||||
EntryGroupFactor.day => AIcons.dateByDay,
|
||||
EntryGroupFactor.none => AIcons.clear,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
extension ExtraAlbumChipGroupFactorView on AlbumChipGroupFactor {
|
||||
String getName(BuildContext context) {
|
||||
final l10n = context.l10n;
|
||||
switch (this) {
|
||||
case AlbumChipGroupFactor.importance:
|
||||
return l10n.albumGroupTier;
|
||||
case AlbumChipGroupFactor.mimeType:
|
||||
return l10n.albumGroupType;
|
||||
case AlbumChipGroupFactor.volume:
|
||||
return l10n.albumGroupVolume;
|
||||
case AlbumChipGroupFactor.none:
|
||||
return l10n.albumGroupNone;
|
||||
}
|
||||
return switch (this) {
|
||||
AlbumChipGroupFactor.importance => l10n.albumGroupTier,
|
||||
AlbumChipGroupFactor.mimeType => l10n.albumGroupType,
|
||||
AlbumChipGroupFactor.volume => l10n.albumGroupVolume,
|
||||
AlbumChipGroupFactor.none => l10n.albumGroupNone,
|
||||
};
|
||||
}
|
||||
|
||||
IconData get icon {
|
||||
switch (this) {
|
||||
case AlbumChipGroupFactor.importance:
|
||||
return AIcons.important;
|
||||
case AlbumChipGroupFactor.mimeType:
|
||||
return AIcons.mimeType;
|
||||
case AlbumChipGroupFactor.volume:
|
||||
return AIcons.removableStorage;
|
||||
case AlbumChipGroupFactor.none:
|
||||
return AIcons.clear;
|
||||
}
|
||||
return switch (this) {
|
||||
AlbumChipGroupFactor.importance => AIcons.important,
|
||||
AlbumChipGroupFactor.mimeType => AIcons.mimeType,
|
||||
AlbumChipGroupFactor.volume => AIcons.removableStorage,
|
||||
AlbumChipGroupFactor.none => AIcons.clear,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,24 +6,18 @@ import 'package:flutter/widgets.dart';
|
|||
extension ExtraTileLayoutView on TileLayout {
|
||||
String getName(BuildContext context) {
|
||||
final l10n = context.l10n;
|
||||
switch (this) {
|
||||
case TileLayout.mosaic:
|
||||
return l10n.tileLayoutMosaic;
|
||||
case TileLayout.grid:
|
||||
return l10n.tileLayoutGrid;
|
||||
case TileLayout.list:
|
||||
return l10n.tileLayoutList;
|
||||
}
|
||||
return switch (this) {
|
||||
TileLayout.mosaic => l10n.tileLayoutMosaic,
|
||||
TileLayout.grid => l10n.tileLayoutGrid,
|
||||
TileLayout.list => l10n.tileLayoutList,
|
||||
};
|
||||
}
|
||||
|
||||
IconData get icon {
|
||||
switch (this) {
|
||||
case TileLayout.mosaic:
|
||||
return AIcons.layoutMosaic;
|
||||
case TileLayout.grid:
|
||||
return AIcons.layoutGrid;
|
||||
case TileLayout.list:
|
||||
return AIcons.layoutList;
|
||||
}
|
||||
return switch (this) {
|
||||
TileLayout.mosaic => AIcons.layoutMosaic,
|
||||
TileLayout.grid => AIcons.layoutGrid,
|
||||
TileLayout.list => AIcons.layoutList,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,84 +6,60 @@ import 'package:flutter/widgets.dart';
|
|||
extension ExtraEntrySortFactorView on EntrySortFactor {
|
||||
String getName(BuildContext context) {
|
||||
final l10n = context.l10n;
|
||||
switch (this) {
|
||||
case EntrySortFactor.date:
|
||||
return l10n.sortByDate;
|
||||
case EntrySortFactor.name:
|
||||
return l10n.sortByAlbumFileName;
|
||||
case EntrySortFactor.rating:
|
||||
return l10n.sortByRating;
|
||||
case EntrySortFactor.size:
|
||||
return l10n.sortBySize;
|
||||
}
|
||||
return switch (this) {
|
||||
EntrySortFactor.date => l10n.sortByDate,
|
||||
EntrySortFactor.name => l10n.sortByAlbumFileName,
|
||||
EntrySortFactor.rating => l10n.sortByRating,
|
||||
EntrySortFactor.size => l10n.sortBySize,
|
||||
};
|
||||
}
|
||||
|
||||
IconData get icon {
|
||||
switch (this) {
|
||||
case EntrySortFactor.date:
|
||||
return AIcons.date;
|
||||
case EntrySortFactor.name:
|
||||
return AIcons.name;
|
||||
case EntrySortFactor.rating:
|
||||
return AIcons.rating;
|
||||
case EntrySortFactor.size:
|
||||
return AIcons.size;
|
||||
}
|
||||
return switch (this) {
|
||||
EntrySortFactor.date => AIcons.date,
|
||||
EntrySortFactor.name => AIcons.name,
|
||||
EntrySortFactor.rating => AIcons.rating,
|
||||
EntrySortFactor.size => AIcons.size,
|
||||
};
|
||||
}
|
||||
|
||||
String getOrderName(BuildContext context, bool reverse) {
|
||||
final l10n = context.l10n;
|
||||
switch (this) {
|
||||
case EntrySortFactor.date:
|
||||
return reverse ? l10n.sortOrderOldestFirst : l10n.sortOrderNewestFirst;
|
||||
case EntrySortFactor.name:
|
||||
return reverse ? l10n.sortOrderZtoA : l10n.sortOrderAtoZ;
|
||||
case EntrySortFactor.rating:
|
||||
return reverse ? l10n.sortOrderLowestFirst : l10n.sortOrderHighestFirst;
|
||||
case EntrySortFactor.size:
|
||||
return reverse ? l10n.sortOrderSmallestFirst : l10n.sortOrderLargestFirst;
|
||||
}
|
||||
return switch (this) {
|
||||
EntrySortFactor.date => reverse ? l10n.sortOrderOldestFirst : l10n.sortOrderNewestFirst,
|
||||
EntrySortFactor.name => reverse ? l10n.sortOrderZtoA : l10n.sortOrderAtoZ,
|
||||
EntrySortFactor.rating => reverse ? l10n.sortOrderLowestFirst : l10n.sortOrderHighestFirst,
|
||||
EntrySortFactor.size => reverse ? l10n.sortOrderSmallestFirst : l10n.sortOrderLargestFirst,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
extension ExtraChipSortFactorView on ChipSortFactor {
|
||||
String getName(BuildContext context) {
|
||||
final l10n = context.l10n;
|
||||
switch (this) {
|
||||
case ChipSortFactor.date:
|
||||
return l10n.sortByDate;
|
||||
case ChipSortFactor.name:
|
||||
return l10n.sortByName;
|
||||
case ChipSortFactor.count:
|
||||
return l10n.sortByItemCount;
|
||||
case ChipSortFactor.size:
|
||||
return l10n.sortBySize;
|
||||
}
|
||||
return switch (this) {
|
||||
ChipSortFactor.date => l10n.sortByDate,
|
||||
ChipSortFactor.name => l10n.sortByName,
|
||||
ChipSortFactor.count => l10n.sortByItemCount,
|
||||
ChipSortFactor.size => l10n.sortBySize,
|
||||
};
|
||||
}
|
||||
|
||||
IconData get icon {
|
||||
switch (this) {
|
||||
case ChipSortFactor.date:
|
||||
return AIcons.date;
|
||||
case ChipSortFactor.name:
|
||||
return AIcons.name;
|
||||
case ChipSortFactor.count:
|
||||
return AIcons.count;
|
||||
case ChipSortFactor.size:
|
||||
return AIcons.size;
|
||||
}
|
||||
return switch (this) {
|
||||
ChipSortFactor.date => AIcons.date,
|
||||
ChipSortFactor.name => AIcons.name,
|
||||
ChipSortFactor.count => AIcons.count,
|
||||
ChipSortFactor.size => AIcons.size,
|
||||
};
|
||||
}
|
||||
|
||||
String getOrderName(BuildContext context, bool reverse) {
|
||||
final l10n = context.l10n;
|
||||
switch (this) {
|
||||
case ChipSortFactor.date:
|
||||
return reverse ? l10n.sortOrderOldestFirst : l10n.sortOrderNewestFirst;
|
||||
case ChipSortFactor.name:
|
||||
return reverse ? l10n.sortOrderZtoA : l10n.sortOrderAtoZ;
|
||||
case ChipSortFactor.count:
|
||||
case ChipSortFactor.size:
|
||||
return reverse ? l10n.sortOrderSmallestFirst : l10n.sortOrderLargestFirst;
|
||||
}
|
||||
return switch (this) {
|
||||
ChipSortFactor.date => reverse ? l10n.sortOrderOldestFirst : l10n.sortOrderNewestFirst,
|
||||
ChipSortFactor.name => reverse ? l10n.sortOrderZtoA : l10n.sortOrderAtoZ,
|
||||
ChipSortFactor.count || ChipSortFactor.size => reverse ? l10n.sortOrderSmallestFirst : l10n.sortOrderLargestFirst,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,13 +4,11 @@ import 'package:flutter/widgets.dart';
|
|||
|
||||
extension ExtraWallpaperTargetView on WallpaperTarget {
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case WallpaperTarget.home:
|
||||
return context.l10n.wallpaperTargetHome;
|
||||
case WallpaperTarget.lock:
|
||||
return context.l10n.wallpaperTargetLock;
|
||||
case WallpaperTarget.homeLock:
|
||||
return context.l10n.wallpaperTargetHomeLock;
|
||||
}
|
||||
final l10n = context.l10n;
|
||||
return switch (this) {
|
||||
WallpaperTarget.home => l10n.wallpaperTargetHome,
|
||||
WallpaperTarget.lock => l10n.wallpaperTargetLock,
|
||||
WallpaperTarget.homeLock => l10n.wallpaperTargetHomeLock,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ class BlurredRRect extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ClipRRect(
|
||||
borderRadius: borderRadius,
|
||||
borderRadius: borderRadius ?? BorderRadius.zero,
|
||||
child: BackdropFilter(
|
||||
// do not modify tree when disabling filter
|
||||
filter: enabled ? _filter : _identity,
|
||||
|
|
|
@ -81,14 +81,18 @@ class _ImageHistogramState extends State<ImageHistogram> {
|
|||
final data = (await image.toByteData(format: ImageByteFormat.rawExtendedRgba128))!;
|
||||
final floats = Float32List.view(data.buffer);
|
||||
|
||||
// TODO TLAD [histo] compute in isolate?
|
||||
// TODO TLAD [histo] save/reuse levels in view controller
|
||||
final newLevels = switch (settings.overlayHistogramStyle) {
|
||||
OverlayHistogramStyle.rgb => _computeRgbLevels(floats),
|
||||
OverlayHistogramStyle.luminance => _computeLuminanceLevels(floats),
|
||||
_ => <Color, List<double>>{},
|
||||
};
|
||||
|
||||
if (mounted) {
|
||||
setState(() => _levels = newLevels);
|
||||
}
|
||||
}
|
||||
|
||||
Map<Color, List<double>> _computeRgbLevels(Float32List floats) {
|
||||
final redLevels = List.filled(bins, 0);
|
||||
|
|
|
@ -85,7 +85,7 @@ class SubtitleStyle extends Equatable with Diagnosticable {
|
|||
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
||||
super.debugFillProperties(properties);
|
||||
properties.add(EnumProperty<TextAlign>('hAlign', hAlign));
|
||||
properties.add(EnumProperty<TextAlignVertical>('vAlign', vAlign));
|
||||
properties.add(DiagnosticsProperty<TextAlignVertical>('vAlign', vAlign));
|
||||
properties.add(ColorProperty('borderColor', borderColor));
|
||||
properties.add(DoubleProperty('borderWidth', borderWidth));
|
||||
properties.add(DoubleProperty('edgeBlur', edgeBlur));
|
||||
|
|
Loading…
Reference in a new issue