particular 0.3.0 copy "particular: ^0.3.0" to clipboard
particular: ^0.3.0 copied to clipboard

The Particular is a high performance particle effects flutter widget.

example/lib/main.dart

import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:particular/particular.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  // Add controller to change particle
  final _particleController = ParticularController();

  @override
  void initState() {
    _loadParticleAssets();
    super.initState();
  }

  // Load configs and texture of particle
  Future<void> _loadParticleAssets() async {
    // Load particle configs file
    String json = await rootBundle.loadString("assets/particle.json");
    final configsData = jsonDecode(json);

    // add particle layer
    _particleController.addLayer(configsData: configsData);
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        backgroundColor: Colors.black,
        body: Particular(
          controller: _particleController,
        ),
      ),
    );
  }
}
28
likes
0
pub points
58%
popularity

Publisher

unverified uploader

The Particular is a high performance particle effects flutter widget.

Homepage
Repository (GitHub)
View/report issues

Topics

#particle #particles #visualization #game #effects

Documentation

Documentation

License

unknown (license)

Dependencies

flutter, image

More

Packages that depend on particular