[mob][photos] Added animation

This commit is contained in:
Aman Raj Singh Mourya
2024-08-01 19:55:19 +05:30
parent 5f40b2e251
commit 2af07d9211
2 changed files with 13 additions and 9 deletions

View File

@@ -58,7 +58,7 @@ class _AllQuickLinksPageState extends State<AllQuickLinksPage> {
});
}
Future<bool> _removeQuickLink() async {
Future<bool> _removeQuickLinks() async {
if (selectedQuickLinks.isEmpty) {
await showErrorDialog(
context,
@@ -131,7 +131,7 @@ class _AllQuickLinksPageState extends State<AllQuickLinksPage> {
actions: [
IconButton(
onPressed: () async {
await _removeQuickLink();
await _removeQuickLinks();
},
icon: Icon(
Icons.remove_circle_outline_outlined,

View File

@@ -22,14 +22,16 @@ class QuickLinkAlbumItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
final bool isSelected = selectedQuickLinks.contains(c);
final colorScheme = getEnteColorScheme(context);
final textTheme = getEnteTextTheme(context);
return Container(
return AnimatedContainer(
curve: Curves.easeOut,
duration: const Duration(milliseconds: 200),
decoration: BoxDecoration(
border: Border.all(
color: selectedQuickLinks.contains(c)
? colorScheme.strokeMuted
: colorScheme.strokeFainter,
color:
isSelected ? colorScheme.strokeMuted : colorScheme.strokeFainter,
),
borderRadius: const BorderRadius.all(
Radius.circular(2),
@@ -137,16 +139,18 @@ class QuickLinkAlbumItem extends StatelessWidget {
Flexible(
flex: 1,
child: AnimatedSwitcher(
duration: const Duration(milliseconds: 210),
duration: const Duration(milliseconds: 200),
switchInCurve: Curves.easeOut,
switchOutCurve: Curves.easeIn,
child: selectedQuickLinks.contains(c)
child: isSelected
? IconButtonWidget(
key: ValueKey(isSelected),
icon: Icons.check_circle_rounded,
iconButtonType: IconButtonType.secondary,
iconColor: colorScheme.blurStrokeBase,
)
: const IconButtonWidget(
: IconButtonWidget(
key: ValueKey(isSelected),
icon: Icons.chevron_right_outlined,
iconButtonType: IconButtonType.secondary,
),