proton 1.0.7
proton: ^1.0.7 copied to clipboard
A lightweight and powerful flutter particle framework based on Proton.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:proton/proton.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Proton Particle Framework Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Proton Particle Framework'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: const Center(
child: ProtonDemo(),
),
);
}
}
class ProtonDemo extends StatefulWidget {
const ProtonDemo({super.key});
@override
State<ProtonDemo> createState() => _ProtonDemoState();
}
class _ProtonDemoState extends State<ProtonDemo> {
@override
Widget build(BuildContext context) {
// 简单演示如何使用 Proton 库
return Container(
width: 400,
height: 400,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(8),
),
child: const Center(
child: Text(
'Proton Particle Framework\nDemo\n\nCheck the documentation for usage examples.',
textAlign: TextAlign.center,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
),
),
);
}
}