flutter_confetti
flutter_confetti copied to clipboard
fix How to add custom confetti image #67
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',
),
),
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 |
@shinriyo can you tell how you have added imagePath: 'assets/particle_image.png' in there?
@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
So the modified version take imagepath as param in confetti?
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 |
@taqi92 I added the image. Check it.
But I didn't fix the conflict yet.