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>(
|
BlocBuilder<HomeBloc, HomeState>(
|
||||||
builder: (context, state) => state.isButtonToTopShown
|
builder: (context, state) => AnimatedSwitcher(
|
||||||
? Container(
|
duration: Duration(milliseconds: 250),
|
||||||
alignment: Alignment.topRight,
|
child: state.isButtonToTopShown
|
||||||
padding: EdgeInsets.only(right: 16, top: 64),
|
? Container(
|
||||||
child: FloatingActionButton(
|
key: ValueKey<int>(1),
|
||||||
onPressed: _goToTop,
|
alignment: Alignment.topRight,
|
||||||
child: Icon(Icons.arrow_upward_rounded),
|
padding: EdgeInsets.only(right: 16, top: 72),
|
||||||
))
|
child: FloatingActionButton(
|
||||||
: SizedBox.shrink(),
|
onPressed: _goToTop,
|
||||||
|
child: Icon(Icons.arrow_upward_rounded),
|
||||||
|
))
|
||||||
|
: SizedBox.shrink(key: ValueKey<int>(0))),
|
||||||
)
|
)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user