flutter-animation

AnimatedSwitcher with IndexedStack

我们两清 提交于 2021-01-18 05:39:06
问题 I have to use IndexedStack to maintain the state of my widgets for my BottomNavigationBar. Now i want to use AnimatedSwitcher (or an alternative) to create an animation when i switch tabs. I'm having issues getting AnimatedSwitcher to trigger on change of IndexedStack. I'm having IndexedStack as the child of AnimatedSwitcher, which obviously causes AnimatedSwitcher to not trigger because the IndexedStack widget doesn't change, only it's child. body: AnimatedSwitcher( duration: Duration

AnimatedSwitcher with IndexedStack

人盡茶涼 提交于 2021-01-18 05:39:05
问题 I have to use IndexedStack to maintain the state of my widgets for my BottomNavigationBar. Now i want to use AnimatedSwitcher (or an alternative) to create an animation when i switch tabs. I'm having issues getting AnimatedSwitcher to trigger on change of IndexedStack. I'm having IndexedStack as the child of AnimatedSwitcher, which obviously causes AnimatedSwitcher to not trigger because the IndexedStack widget doesn't change, only it's child. body: AnimatedSwitcher( duration: Duration

How to change speed of a hero animation in flutter

|▌冷眼眸甩不掉的悲伤 提交于 2021-01-02 04:50:52
问题 I have made simple hero animation following instructions from Flutter's website It works as described in the instructions but in my case, I would like it to animate much more slowly from the first to the second screen. do anyone know how to change the speed of this animation? 回答1: To modify the transition speed, you'll have to adjust the PageRoute transition duration (as already pointed out by @diegoveloper). If you wanna keep the default transition, you can create a class implementing

Flutter can't keep the state of tabs using PageTransitionSwitcher

早过忘川 提交于 2020-12-15 05:24:07
问题 I am struggling with animations package and I want to use animation with BottomNavigationBar. Without animation, I can save my state using IndexedStack. If I wrap IndexedStack inside PageTransitionSwitcher it doesn't work. In particular: animations are not showing but state is kept if I use key property of my IndexedStack, animations are showing but state is not working. How can i fix it? I don't know how to set up keys. Thank you very much!! class MainScreen extends StatefulWidget { static

Flutter can't keep the state of tabs using PageTransitionSwitcher

爱⌒轻易说出口 提交于 2020-12-15 05:24:05
问题 I am struggling with animations package and I want to use animation with BottomNavigationBar. Without animation, I can save my state using IndexedStack. If I wrap IndexedStack inside PageTransitionSwitcher it doesn't work. In particular: animations are not showing but state is kept if I use key property of my IndexedStack, animations are showing but state is not working. How can i fix it? I don't know how to set up keys. Thank you very much!! class MainScreen extends StatefulWidget { static

Flutter: After flutter 1.22 update i am getting error in Lineargradient properties

混江龙づ霸主 提交于 2020-12-08 05:56:51
问题 After the flutter 1.22 update, I am getting an error in Lineargradient colors property it's giving me an error that the name colors parameter isn't defined..I am getting this error everywhere in the project after the update of flutter and flutter plugin in android studio. 回答1: Restarting your Android Studio should fix this issue. This is because in Dart 2.10, required becomes a keyword (previously was @required ). The IDE probably doesn't recognize that you've updated the Dart SDK. 回答2: run

Possible to copy iOS App Store transition using Flutter?

旧城冷巷雨未停 提交于 2020-12-04 06:08:40
问题 Is it possible to copy the transition effect of iOS App Store using Flutter? I tried using Hero Animation by placing two tags into the root layout of both widgets, but animation looks janky or not what I expected. But good thing about this is I am able to do iOS swipe back as I'm using MaterialPageRoute. Source Hero( tag: 'heroTag_destinationScreen', transitionOnUserGestures: true, flightShuttleBuilder: (BuildContext flightContext, Animation<double> animation, HeroFlightDirection

Possible to copy iOS App Store transition using Flutter?

无人久伴 提交于 2020-12-04 06:07:00
问题 Is it possible to copy the transition effect of iOS App Store using Flutter? I tried using Hero Animation by placing two tags into the root layout of both widgets, but animation looks janky or not what I expected. But good thing about this is I am able to do iOS swipe back as I'm using MaterialPageRoute. Source Hero( tag: 'heroTag_destinationScreen', transitionOnUserGestures: true, flightShuttleBuilder: (BuildContext flightContext, Animation<double> animation, HeroFlightDirection

Possible to copy iOS App Store transition using Flutter?

有些话、适合烂在心里 提交于 2020-12-04 06:06:43
问题 Is it possible to copy the transition effect of iOS App Store using Flutter? I tried using Hero Animation by placing two tags into the root layout of both widgets, but animation looks janky or not what I expected. But good thing about this is I am able to do iOS swipe back as I'm using MaterialPageRoute. Source Hero( tag: 'heroTag_destinationScreen', transitionOnUserGestures: true, flightShuttleBuilder: (BuildContext flightContext, Animation<double> animation, HeroFlightDirection