Skip to content

Enhance your app or game visuals with this high-performance Flutter Particles System widget

License

Notifications You must be signed in to change notification settings

manjav/particular

Repository files navigation

Particular Logo

Enhance your app or game visuals with this high-performance Flutter Particles System widget. Utilize JSON or programmatic configuration, seamlessly integrating with popular particles editors for effortless customization.

  • Customizable (live) Particle Effects.
  • Ready Presets (JSON Configs).
  • Seamless Integration with Editors.
  • Optimized Performance with 1~10k particle at frame

    Whether you're a designer or developer, Particular empowers you to bring your creative visions with ease.


    - Some Presets:

    Meteor Galaxy Snow Meteor


    - Installation

    Add particular to your pubspec.yaml file:
    For detailed installation instructions, refer to the installation guide on pub.dev.


    - Configurate your particles

    You have two options for configuring your particles:

    1. Using Editors:

    Generate your particles system configurations by Particular Editor.


    1. Programmatic Configuration:
      Manually configure your particle controller in code. Refer to the following steps for more details.

    - Getting Started with Coding

    To use this library, import package:particular/particular.dart.
    Follow these steps to integrate the particles system into your Flutter app:
    I. Initialize the Particles Controller in initState:

    final _particleController = ParticularController();
    ...
    @override
    void initState() {
      // Load particle configs file
      String json = await rootBundle.loadString("assets/particle.json");
      final configsData = jsonDecode(json);
    
      // Load particle texture file
      ByteData  bytes = await rootBundle.load("assets/${configsData["textureFileName"]}");
      ui.Image texture = await loadUIImage(bytes.buffer.asUint8List());
    
      // Add particles layer
      _particleController.addLayer(
        texture: frameInfo.image, // Remove in default-texture case
        configsData: configsData, // Remove in programmatic configuration case
      );
      super.initState();
    }

    II. Add the Particular widget in your widget three:

    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        home: Scaffold(
          backgroundColor: Colors.black,
          body: Particular(
            controller: _particleController,
          ),
        ),
      );
    }

    III. Live Update Particle Layer:

    _particleController.layers.first.update(
        maxParticles: 100,
        lifespan:1.2,
        speed:100,
        angle:30,
    );

    This revised README provides clear installation instructions, options for configuring particles, and steps for integrating and customizing the particle system in your Flutter app. If you have any questions or need further assistance, don't hesitate to ask!

  • About

    Enhance your app or game visuals with this high-performance Flutter Particles System widget

    Topics

    Resources

    License

    Stars

    Watchers

    Forks

    Packages

    No packages published

    Languages