rive_mobile 0.0.2
rive_mobile: ^0.0.2 copied to clipboard
A wrapper for the Rive mobile native runtime for Flutter.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:rive_mobile/rive_mobile.dart';
void main() => runApp(const MaterialApp(home: ExampleApp()));
class ExampleApp extends StatefulWidget {
const ExampleApp({Key? key}) : super(key: key);
@override
State<ExampleApp> createState() => _ExampleAppState();
}
class _ExampleAppState extends State<ExampleApp> {
late final TextEditingController _assetPathController;
String assetPath = 'assets/elite_plus.riv';
@override
void initState() {
_assetPathController = TextEditingController(text: 'assets/elite_plus.riv');
super.initState();
}
@override
void dispose() {
_assetPathController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
// appBar: AppBar(title: const Text('Rive example')),
body: RiveAnimation.asset(
assetPath,
fit: BoxFit.fitWidth,
),
// Column(
// children: [
// TextFormField(
// controller: _assetPathController,
// ),
// ElevatedButton(
// onPressed: () => setState(() {
// assetPath = _assetPathController.text;
// }),
// child: const Text('Load Rive asset'),
// ),
// RiveAnimation.asset(
// assetPath,
// fit: BoxFit.fill,
// ),
// ],
// ),
);
}
}
copied to clipboard