패키지, 저장소 및 앱 카테고리 검색

GitHub 저장소manjav/particular

특정한

이 고성능 플러터 입자 시스템 위젯으로 앱 또는 게임의 시각적 요소를 향상시키세요

특정한 프로젝트 이미지
스타
17
포크
0
최근 푸시(UTC)
2025. 2. 9.
프로젝트 상태
활성

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

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

    Follow these steps to integrate the particles system into your Flutter app:

    I. Insert Particle Files into Your Project:
    The Particular Editor exports one or multiple particle layers. For each particle layer, it generates a configuration file (configs.json) and a related image file (texture.png). In the configuration file, there is a node named textureFileName, which refers to the image file. Place the image and configs.json file in your project's assets folder, and add the necessary assets entry in your pubspec.yaml file.

    assets:
      - assets/configs.json
      - assets/texture.png
    

    https://docs.flutter.dev/ui/assets/assets-and-images


    II. Initialize the Particles Controller in `initState`:

    To use this library, import package:particular/particular.dart.

    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/configs.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
      );
    }
    

    III. Add the Particular widget in your widget three:

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

    IIII. Live Update Particle Layer:

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

    You can also use different image types supported by Flutter, with varying names and locations, following the guidelines below:

    {
      "textureFileName": "images/particle_snow.webp"
    }
    
    assets:
      - assets/data/particle_snow.json
      - assets/images/particle_snow.webp
    
    ...
    
    // Load particle configs file
    String json = await rootBundle.loadString("assets/data/particle_snow.json");
    
    ...
    

    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!

  • Mansour Djawadi GitHub avatar
    GitHub 작성자

    Mansour Djawadi ↗

    Istanbul
    언어DartRubyHTMLShellSwift

    분류

    이 저장소가 배포한 패키지

    사용 중인 의존성

    의존성 목록 4 개

    • flutter{"sdk":"flutter"}
    • image^4.2.0
    • flutter_test개발 의존성{"sdk":"flutter"}
    • flutter_lints개발 의존성^5.0.0

    프로젝트에 맞는 저장소를 선택하려면?

    사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.

    1. 이름, 작성자 또는 설명으로 검색하고 기술 주제로 범위를 좁힙니다.
    2. 스타, 포크, 최근 푸시를 함께 비교하세요. 스타는 관심의 지표이며 품질을 보장하지 않습니다.
    3. 사용하기 전에 GitHub에서 README, 라이선스, Issues를 확인하세요.

    출처 및 관리

    “A repository is the most basic element of GitHub.”

    GitHub Docs — About repositories ↗