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