Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alignment does not work #71

Open
Eerey opened this issue Sep 2, 2022 · 4 comments
Open

Alignment does not work #71

Eerey opened this issue Sep 2, 2022 · 4 comments

Comments

@Eerey
Copy link

Eerey commented Sep 2, 2022

I tried to wrap it around Align-Widgets - the children, the parent, everything.
It never works consistently.
I also tried to put the ConfettiWidget in a Stack with a fixed size (Container wrapped around it) -> It does not align correctly.
Sometimes the ConfettiWidget only emits from a singular point and every single confetti is displayed in its untransformed (and untranslated) form.
Is there some tricky behaviour underlying?

@HayesGordon
Copy link
Collaborator

Hi! Can you share some example code, or explain better what you're trying to do? The main example demonstrates different alignments

@mirkancal
Copy link

mirkancal commented Oct 2, 2022

I'm also having the same issue; I've simply copied from the example but not sure what's missing. Confettis are shooting from a single point but can't move around the screen.

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        Align(
          alignment: Alignment.center,
          child: ConfettiWidget(
            confettiController: _confettiController,
            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
          ),
        ),

image

@Steellow
Copy link

Steellow commented Jan 13, 2023

Also having the same problem. All confettis are stuck in place.

edit: Center seems to be working better. Or if you want to align it to some edge, aligning it with column and/or row seems to be working.

e2: Align seems to be working fine if you just set canvas: Size.infinite to ConfettiWidget.

@TalebRafiepour
Copy link

Also having the same problem. All confettis are stuck in place.

edit: Center seems to be working better. Or if you want to align it to some edge, aligning it with column and/or row seems to be working.

e2: Align seems to be working fine if you just set canvas: Size.infinite to ConfettiWidget.

When I set the canvas: Size.infinite some exceptions happened

[log] Matrix4 entries must be finite.
'dart:ui/painting.dart':
      Failed assertion: line 46 pos 10: '<optimized out>'

[log] #0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
#1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
#2      _matrix4IsValid (dart:ui/painting.dart:46:10)
#3      Path.transform (dart:ui/painting.dart:2738:12)
#4      ParticlePainter._paintParticles
confetti.dart:382
#5      ParticlePainter.paint
confetti.dart:359
#6      RenderCustomPaint._paintWithPainter
custom_paint.dart:571
#7      RenderCustomPaint.paint
custom_paint.dart:618
#8      RenderObject._paintWithContext
object.dart:2853
#9      PaintingContext.paintChild
object.dart:253
#10     RenderProxyBoxMixin.paint
proxy_box.dart:144
#11     RenderObject._paintWithContext
object.dart:2853
#12     PaintingContext._repaintCompositedChild
object.dart:169
#13     PaintingContext.repaintCompositedChild
object.dart:112
#14     PipelineOwner.flushPaint
object.dart:1137
#15     RendererBinding.drawFrame
binding.dart:518
#16     WidgetsBinding.drawFrame
binding.dart:865
#17     RendererBinding._handlePersistentFrameCallback
binding.dart:381
#18     SchedulerBinding._invokeFrameCallback
binding.dart:1289
#19     SchedulerBinding.handleDrawFrame
binding.dart:1218
#20     SchedulerBinding._handleDrawFrame
binding.dart:1076
#21     _rootRun (dart:async/zone.dart:1398:13)
#22     _CustomZone.run (dart:async/zone.dart:1300:19)
#23     _CustomZone.runGuarded (dart:async/zone.dart:1208:7)
#24     _invoke (dart:ui/hooks.dart:147:10)
#25     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:338:5)
#26     _drawFrame (dart:ui/hooks.dart:112:31)  

Screenshot 2023-03-30 at 7 10 22 PM

‍‍‍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants