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
|
||||
Widget build(BuildContext context) {
|
||||
final fontSize = min(14.0, (extent / 8));
|
||||
final fontSize = min(14.0, (extent / 8)).roundToDouble();
|
||||
final iconSize = fontSize * 2;
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
@ -56,7 +56,7 @@ class ThumbnailSelectionOverlay extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final fontSize = min(14.0, (extent / 8));
|
||||
final fontSize = min(14.0, (extent / 8)).roundToDouble();
|
||||
final iconSize = fontSize * 2;
|
||||
final collection = Provider.of<CollectionLens>(context);
|
||||
return ValueListenableBuilder<Activity>(
|
||||
|
@ -66,10 +66,22 @@ class ThumbnailSelectionOverlay extends StatelessWidget {
|
|||
? AnimatedBuilder(
|
||||
animation: collection.selectionChangeNotifier,
|
||||
builder: (context, child) {
|
||||
return OverlayIcon(
|
||||
icon: collection.selection.contains(entry) ? Icons.check_circle_outline : Icons.radio_button_unchecked,
|
||||
final selected = collection.selection.contains(entry);
|
||||
final child = OverlayIcon(
|
||||
key: ValueKey(selected),
|
||||
icon: selected ? AIcons.selected : AIcons.unselected,
|
||||
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();
|
||||
|
|
|
@ -7,13 +7,17 @@ import 'package:flutter/material.dart';
|
|||
import 'package:outline_material_icons/outline_material_icons.dart';
|
||||
|
||||
class AIcons {
|
||||
static const IconData animated = Icons.slideshow;
|
||||
static const IconData video = OMIcons.movie;
|
||||
static const IconData date = OMIcons.calendarToday;
|
||||
static const IconData favourite = OMIcons.favoriteBorder;
|
||||
static const IconData favouriteActive = OMIcons.favorite;
|
||||
static const IconData date = OMIcons.calendarToday;
|
||||
static const IconData location = OMIcons.place;
|
||||
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 {
|
||||
|
@ -25,7 +29,7 @@ class VideoIcon extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return OverlayIcon(
|
||||
icon: OMIcons.playCircleOutline,
|
||||
icon: AIcons.play,
|
||||
size: iconSize,
|
||||
text: entry.durationText,
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue