From 48f0bc625d208e64e17f8b1e5c7beeeeb462d70b Mon Sep 17 00:00:00 2001 From: Unknown <55922348+55nknown@users.noreply.github.com> Date: Sun, 18 Sep 2022 17:49:18 +0200 Subject: [PATCH] feat: animate switching updates on HomeView (#209) --- lib/ui/views/home/home_view.dart | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/lib/ui/views/home/home_view.dart b/lib/ui/views/home/home_view.dart index f12849b0..fbfb9c95 100644 --- a/lib/ui/views/home/home_view.dart +++ b/lib/ui/views/home/home_view.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:animations/animations.dart'; import 'package:revanced_manager/app/app.locator.dart'; import 'package:revanced_manager/ui/views/home/home_viewmodel.dart'; import 'package:revanced_manager/ui/widgets/homeView/available_updates_card.dart'; @@ -83,9 +84,26 @@ class HomeView extends StatelessWidget { ], ), const SizedBox(height: 14), - model.showUpdatableApps - ? AvailableUpdatesCard() - : InstalledAppsCard(), + PageTransitionSwitcher( + transitionBuilder: + (child, primaryAnimation, secondaryAnimation) { + return FadeThroughTransition( + animation: primaryAnimation, + secondaryAnimation: secondaryAnimation, + fillColor: Colors.transparent, + child: child, + ); + }, + layoutBuilder: (entries) { + return Stack( + alignment: Alignment.topCenter, + children: entries, + ); + }, + child: model.showUpdatableApps + ? AvailableUpdatesCard() + : InstalledAppsCard(), + ), ], ), ),