Browse Source

safety

master
fmk 3 years ago
parent
commit
ba5424e2cc
  1. BIN
      assets/riv/runner_boy.riv
  2. 8
      lib/view_widget/classic_header.dart

BIN
assets/riv/runner_boy.riv

Binary file not shown.

8
lib/view_widget/classic_header.dart

@ -56,11 +56,13 @@ class _CustomHeader extends RefreshIndicatorState<CustomHeader> {
void initState() { void initState() {
super.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(); final riveFile = RiveFile();
riveFile.import(value); riveFile.import(value);
final artboard = riveFile.mainArtboard; final artboard = riveFile.mainArtboard;
artboard.addController(_controllerIdle = SimpleAnimation("Idle_1")); artboard.addController(_controllerIdle = SimpleAnimation("Animation"));
// artboard.addController(_controllerIdle = SimpleAnimation("Idle_1"));
setState(() { setState(() {
_riveArtboard = artboard; _riveArtboard = artboard;
@ -71,11 +73,13 @@ class _CustomHeader extends RefreshIndicatorState<CustomHeader> {
@override @override
Widget buildContent(BuildContext context, RefreshStatus mode) { Widget buildContent(BuildContext context, RefreshStatus mode) {
if (_controllerIdle != null) {
if (mode == RefreshStatus.idle) { if (mode == RefreshStatus.idle) {
_controllerIdle.isActive = false; _controllerIdle.isActive = false;
} else { } else {
_controllerIdle.isActive = true; _controllerIdle.isActive = true;
} }
}
return Container( return Container(
height: 50, height: 50,

Loading…
Cancel
Save