rive_mobile 0.0.2 copy "rive_mobile: ^0.0.2" to clipboard
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
0
likes
150
points
26
downloads

Publisher

unverified uploader

Weekly Downloads

2024.09.26 - 2025.04.10

A wrapper for the Rive mobile native runtime for Flutter.

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on rive_mobile