D1APP-26 scrolling animation bug fixed
This commit is contained in:
parent
d6b902ff2a
commit
d89ae8aba6
|
|
@ -35,6 +35,9 @@ class _RadarState extends State<Radar> {
|
||||||
body: Stack(
|
body: Stack(
|
||||||
children: [
|
children: [
|
||||||
CustomScrollView(
|
CustomScrollView(
|
||||||
|
physics: _isAnimating
|
||||||
|
? const NeverScrollableScrollPhysics()
|
||||||
|
: const ScrollPhysics(),
|
||||||
controller: _scrollController,
|
controller: _scrollController,
|
||||||
slivers: [
|
slivers: [
|
||||||
const SliverToBoxAdapter(child: LogoAppBar()),
|
const SliverToBoxAdapter(child: LogoAppBar()),
|
||||||
|
|
@ -81,24 +84,26 @@ class _RadarState extends State<Radar> {
|
||||||
final double position = _scrollController.position.pixels;
|
final double position = _scrollController.position.pixels;
|
||||||
if (position > 5 && !_isColapsed) {
|
if (position > 5 && !_isColapsed) {
|
||||||
_isColapsed = true;
|
_isColapsed = true;
|
||||||
setState(() {});
|
|
||||||
_isAnimating = true;
|
_isAnimating = true;
|
||||||
|
setState(() {});
|
||||||
await _scrollController.animateTo(
|
await _scrollController.animateTo(
|
||||||
380,
|
380,
|
||||||
duration: DesignConfig.mediumAnimationDuration,
|
duration: DesignConfig.mediumAnimationDuration,
|
||||||
curve: Curves.ease,
|
curve: Curves.ease,
|
||||||
);
|
);
|
||||||
_isAnimating = false;
|
_isAnimating = false;
|
||||||
|
setState(() {});
|
||||||
} else if (position < 380 && _isColapsed) {
|
} else if (position < 380 && _isColapsed) {
|
||||||
_isColapsed = false;
|
_isColapsed = false;
|
||||||
setState(() {});
|
|
||||||
_isAnimating = true;
|
_isAnimating = true;
|
||||||
|
setState(() {});
|
||||||
await _scrollController.animateTo(
|
await _scrollController.animateTo(
|
||||||
0,
|
0,
|
||||||
duration: DesignConfig.mediumAnimationDuration,
|
duration: DesignConfig.mediumAnimationDuration,
|
||||||
curve: Curves.ease,
|
curve: Curves.ease,
|
||||||
);
|
);
|
||||||
_isAnimating = false;
|
_isAnimating = false;
|
||||||
|
setState(() {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue