fixed some lint issues (effective dart style)
This commit is contained in:
parent
2ed7851d7d
commit
a48937795e
31 changed files with 61 additions and 67 deletions
|
@ -34,7 +34,7 @@ class MimeFilter extends CollectionFilter {
|
||||||
_label ??= lowMime.split('/')[0].toUpperCase();
|
_label ??= lowMime.split('/')[0].toUpperCase();
|
||||||
} else {
|
} else {
|
||||||
_filter = (entry) => entry.mimeType == lowMime;
|
_filter = (entry) => entry.mimeType == lowMime;
|
||||||
if (lowMime == MimeTypes.SVG) {
|
if (lowMime == MimeTypes.svg) {
|
||||||
_label = 'SVG';
|
_label = 'SVG';
|
||||||
}
|
}
|
||||||
_label ??= lowMime.split('/')[1].toUpperCase();
|
_label ??= lowMime.split('/')[1].toUpperCase();
|
||||||
|
|
|
@ -8,7 +8,7 @@ import 'package:flutter/widgets.dart';
|
||||||
class QueryFilter extends CollectionFilter {
|
class QueryFilter extends CollectionFilter {
|
||||||
static const type = 'query';
|
static const type = 'query';
|
||||||
|
|
||||||
static final exactRegex = RegExp('^"(.*)"\$');
|
static final RegExp exactRegex = RegExp('^"(.*)"\$');
|
||||||
|
|
||||||
final String query;
|
final String query;
|
||||||
final bool colorful;
|
final bool colorful;
|
||||||
|
@ -39,7 +39,7 @@ class QueryFilter extends CollectionFilter {
|
||||||
bool get isUnique => false;
|
bool get isUnique => false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get label => '${query}';
|
String get label => '$query';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget iconBuilder(BuildContext context, double size, {bool showGenericIcon = true}) => Icon(AIcons.text, size: size);
|
Widget iconBuilder(BuildContext context, double size, {bool showGenericIcon = true}) => Icon(AIcons.text, size: size);
|
||||||
|
|
|
@ -152,10 +152,10 @@ class ImageEntry {
|
||||||
|
|
||||||
bool get isFavourite => favourites.isFavourite(this);
|
bool get isFavourite => favourites.isFavourite(this);
|
||||||
|
|
||||||
bool get isSvg => mimeType == MimeTypes.SVG;
|
bool get isSvg => mimeType == MimeTypes.svg;
|
||||||
|
|
||||||
// guess whether this is a photo, according to file type (used as a hint to e.g. display megapixels)
|
// guess whether this is a photo, according to file type (used as a hint to e.g. display megapixels)
|
||||||
bool get isPhoto => [MimeTypes.HEIC, MimeTypes.HEIF, MimeTypes.JPEG].contains(mimeType);
|
bool get isPhoto => [MimeTypes.heic, MimeTypes.heif, MimeTypes.jpeg].contains(mimeType);
|
||||||
|
|
||||||
bool get isVideo => mimeType.startsWith('video');
|
bool get isVideo => mimeType.startsWith('video');
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@ class ImageEntry {
|
||||||
|
|
||||||
bool get canPrint => !isVideo;
|
bool get canPrint => !isVideo;
|
||||||
|
|
||||||
bool get canRotate => canEdit && (mimeType == MimeTypes.JPEG || mimeType == MimeTypes.PNG);
|
bool get canRotate => canEdit && (mimeType == MimeTypes.jpeg || mimeType == MimeTypes.png);
|
||||||
|
|
||||||
bool get rotated => ((isVideo && isCatalogued) ? _catalogMetadata.videoRotation : orientationDegrees) % 180 == 90;
|
bool get rotated => ((isVideo && isCatalogued) ? _catalogMetadata.videoRotation : orientationDegrees) % 180 == 90;
|
||||||
|
|
||||||
|
@ -270,7 +270,7 @@ class ImageEntry {
|
||||||
|
|
||||||
final coordinates = Coordinates(latitude, longitude);
|
final coordinates = Coordinates(latitude, longitude);
|
||||||
try {
|
try {
|
||||||
final call = () => Geocoder.local.findAddressesFromCoordinates(coordinates);
|
Future<List<Address>> call() => Geocoder.local.findAddressesFromCoordinates(coordinates);
|
||||||
final addresses = await (background
|
final addresses = await (background
|
||||||
? servicePolicy.call(
|
? servicePolicy.call(
|
||||||
call,
|
call,
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
class MimeTypes {
|
class MimeTypes {
|
||||||
static const String ANY_IMAGE = 'image/*';
|
static const String anyImage = 'image/*';
|
||||||
static const String GIF = 'image/gif';
|
static const String gif = 'image/gif';
|
||||||
static const String HEIC = 'image/heic';
|
static const String heic = 'image/heic';
|
||||||
static const String HEIF = 'image/heif';
|
static const String heif = 'image/heif';
|
||||||
static const String JPEG = 'image/jpeg';
|
static const String jpeg = 'image/jpeg';
|
||||||
static const String PNG = 'image/png';
|
static const String png = 'image/png';
|
||||||
static const String SVG = 'image/svg+xml';
|
static const String svg = 'image/svg+xml';
|
||||||
static const String WEBP = 'image/webp';
|
static const String webp = 'image/webp';
|
||||||
|
|
||||||
static const String ANY_VIDEO = 'video/*';
|
static const String anyVideo = 'video/*';
|
||||||
static const String AVI = 'video/avi';
|
static const String avi = 'video/avi';
|
||||||
static const String MP2T = 'video/mp2t'; // .m2ts
|
static const String mp2t = 'video/mp2t'; // .m2ts
|
||||||
static const String MP4 = 'video/mp4';
|
static const String mp4 = 'video/mp4';
|
||||||
}
|
}
|
||||||
|
|
|
@ -168,8 +168,8 @@ class CollectionLens with ChangeNotifier, CollectionActivityMixin, CollectionSel
|
||||||
]);
|
]);
|
||||||
break;
|
break;
|
||||||
case SortFactor.name:
|
case SortFactor.name:
|
||||||
final byAlbum = groupBy(_filteredEntries, (ImageEntry entry) => entry.directory);
|
final byAlbum = groupBy(_filteredEntries, (entry) => entry.directory);
|
||||||
final compare = (a, b) {
|
int compare(a, b) {
|
||||||
final ua = source.getUniqueAlbumName(a);
|
final ua = source.getUniqueAlbumName(a);
|
||||||
final ub = source.getUniqueAlbumName(b);
|
final ub = source.getUniqueAlbumName(b);
|
||||||
final c = compareAsciiUpperCase(ua, ub);
|
final c = compareAsciiUpperCase(ua, ub);
|
||||||
|
|
|
@ -75,7 +75,7 @@ mixin LocationMixin on SourceBase {
|
||||||
|
|
||||||
void updateLocations() {
|
void updateLocations() {
|
||||||
final locations = rawEntries.where((entry) => entry.isLocated).map((entry) => entry.addressDetails).toList();
|
final locations = rawEntries.where((entry) => entry.isLocated).map((entry) => entry.addressDetails).toList();
|
||||||
final lister = (String Function(AddressDetails a) f) => List<String>.unmodifiable(locations.map(f).where((s) => s != null && s.isNotEmpty).toSet().toList()..sort(compareAsciiUpperCase));
|
List<String> lister(String Function(AddressDetails a) f) => List<String>.unmodifiable(locations.map(f).where((s) => s != null && s.isNotEmpty).toSet().toList()..sort(compareAsciiUpperCase));
|
||||||
sortedCountries = lister((address) => '${address.countryName};${address.countryCode}');
|
sortedCountries = lister((address) => '${address.countryName};${address.countryCode}');
|
||||||
sortedPlaces = lister((address) => address.place);
|
sortedPlaces = lister((address) => address.place);
|
||||||
|
|
||||||
|
|
|
@ -140,7 +140,7 @@ class ImageFileService {
|
||||||
try {
|
try {
|
||||||
return opChannel.receiveBroadcastStream(<String, dynamic>{
|
return opChannel.receiveBroadcastStream(<String, dynamic>{
|
||||||
'op': 'delete',
|
'op': 'delete',
|
||||||
'entries': entries.map((entry) => _toPlatformEntryMap(entry)).toList(),
|
'entries': entries.map(_toPlatformEntryMap).toList(),
|
||||||
}).map((event) => ImageOpEvent.fromMap(event));
|
}).map((event) => ImageOpEvent.fromMap(event));
|
||||||
} on PlatformException catch (e) {
|
} on PlatformException catch (e) {
|
||||||
debugPrint('delete failed with code=${e.code}, exception=${e.message}, details=${e.details}');
|
debugPrint('delete failed with code=${e.code}, exception=${e.message}, details=${e.details}');
|
||||||
|
@ -153,7 +153,7 @@ class ImageFileService {
|
||||||
try {
|
try {
|
||||||
return opChannel.receiveBroadcastStream(<String, dynamic>{
|
return opChannel.receiveBroadcastStream(<String, dynamic>{
|
||||||
'op': 'move',
|
'op': 'move',
|
||||||
'entries': entries.map((entry) => _toPlatformEntryMap(entry)).toList(),
|
'entries': entries.map(_toPlatformEntryMap).toList(),
|
||||||
'copy': copy,
|
'copy': copy,
|
||||||
'destinationPath': destinationAlbum,
|
'destinationPath': destinationAlbum,
|
||||||
}).map((event) => MoveOpEvent.fromMap(event));
|
}).map((event) => MoveOpEvent.fromMap(event));
|
||||||
|
|
|
@ -26,7 +26,7 @@ class MetadataService {
|
||||||
static Future<CatalogMetadata> getCatalogMetadata(ImageEntry entry, {bool background = false}) async {
|
static Future<CatalogMetadata> getCatalogMetadata(ImageEntry entry, {bool background = false}) async {
|
||||||
if (entry.isSvg) return null;
|
if (entry.isSvg) return null;
|
||||||
|
|
||||||
final call = () async {
|
Future<CatalogMetadata> call() async {
|
||||||
try {
|
try {
|
||||||
// return map with:
|
// return map with:
|
||||||
// 'mimeType': MIME type as reported by metadata extractors, not Media Store (string)
|
// 'mimeType': MIME type as reported by metadata extractors, not Media Store (string)
|
||||||
|
|
|
@ -30,5 +30,5 @@ class Durations {
|
||||||
static const collectionScrollMonitoringTimerDelay = Duration(milliseconds: 100);
|
static const collectionScrollMonitoringTimerDelay = Duration(milliseconds: 100);
|
||||||
static const collectionScalingCompleteNotificationDelay = Duration(milliseconds: 300);
|
static const collectionScalingCompleteNotificationDelay = Duration(milliseconds: 300);
|
||||||
static const videoProgressTimerInterval = Duration(milliseconds: 300);
|
static const videoProgressTimerInterval = Duration(milliseconds: 300);
|
||||||
static var staggeredAnimationDelay = Durations.staggeredAnimation ~/ 6 * timeDilation;
|
static Duration staggeredAnimationDelay = Durations.staggeredAnimation ~/ 6 * timeDilation;
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,7 @@ class _CollectionAppBarState extends State<CollectionAppBar> with SingleTickerPr
|
||||||
animation: collection.selectionChangeNotifier,
|
animation: collection.selectionChangeNotifier,
|
||||||
builder: (context, child) {
|
builder: (context, child) {
|
||||||
final count = collection.selection.length;
|
final count = collection.selection.length;
|
||||||
return Text(Intl.plural(count, zero: 'Select items', one: '${count} item', other: '${count} items'));
|
return Text(Intl.plural(count, zero: 'Select items', one: '$count item', other: '$count items'));
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ class _GridScaleGestureDetectorState extends State<GridScaleGestureDetector> {
|
||||||
scrollableBox.hitTest(result, position: details.localFocalPoint);
|
scrollableBox.hitTest(result, position: details.localFocalPoint);
|
||||||
|
|
||||||
// find `RenderObject`s at the gesture focal point
|
// find `RenderObject`s at the gesture focal point
|
||||||
final firstOf = <T>(BoxHitTestResult result) => result.path.firstWhere((el) => el.target is T, orElse: () => null)?.target as T;
|
T firstOf<T>(BoxHitTestResult result) => result.path.firstWhere((el) => el.target is T, orElse: () => null)?.target as T;
|
||||||
final renderMetaData = firstOf<RenderMetaData>(result);
|
final renderMetaData = firstOf<RenderMetaData>(result);
|
||||||
// abort if we cannot find an image to show on overlay
|
// abort if we cannot find an image to show on overlay
|
||||||
if (renderMetaData == null) return;
|
if (renderMetaData == null) return;
|
||||||
|
|
|
@ -57,7 +57,7 @@ class ImageSearchDelegate extends SearchDelegate<CollectionFilter> {
|
||||||
@override
|
@override
|
||||||
Widget buildSuggestions(BuildContext context) {
|
Widget buildSuggestions(BuildContext context) {
|
||||||
final upQuery = query.trim().toUpperCase();
|
final upQuery = query.trim().toUpperCase();
|
||||||
final containQuery = (String s) => s.toUpperCase().contains(upQuery);
|
bool containQuery(String s) => s.toUpperCase().contains(upQuery);
|
||||||
return SafeArea(
|
return SafeArea(
|
||||||
child: ValueListenableBuilder<String>(
|
child: ValueListenableBuilder<String>(
|
||||||
valueListenable: expandedSectionNotifier,
|
valueListenable: expandedSectionNotifier,
|
||||||
|
@ -70,10 +70,10 @@ class ImageSearchDelegate extends SearchDelegate<CollectionFilter> {
|
||||||
filters: [
|
filters: [
|
||||||
_buildQueryFilter(false),
|
_buildQueryFilter(false),
|
||||||
FavouriteFilter(),
|
FavouriteFilter(),
|
||||||
MimeFilter(MimeTypes.ANY_IMAGE),
|
MimeFilter(MimeTypes.anyImage),
|
||||||
MimeFilter(MimeTypes.ANY_VIDEO),
|
MimeFilter(MimeTypes.anyVideo),
|
||||||
MimeFilter(MimeFilter.animated),
|
MimeFilter(MimeFilter.animated),
|
||||||
MimeFilter(MimeTypes.SVG),
|
MimeFilter(MimeTypes.svg),
|
||||||
].where((f) => f != null && containQuery(f.label)),
|
].where((f) => f != null && containQuery(f.label)),
|
||||||
),
|
),
|
||||||
StreamBuilder(
|
StreamBuilder(
|
||||||
|
|
|
@ -220,7 +220,7 @@ class _CollectionScrollViewState extends State<CollectionScrollView> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
debugPrint('collection.filters=${collection.filters}');
|
debugPrint('collection.filters=${collection.filters}');
|
||||||
if (collection.filters.any((filter) => filter is MimeFilter && filter.mime == MimeTypes.ANY_VIDEO)) {
|
if (collection.filters.any((filter) => filter is MimeFilter && filter.mime == MimeTypes.anyVideo)) {
|
||||||
return const EmptyContent(
|
return const EmptyContent(
|
||||||
icon: AIcons.video,
|
icon: AIcons.video,
|
||||||
text: 'No videos',
|
text: 'No videos',
|
||||||
|
|
|
@ -85,7 +85,7 @@ class _AppDrawerState extends State<AppDrawer> {
|
||||||
source: source,
|
source: source,
|
||||||
leading: const Icon(AIcons.video),
|
leading: const Icon(AIcons.video),
|
||||||
title: 'Videos',
|
title: 'Videos',
|
||||||
filter: MimeFilter(MimeTypes.ANY_VIDEO),
|
filter: MimeFilter(MimeTypes.anyVideo),
|
||||||
);
|
);
|
||||||
final favouriteEntry = _FilteredCollectionNavTile(
|
final favouriteEntry = _FilteredCollectionNavTile(
|
||||||
source: source,
|
source: source,
|
||||||
|
|
|
@ -118,7 +118,7 @@ class EntryActionDelegate with FeedbackMixin, PermissionAwareMixin {
|
||||||
Future<void> _showDeleteDialog(BuildContext context, ImageEntry entry) async {
|
Future<void> _showDeleteDialog(BuildContext context, ImageEntry entry) async {
|
||||||
final confirmed = await showDialog<bool>(
|
final confirmed = await showDialog<bool>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
content: const Text('Are you sure?'),
|
content: const Text('Are you sure?'),
|
||||||
actions: [
|
actions: [
|
||||||
|
|
|
@ -21,7 +21,7 @@ mixin PermissionAwareMixin {
|
||||||
|
|
||||||
final confirmed = await showDialog<bool>(
|
final confirmed = await showDialog<bool>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: const Text('Storage Volume Access'),
|
title: const Text('Storage Volume Access'),
|
||||||
content: Text('Please select the $dirDisplayName directory of “$volumeDescription” in the next screen, so that this app can access it and complete your request.'),
|
content: Text('Please select the $dirDisplayName directory of “$volumeDescription” in the next screen, so that this app can access it and complete your request.'),
|
||||||
|
|
|
@ -116,10 +116,10 @@ class SelectionActionDelegate with FeedbackMixin, PermissionAwareMixin {
|
||||||
final selectionCount = selection.length;
|
final selectionCount = selection.length;
|
||||||
if (movedCount < selectionCount) {
|
if (movedCount < selectionCount) {
|
||||||
final count = selectionCount - movedCount;
|
final count = selectionCount - movedCount;
|
||||||
showFeedback(context, 'Failed to move ${Intl.plural(count, one: '${count} item', other: '${count} items')}');
|
showFeedback(context, 'Failed to move ${Intl.plural(count, one: '$count item', other: '$count items')}');
|
||||||
} else {
|
} else {
|
||||||
final count = movedCount;
|
final count = movedCount;
|
||||||
showFeedback(context, '${copy ? 'Copied' : 'Moved'} ${Intl.plural(count, one: '${count} item', other: '${count} items')}');
|
showFeedback(context, '${copy ? 'Copied' : 'Moved'} ${Intl.plural(count, one: '$count item', other: '$count items')}');
|
||||||
}
|
}
|
||||||
if (movedCount > 0) {
|
if (movedCount > 0) {
|
||||||
final fromAlbums = <String>{};
|
final fromAlbums = <String>{};
|
||||||
|
@ -187,9 +187,9 @@ class SelectionActionDelegate with FeedbackMixin, PermissionAwareMixin {
|
||||||
|
|
||||||
final confirmed = await showDialog<bool>(
|
final confirmed = await showDialog<bool>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
content: Text('Are you sure you want to delete ${Intl.plural(count, one: 'this item', other: 'these ${count} items')}?'),
|
content: Text('Are you sure you want to delete ${Intl.plural(count, one: 'this item', other: 'these $count items')}?'),
|
||||||
actions: [
|
actions: [
|
||||||
FlatButton(
|
FlatButton(
|
||||||
onPressed: () => Navigator.pop(context),
|
onPressed: () => Navigator.pop(context),
|
||||||
|
@ -217,7 +217,7 @@ class SelectionActionDelegate with FeedbackMixin, PermissionAwareMixin {
|
||||||
final selectionCount = selection.length;
|
final selectionCount = selection.length;
|
||||||
if (deletedCount < selectionCount) {
|
if (deletedCount < selectionCount) {
|
||||||
final count = selectionCount - deletedCount;
|
final count = selectionCount - deletedCount;
|
||||||
showFeedback(context, 'Failed to delete ${Intl.plural(count, one: '${count} item', other: '${count} items')}');
|
showFeedback(context, 'Failed to delete ${Intl.plural(count, one: '$count item', other: '$count items')}');
|
||||||
}
|
}
|
||||||
if (deletedCount > 0) {
|
if (deletedCount > 0) {
|
||||||
collection.source.removeEntries(selection.where((e) => deletedUris.contains(e.uri)));
|
collection.source.removeEntries(selection.where((e) => deletedUris.contains(e.uri)));
|
||||||
|
@ -242,9 +242,9 @@ class SelectionActionDelegate with FeedbackMixin, PermissionAwareMixin {
|
||||||
|
|
||||||
// do not handle completion inside `StreamBuilder`
|
// do not handle completion inside `StreamBuilder`
|
||||||
// as it could be called multiple times
|
// as it could be called multiple times
|
||||||
final onComplete = () => _hideOpReportOverlay().then((_) => onDone(processed));
|
Future<void> onComplete() => _hideOpReportOverlay().then((_) => onDone(processed));
|
||||||
opStream.listen(
|
opStream.listen(
|
||||||
(event) => processed.add(event),
|
processed.add,
|
||||||
onError: (error) {
|
onError: (error) {
|
||||||
debugPrint('_showOpReport error=$error');
|
debugPrint('_showOpReport error=$error');
|
||||||
onComplete();
|
onComplete();
|
||||||
|
|
|
@ -51,7 +51,7 @@ class MediaStoreSource extends CollectionSource {
|
||||||
var refreshCount = 10;
|
var refreshCount = 10;
|
||||||
const refreshCountMax = 1000;
|
const refreshCountMax = 1000;
|
||||||
final allNewEntries = <ImageEntry>[], pendingNewEntries = <ImageEntry>[];
|
final allNewEntries = <ImageEntry>[], pendingNewEntries = <ImageEntry>[];
|
||||||
final addPendingEntries = () {
|
void addPendingEntries() {
|
||||||
allNewEntries.addAll(pendingNewEntries);
|
allNewEntries.addAll(pendingNewEntries);
|
||||||
addAll(pendingNewEntries);
|
addAll(pendingNewEntries);
|
||||||
pendingNewEntries.clear();
|
pendingNewEntries.clear();
|
||||||
|
|
|
@ -54,7 +54,7 @@ class ThumbnailProvider extends ImageProvider<ThumbnailProviderKey> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void resolveStreamForKey(ImageConfiguration configuration, ImageStream stream, ThumbnailProviderKey key, handleError) {
|
void resolveStreamForKey(ImageConfiguration configuration, ImageStream stream, ThumbnailProviderKey key, ImageErrorListener handleError) {
|
||||||
ImageFileService.resumeThumbnail(_cancellationKey);
|
ImageFileService.resumeThumbnail(_cancellationKey);
|
||||||
super.resolveStreamForKey(configuration, stream, key, handleError);
|
super.resolveStreamForKey(configuration, stream, key, handleError);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,13 +32,7 @@ ScrollThumbBuilder avesScrollThumbBuilder({
|
||||||
clipper: ArrowClipper(),
|
clipper: ArrowClipper(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
return (
|
return (backgroundColor, thumbAnimation, labelAnimation, height, {labelText}) {
|
||||||
Color backgroundColor,
|
|
||||||
Animation<double> thumbAnimation,
|
|
||||||
Animation<double> labelAnimation,
|
|
||||||
double height, {
|
|
||||||
Widget labelText,
|
|
||||||
}) {
|
|
||||||
return DraggableScrollbar.buildScrollThumbAndLabel(
|
return DraggableScrollbar.buildScrollThumbAndLabel(
|
||||||
scrollThumb: scrollThumb,
|
scrollThumb: scrollThumb,
|
||||||
backgroundColor: backgroundColor,
|
backgroundColor: backgroundColor,
|
||||||
|
|
|
@ -12,7 +12,7 @@ class TransitionImage extends StatefulWidget {
|
||||||
final ImageProvider image;
|
final ImageProvider image;
|
||||||
final double width, height;
|
final double width, height;
|
||||||
final ValueListenable<double> animation;
|
final ValueListenable<double> animation;
|
||||||
final gaplessPlayback = false;
|
final bool gaplessPlayback = false;
|
||||||
|
|
||||||
const TransitionImage({
|
const TransitionImage({
|
||||||
@required this.image,
|
@required this.image,
|
||||||
|
|
|
@ -135,7 +135,7 @@ class DebugPageState extends State<DebugPage> {
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
RaisedButton(
|
RaisedButton(
|
||||||
onPressed: () => ImageFileService.clearSizedThumbnailDiskCache(),
|
onPressed: ImageFileService.clearSizedThumbnailDiskCache,
|
||||||
child: const Text('Clear'),
|
child: const Text('Clear'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
@ -61,7 +61,7 @@ class ImageView extends StatelessWidget {
|
||||||
// if the image is already in the cache it will show the final image, otherwise the thumbnail
|
// if the image is already in the cache it will show the final image, otherwise the thumbnail
|
||||||
// in any case, we should use `Center` + `AspectRatio` + `Fill` so that the transition image
|
// in any case, we should use `Center` + `AspectRatio` + `Fill` so that the transition image
|
||||||
// appears as the final image with `PhotoViewComputedScale.contained` for `initialScale`
|
// appears as the final image with `PhotoViewComputedScale.contained` for `initialScale`
|
||||||
final loadingBuilder = (BuildContext context, ImageProvider imageProvider) {
|
Widget loadingBuilder(BuildContext context, ImageProvider imageProvider) {
|
||||||
return Center(
|
return Center(
|
||||||
child: AspectRatio(
|
child: AspectRatio(
|
||||||
// enforce original aspect ratio, as some thumbnails aspect ratios slightly differ
|
// enforce original aspect ratio, as some thumbnails aspect ratios slightly differ
|
||||||
|
|
|
@ -53,7 +53,7 @@ class BasicSection extends StatelessWidget {
|
||||||
final tags = entry.xmpSubjects..sort(compareAsciiUpperCase);
|
final tags = entry.xmpSubjects..sort(compareAsciiUpperCase);
|
||||||
final album = entry.directory;
|
final album = entry.directory;
|
||||||
final filters = [
|
final filters = [
|
||||||
if (entry.isVideo) MimeFilter(MimeTypes.ANY_VIDEO),
|
if (entry.isVideo) MimeFilter(MimeTypes.anyVideo),
|
||||||
if (entry.isAnimated) MimeFilter(MimeFilter.animated),
|
if (entry.isAnimated) MimeFilter(MimeFilter.animated),
|
||||||
if (album != null) AlbumFilter(album, collection?.source?.getUniqueAlbumName(album)),
|
if (album != null) AlbumFilter(album, collection?.source?.getUniqueAlbumName(album)),
|
||||||
...tags.map((tag) => TagFilter(tag)),
|
...tags.map((tag) => TagFilter(tag)),
|
||||||
|
|
|
@ -165,7 +165,7 @@ class SectionRow extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
const dim = 32.0;
|
const dim = 32.0;
|
||||||
final buildDivider = () => const SizedBox(
|
Widget buildDivider() => const SizedBox(
|
||||||
width: dim,
|
width: dim,
|
||||||
child: Divider(
|
child: Divider(
|
||||||
thickness: AvesFilterChip.outlineWidth,
|
thickness: AvesFilterChip.outlineWidth,
|
||||||
|
|
|
@ -151,7 +151,7 @@ class _TopOverlayRow extends StatelessWidget {
|
||||||
|
|
||||||
Widget _buildOverlayButton(EntryAction action) {
|
Widget _buildOverlayButton(EntryAction action) {
|
||||||
Widget child;
|
Widget child;
|
||||||
final onPressed = () => onActionSelected?.call(action);
|
void onPressed() => onActionSelected?.call(action);
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case EntryAction.toggleFavourite:
|
case EntryAction.toggleFavourite:
|
||||||
child = _FavouriteToggler(
|
child = _FavouriteToggler(
|
||||||
|
|
|
@ -98,7 +98,7 @@ class VideoControlOverlayState extends State<VideoControlOverlay> with SingleTic
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final mq = context.select((MediaQueryData mq) => Tuple3(mq.size.width, mq.viewInsets, mq.viewPadding));
|
final mq = context.select((mq) => Tuple3(mq.size.width, mq.viewInsets, mq.viewPadding));
|
||||||
final mqWidth = mq.item1;
|
final mqWidth = mq.item1;
|
||||||
final mqViewInsets = mq.item2;
|
final mqViewInsets = mq.item2;
|
||||||
final mqViewPadding = mq.item3;
|
final mqViewPadding = mq.item3;
|
||||||
|
@ -164,17 +164,17 @@ class VideoControlOverlayState extends State<VideoControlOverlay> with SingleTic
|
||||||
child: BlurredRRect(
|
child: BlurredRRect(
|
||||||
borderRadius: progressBarBorderRadius,
|
borderRadius: progressBarBorderRadius,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTapDown: (TapDownDetails details) {
|
onTapDown: (details) {
|
||||||
_seekFromTap(details.globalPosition);
|
_seekFromTap(details.globalPosition);
|
||||||
},
|
},
|
||||||
onHorizontalDragStart: (DragStartDetails details) {
|
onHorizontalDragStart: (details) {
|
||||||
_playingOnDragStart = isPlaying;
|
_playingOnDragStart = isPlaying;
|
||||||
if (_playingOnDragStart) controller.pause();
|
if (_playingOnDragStart) controller.pause();
|
||||||
},
|
},
|
||||||
onHorizontalDragUpdate: (DragUpdateDetails details) {
|
onHorizontalDragUpdate: (details) {
|
||||||
_seekFromTap(details.globalPosition);
|
_seekFromTap(details.globalPosition);
|
||||||
},
|
},
|
||||||
onHorizontalDragEnd: (DragEndDetails details) {
|
onHorizontalDragEnd: (details) {
|
||||||
if (_playingOnDragStart) controller.play();
|
if (_playingOnDragStart) controller.play();
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
|
|
|
@ -68,7 +68,7 @@ class _HomePageState extends State<HomePage> {
|
||||||
// TODO TLAD apply pick mimetype(s)
|
// TODO TLAD apply pick mimetype(s)
|
||||||
// some apps define multiple types, separated by a space (maybe other signs too, like `,` `;`?)
|
// some apps define multiple types, separated by a space (maybe other signs too, like `,` `;`?)
|
||||||
String pickMimeTypes = intentData['mimeType'];
|
String pickMimeTypes = intentData['mimeType'];
|
||||||
debugPrint('pick mimeType=' + pickMimeTypes);
|
debugPrint('pick mimeType=$pickMimeTypes');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ class FilterTable extends StatelessWidget {
|
||||||
center: Text(NumberFormat.percentPattern().format(percent)),
|
center: Text(NumberFormat.percentPattern().format(percent)),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'${count}',
|
'$count',
|
||||||
style: const TextStyle(color: Colors.white70),
|
style: const TextStyle(color: Colors.white70),
|
||||||
textAlign: TextAlign.end,
|
textAlign: TextAlign.end,
|
||||||
),
|
),
|
||||||
|
|
|
@ -158,7 +158,7 @@ class StatsPage extends StatelessWidget {
|
||||||
),
|
),
|
||||||
Center(
|
Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
'${sum}\n${label(sum)}',
|
'$sum\n${label(sum)}',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -35,7 +35,7 @@ class _WelcomePageState extends State<WelcomePage> {
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
child: FutureBuilder(
|
child: FutureBuilder(
|
||||||
future: _termsLoader,
|
future: _termsLoader,
|
||||||
builder: (BuildContext context, AsyncSnapshot<String> snapshot) {
|
builder: (context, AsyncSnapshot<String> snapshot) {
|
||||||
if (snapshot.hasError || snapshot.connectionState != ConnectionState.done) return const SizedBox.shrink();
|
if (snapshot.hasError || snapshot.connectionState != ConnectionState.done) return const SizedBox.shrink();
|
||||||
final terms = snapshot.data;
|
final terms = snapshot.data;
|
||||||
return Column(
|
return Column(
|
||||||
|
|
Loading…
Reference in a new issue