fix: memoize child of animated widget and make player bg animation faster

This commit is contained in:
Kingkor Roy Tirtho 2023-04-07 11:30:26 +06:00
parent 49b5d0e694
commit fcb5c8f8da
2 changed files with 2 additions and 2 deletions

View File

@ -105,7 +105,7 @@ class AnimateGradient extends HookWidget {
return AnimatedBuilder( return AnimatedBuilder(
animation: animation, animation: animation,
child: child, child: useMemoized(() => child, [child]),
builder: (BuildContext context, Widget? child) { builder: (BuildContext context, Widget? child) {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(

View File

@ -82,7 +82,7 @@ class PlayerView extends HookConsumerWidget {
primaryEnd: Alignment.bottomLeft, primaryEnd: Alignment.bottomLeft,
secondaryBegin: Alignment.bottomRight, secondaryBegin: Alignment.bottomRight,
secondaryEnd: Alignment.topRight, secondaryEnd: Alignment.topRight,
duration: const Duration(seconds: 25), duration: const Duration(seconds: 15),
primaryColors: [ primaryColors: [
palette.dominantColor?.color ?? theme.colorScheme.primary, palette.dominantColor?.color ?? theme.colorScheme.primary,
palette.mutedColor?.color ?? theme.colorScheme.secondary, palette.mutedColor?.color ?? theme.colorScheme.secondary,