thumbnail overlay icon fixes
This commit is contained in:
parent
fb9f297b4b
commit
ab3140a66f
2 changed files with 24 additions and 8 deletions
|
@ -19,7 +19,7 @@ class ThumbnailEntryOverlay extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final fontSize = min(14.0, (extent / 8));
|
final fontSize = min(14.0, (extent / 8)).roundToDouble();
|
||||||
final iconSize = fontSize * 2;
|
final iconSize = fontSize * 2;
|
||||||
return Column(
|
return Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
@ -56,7 +56,7 @@ class ThumbnailSelectionOverlay extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final fontSize = min(14.0, (extent / 8));
|
final fontSize = min(14.0, (extent / 8)).roundToDouble();
|
||||||
final iconSize = fontSize * 2;
|
final iconSize = fontSize * 2;
|
||||||
final collection = Provider.of<CollectionLens>(context);
|
final collection = Provider.of<CollectionLens>(context);
|
||||||
return ValueListenableBuilder<Activity>(
|
return ValueListenableBuilder<Activity>(
|
||||||
|
@ -66,10 +66,22 @@ class ThumbnailSelectionOverlay extends StatelessWidget {
|
||||||
? AnimatedBuilder(
|
? AnimatedBuilder(
|
||||||
animation: collection.selectionChangeNotifier,
|
animation: collection.selectionChangeNotifier,
|
||||||
builder: (context, child) {
|
builder: (context, child) {
|
||||||
return OverlayIcon(
|
final selected = collection.selection.contains(entry);
|
||||||
icon: collection.selection.contains(entry) ? Icons.check_circle_outline : Icons.radio_button_unchecked,
|
final child = OverlayIcon(
|
||||||
|
key: ValueKey(selected),
|
||||||
|
icon: selected ? AIcons.selected : AIcons.unselected,
|
||||||
size: iconSize,
|
size: iconSize,
|
||||||
);
|
);
|
||||||
|
return AnimatedSwitcher(
|
||||||
|
duration: Duration(milliseconds: (300 * timeDilation).toInt()),
|
||||||
|
switchInCurve: Curves.easeOutBack,
|
||||||
|
switchOutCurve: Curves.easeOutBack,
|
||||||
|
transitionBuilder: (child, animation) => ScaleTransition(
|
||||||
|
child: child,
|
||||||
|
scale: animation,
|
||||||
|
),
|
||||||
|
child: child,
|
||||||
|
);
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
: const SizedBox.shrink();
|
: const SizedBox.shrink();
|
||||||
|
|
|
@ -7,13 +7,17 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:outline_material_icons/outline_material_icons.dart';
|
import 'package:outline_material_icons/outline_material_icons.dart';
|
||||||
|
|
||||||
class AIcons {
|
class AIcons {
|
||||||
static const IconData animated = Icons.slideshow;
|
static const IconData date = OMIcons.calendarToday;
|
||||||
static const IconData video = OMIcons.movie;
|
|
||||||
static const IconData favourite = OMIcons.favoriteBorder;
|
static const IconData favourite = OMIcons.favoriteBorder;
|
||||||
static const IconData favouriteActive = OMIcons.favorite;
|
static const IconData favouriteActive = OMIcons.favorite;
|
||||||
static const IconData date = OMIcons.calendarToday;
|
|
||||||
static const IconData location = OMIcons.place;
|
static const IconData location = OMIcons.place;
|
||||||
static const IconData tag = OMIcons.localOffer;
|
static const IconData tag = OMIcons.localOffer;
|
||||||
|
static const IconData video = OMIcons.movie;
|
||||||
|
|
||||||
|
static const IconData animated = Icons.slideshow;
|
||||||
|
static const IconData play = Icons.play_circle_outline;
|
||||||
|
static const IconData selected = Icons.check_circle_outline;
|
||||||
|
static const IconData unselected = Icons.radio_button_unchecked;
|
||||||
}
|
}
|
||||||
|
|
||||||
class VideoIcon extends StatelessWidget {
|
class VideoIcon extends StatelessWidget {
|
||||||
|
@ -25,7 +29,7 @@ class VideoIcon extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return OverlayIcon(
|
return OverlayIcon(
|
||||||
icon: OMIcons.playCircleOutline,
|
icon: AIcons.play,
|
||||||
size: iconSize,
|
size: iconSize,
|
||||||
text: entry.durationText,
|
text: entry.durationText,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue