flutter_confetti icon indicating copy to clipboard operation
flutter_confetti copied to clipboard

fix How to add custom confetti image #67

Open shinriyo opened this issue 1 year ago • 1 comments

For the issue. How to add custom confetti image #67

==== Put your particle_image.png in your assets.

If you can open the example. Write the image path here.

  @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Stack(
        children: <Widget>[
          //CENTER -- Blast
          Align(
            alignment: Alignment.center,
            child: ConfettiWidget(
              confettiController: _controllerCenter,
              blastDirectionality: BlastDirectionality
                  .explosive, // don't specify a direction, blast randomly
              shouldLoop:
                  true, // start again as soon as the animation is finished
              colors: const [
                Colors.green,
                Colors.blue,
                Colors.pink,
                Colors.orange,
                Colors.purple
              ], // manually specify the colors to be used
              createParticlePath: drawStar, // define a custom shape/path.
              // Add here
              imagePath: 'assets/particle_image.png',
            ),
          ),

shinriyo avatar Jun 30 '24 11:06 shinriyo

Deploy Preview for dazzling-euclid-7da31e failed.

Name Link
Latest commit 9dcca2577835fb444221be07aa5d78a955b267a4
Latest deploy log https://app.netlify.com/sites/dazzling-euclid-7da31e/deploys/668145b231a47600085a4eb4

netlify[bot] avatar Jun 30 '24 11:06 netlify[bot]

@shinriyo can you tell how you have added imagePath: 'assets/particle_image.png' in there?

taqi92 avatar Apr 05 '25 05:04 taqi92

@taqi92 Put the image in assets folder And modify the pubspec.yaml file like this. https://github.com/funwithflutter/flutter_confetti/pull/95/files#diff-565b0869896732da3b937c64bc8fd5f0ca37ea1f629d579c29fc70e0f1e3e48eR26

shinriyo avatar Apr 05 '25 06:04 shinriyo

So the modified version take imagepath as param in confetti?

taqi92 avatar Apr 05 '25 06:04 taqi92

Deploy Preview for dazzling-euclid-7da31e failed.

Name Link
Latest commit eeddda746918417db7dd74aa61f6740a02398078
Latest deploy log https://app.netlify.com/sites/dazzling-euclid-7da31e/deploys/67f1e49d92c77e000808be40

netlify[bot] avatar Apr 06 '25 02:04 netlify[bot]

@taqi92 I added the image. Check it.

But I didn't fix the conflict yet.

shinriyo avatar Apr 06 '25 02:04 shinriyo