thorvg 1.0.0-pre.5 thorvg: ^1.0.0-pre.5 copied to clipboard
ThorVG Flutter Runtime
import 'package:flutter/material.dart';
import 'package:thorvg/thorvg.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
const textStyle = TextStyle(fontSize: 24);
const spacerSmall = SizedBox(height: 10);
return MaterialApp(
home: Scaffold(
backgroundColor: Colors.white,
appBar: AppBar(
title: const Text('ThorVG Flutter'),
),
body: SingleChildScrollView(
child: Container(
margin: const EdgeInsets.only(top: 100),
padding: const EdgeInsets.all(10),
child: Column(
children: [
Lottie.network(
'https://lottie.host/6d7dd6e2-ab92-4e98-826a-2f8430768886/NGnHQ6brWA.json',
width: 300,
height: 300,
),
const Text(
'Lottie animation is running in a native API powered by ThorVG.',
style: textStyle,
textAlign: TextAlign.center,
),
spacerSmall,
],
),
),
),
),
);
}
}