mirror of
https://github.com/rive-app/rive-flutter.git
synced 2025-08-06 16:40:27 +08:00
style: updated example and readme
Diffs= a259b57b2 style: clean up example app 483978f10 docs: update readme
This commit is contained in:
@ -6,7 +6,7 @@ class AnimationCarousel extends StatefulWidget {
|
||||
const AnimationCarousel({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_AnimationCarouselState createState() => _AnimationCarouselState();
|
||||
State<AnimationCarousel> createState() => _AnimationCarouselState();
|
||||
}
|
||||
|
||||
class _AnimationCarouselState extends State<AnimationCarousel> {
|
||||
@ -55,9 +55,8 @@ class _AnimationCarouselState extends State<AnimationCarousel> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final _indexToShow = _index % riveAnimations.length;
|
||||
final indexToShow = _index % riveAnimations.length;
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.grey,
|
||||
appBar: AppBar(
|
||||
title: const Text('Animation Carousel'),
|
||||
),
|
||||
@ -70,9 +69,9 @@ class _AnimationCarouselState extends State<AnimationCarousel> {
|
||||
),
|
||||
Expanded(
|
||||
child: RiveAnimation.asset(
|
||||
riveAnimations[_indexToShow].name,
|
||||
animations: riveAnimations[_indexToShow].animations,
|
||||
stateMachines: riveAnimations[_indexToShow].stateMachines,
|
||||
riveAnimations[indexToShow].name,
|
||||
animations: riveAnimations[indexToShow].animations,
|
||||
stateMachines: riveAnimations[indexToShow].stateMachines,
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
|
Reference in New Issue
Block a user