-
Notifications
You must be signed in to change notification settings - Fork 517
Open
Description
class Pandy extends StatefulWidget {
@override
PandyS createState() => PandyS();
}
class PandyS extends State<Pandy> implements FlareController {
ActorAnimation _rock;
String animationName = "Untitled";
int start;
void initialize(FlutterActorArtboard artboard) {
_rock = artboard.getAnimation("Untitled");
artboard.advance(2.0);
print('initialize');
start = DateTime.now().millisecondsSinceEpoch;
}
void setViewTransform( viewTransform) {
// print('setViewTransform ${_rock.animatedComponents}');
}
bool advance(FlutterActorArtboard artboard, double elapsed) {
// _rock.apply(1.0, artboard, 0.5);
var now = DateTime.now().millisecondsSinceEpoch;
if ((now - start) > 3000) {
// setState(() {
// animationName = "1";
// });
} else {
print('advances ${_rock.isLooping} ${(now - start)}');
}
return false;
}
Widget build(BuildContext context) {
print('flr build');
var flr = new FlareActor("images/test.flr",
alignment:Alignment.center,
fit:BoxFit.contain,
animation: animationName,
controller: this,
isPaused: false,
callback: (r) {
print(r);
},
);
return flr;
}
}egyleader
Metadata
Metadata
Assignees
Labels
No labels