proton 1.0.8 copy "proton: ^1.0.8" to clipboard
proton: ^1.0.8 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),
        ),
      ),
    );
  }
}
0
likes
130
points
106
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A lightweight and powerful flutter particle framework based on Proton.

Repository (GitHub)

License

MIT (license)

Dependencies

flutter, zerker

More

Packages that depend on proton