mirror of
https://github.com/rive-app/rive-flutter.git
synced 2025-07-06 08:26:42 +08:00
24 lines
658 B
Dart
24 lines
658 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:rive/rive.dart';
|
|
|
|
/// Basic example playing a Rive animation from a network asset.
|
|
class SimpleNetworkAnimation extends StatelessWidget {
|
|
const SimpleNetworkAnimation({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: const Text('Simple Animation'),
|
|
),
|
|
body: const Center(
|
|
child: RiveAnimation.network(
|
|
'https://cdn.rive.app/animations/vehicles.riv',
|
|
fit: BoxFit.cover,
|
|
placeHolder: Center(child: CircularProgressIndicator()),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|