add animation for button "To top"
This commit is contained in:
parent
011fbbd05f
commit
28c448046f
@ -155,15 +155,18 @@ class _BodyState extends State<Body> {
|
||||
],
|
||||
),
|
||||
BlocBuilder<HomeBloc, HomeState>(
|
||||
builder: (context, state) => state.isButtonToTopShown
|
||||
builder: (context, state) => AnimatedSwitcher(
|
||||
duration: Duration(milliseconds: 250),
|
||||
child: state.isButtonToTopShown
|
||||
? Container(
|
||||
key: ValueKey<int>(1),
|
||||
alignment: Alignment.topRight,
|
||||
padding: EdgeInsets.only(right: 16, top: 64),
|
||||
padding: EdgeInsets.only(right: 16, top: 72),
|
||||
child: FloatingActionButton(
|
||||
onPressed: _goToTop,
|
||||
child: Icon(Icons.arrow_upward_rounded),
|
||||
))
|
||||
: SizedBox.shrink(),
|
||||
: SizedBox.shrink(key: ValueKey<int>(0))),
|
||||
)
|
||||
]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user