minor fixes
This commit is contained in:
parent
e2f9377045
commit
bfe2b4d319
4 changed files with 111 additions and 87 deletions
|
@ -6,6 +6,7 @@ import 'package:aves/widgets/album/filtered_collection_page.dart';
|
|||
import 'package:aves/widgets/common/icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class AllCollectionDrawer extends StatelessWidget {
|
||||
final ImageCollection collection;
|
||||
|
@ -17,8 +18,10 @@ class AllCollectionDrawer extends StatelessWidget {
|
|||
final albums = collection.sortedAlbums;
|
||||
final tags = collection.sortedTags;
|
||||
return Drawer(
|
||||
child: ListView(
|
||||
padding: EdgeInsets.only(bottom: window.viewInsets.bottom),
|
||||
child: Selector<MediaQueryData, double>(
|
||||
selector: (c, mq) => mq.viewInsets.bottom,
|
||||
builder: (c, mqViewInsetsBottom, child) => ListView(
|
||||
padding: EdgeInsets.only(bottom: mqViewInsetsBottom),
|
||||
children: [
|
||||
DrawerHeader(
|
||||
decoration: BoxDecoration(
|
||||
|
@ -81,32 +84,48 @@ class AllCollectionDrawer extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
_buildFilteredCollectionNavTile(
|
||||
context: context,
|
||||
_FilteredCollectionNavTile(
|
||||
collection: collection,
|
||||
leading: Icon(Icons.video_library),
|
||||
title: 'Videos',
|
||||
filter: (entry) => entry.isVideo,
|
||||
),
|
||||
const Divider(),
|
||||
...albums.map((album) => _buildFilteredCollectionNavTile(
|
||||
context: context,
|
||||
...albums.map((album) => _FilteredCollectionNavTile(
|
||||
collection: collection,
|
||||
leading: IconUtils.getAlbumIcon(context, album) ?? Icon(Icons.photo_album),
|
||||
title: collection.getUniqueAlbumName(album, albums),
|
||||
filter: (entry) => entry.directory == album,
|
||||
)),
|
||||
const Divider(),
|
||||
...tags.map((tag) => _buildFilteredCollectionNavTile(
|
||||
context: context,
|
||||
...tags.map((tag) => _FilteredCollectionNavTile(
|
||||
collection: collection,
|
||||
leading: Icon(Icons.label),
|
||||
title: tag,
|
||||
filter: (entry) => entry.xmpSubjects.contains(tag),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildFilteredCollectionNavTile({BuildContext context, Widget leading, String title, bool Function(ImageEntry) filter}) {
|
||||
class _FilteredCollectionNavTile extends StatelessWidget {
|
||||
final ImageCollection collection;
|
||||
final Widget leading;
|
||||
final String title;
|
||||
final bool Function(ImageEntry) filter;
|
||||
|
||||
const _FilteredCollectionNavTile({
|
||||
@required this.collection,
|
||||
@required this.leading,
|
||||
@required this.title,
|
||||
@required this.filter,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SafeArea(
|
||||
top: false,
|
||||
bottom: false,
|
||||
|
|
|
@ -6,6 +6,7 @@ import 'package:aves/utils/android_file_utils.dart';
|
|||
import 'package:aves/widgets/common/app_icon.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:path/path.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class VideoIcon extends StatelessWidget {
|
||||
final ImageEntry entry;
|
||||
|
@ -103,10 +104,13 @@ class IconUtils {
|
|||
final parts = albumDirectory.split(separator);
|
||||
if (albumDirectory.startsWith(androidFileUtils.externalStorage) && appNameMap.keys.contains(parts.last)) {
|
||||
final packageName = appNameMap[parts.last];
|
||||
return AppIcon(
|
||||
return Selector<MediaQueryData, double>(
|
||||
selector: (c, mq) => mq.devicePixelRatio,
|
||||
builder: (c, devicePixelRatio, child) => AppIcon(
|
||||
packageName: packageName,
|
||||
size: IconTheme.of(context).size,
|
||||
devicePixelRatio: window.devicePixelRatio,
|
||||
devicePixelRatio: devicePixelRatio,
|
||||
),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -43,9 +43,9 @@ class MetadataSectionState extends State<MetadataSection> {
|
|||
builder: (c, mqWidth, child) => FutureBuilder(
|
||||
future: _metadataLoader,
|
||||
builder: (futureContext, AsyncSnapshot<Map> snapshot) {
|
||||
final metadataMap = snapshot.data.cast<String, Map>();
|
||||
if (snapshot.hasError) return Text(snapshot.error.toString());
|
||||
if (snapshot.connectionState != ConnectionState.done) return const SizedBox.shrink();
|
||||
final metadataMap = snapshot.data.cast<String, Map>();
|
||||
final directoryNames = metadataMap.keys.toList()..sort();
|
||||
|
||||
Widget content;
|
||||
|
|
|
@ -133,7 +133,8 @@ class _FullscreenBottomOverlayContent extends StatelessWidget {
|
|||
)
|
||||
],
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
softWrap: false,
|
||||
overflow: TextOverflow.fade,
|
||||
maxLines: 1,
|
||||
child: Selector<MediaQueryData, Orientation>(
|
||||
selector: (c, mq) => mq.orientation,
|
||||
|
|
Loading…
Reference in a new issue