mirror of
https://github.com/rive-app/rive-flutter.git
synced 2025-08-23 16:10:23 +08:00
82 lines
2.3 KiB
Dart
82 lines
2.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:rive_example/example_animation.dart';
|
|
import 'package:rive_example/example_state_machine.dart';
|
|
import 'package:rive_example/little_machine.dart';
|
|
import 'package:rive_example/state_machine_skills.dart';
|
|
|
|
void main() => runApp(MaterialApp(
|
|
title: 'Navigation Basics',
|
|
home: Home(),
|
|
));
|
|
|
|
class Home extends StatelessWidget {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: const Text('Rive Examples'),
|
|
),
|
|
body: Center(
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
ElevatedButton(
|
|
child: const Text('Animation'),
|
|
onPressed: () {
|
|
Navigator.push(
|
|
context,
|
|
MaterialPageRoute<void>(
|
|
builder: (context) => const ExampleAnimation(),
|
|
),
|
|
);
|
|
},
|
|
),
|
|
const SizedBox(
|
|
height: 10,
|
|
),
|
|
ElevatedButton(
|
|
child: const Text('Button State Machine'),
|
|
onPressed: () {
|
|
Navigator.push(
|
|
context,
|
|
MaterialPageRoute<void>(
|
|
builder: (context) => const ExampleStateMachine(),
|
|
),
|
|
);
|
|
},
|
|
),
|
|
const SizedBox(
|
|
height: 10,
|
|
),
|
|
ElevatedButton(
|
|
child: const Text('Skills Machine'),
|
|
onPressed: () {
|
|
Navigator.push(
|
|
context,
|
|
MaterialPageRoute<void>(
|
|
builder: (context) => const StateMachineSkills(),
|
|
),
|
|
);
|
|
},
|
|
),
|
|
const SizedBox(
|
|
height: 10,
|
|
),
|
|
ElevatedButton(
|
|
child: const Text('Little Machine'),
|
|
onPressed: () {
|
|
Navigator.push(
|
|
context,
|
|
MaterialPageRoute<void>(
|
|
builder: (context) => const LittleMachine(),
|
|
),
|
|
);
|
|
},
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|