|
|
|
@ -56,11 +56,13 @@ class _CustomHeader extends RefreshIndicatorState<CustomHeader> {
|
|
|
|
|
void initState() { |
|
|
|
|
super.initState(); |
|
|
|
|
|
|
|
|
|
rootBundle.load("assets/riv/finger_tapping.riv").then((value) async { |
|
|
|
|
// rootBundle.load("assets/riv/finger_tapping.riv").then((value) async { |
|
|
|
|
rootBundle.load("assets/riv/runner_boy.riv").then((value) async { |
|
|
|
|
final riveFile = RiveFile(); |
|
|
|
|
riveFile.import(value); |
|
|
|
|
final artboard = riveFile.mainArtboard; |
|
|
|
|
artboard.addController(_controllerIdle = SimpleAnimation("Idle_1")); |
|
|
|
|
artboard.addController(_controllerIdle = SimpleAnimation("Animation")); |
|
|
|
|
// artboard.addController(_controllerIdle = SimpleAnimation("Idle_1")); |
|
|
|
|
|
|
|
|
|
setState(() { |
|
|
|
|
_riveArtboard = artboard; |
|
|
|
@ -71,10 +73,12 @@ class _CustomHeader extends RefreshIndicatorState<CustomHeader> {
|
|
|
|
|
@override |
|
|
|
|
Widget buildContent(BuildContext context, RefreshStatus mode) { |
|
|
|
|
|
|
|
|
|
if (mode == RefreshStatus.idle) { |
|
|
|
|
_controllerIdle.isActive = false; |
|
|
|
|
} else { |
|
|
|
|
_controllerIdle.isActive = true; |
|
|
|
|
if (_controllerIdle != null) { |
|
|
|
|
if (mode == RefreshStatus.idle) { |
|
|
|
|
_controllerIdle.isActive = false; |
|
|
|
|
} else { |
|
|
|
|
_controllerIdle.isActive = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return Container( |
|
|
|
|