Skip to content

Compatibility hiccup when using Gap #162

@moesaid

Description

@moesaid

Hey there!

First off, thanks so much for this awesome package!

I just ran into a small edge case and thought I'd flag it for anyone else who might stumble across it. It looks like there is a conflict when using the Gap widget inside a list of children that are being animated with .animate() extension.

Column(
  children: [
    Text("Hello"),
    Gap(20), //  This throws "A Gap widget must be placed directly inside a Flex widget."
    Text("World"),
  ].animate().fadeIn(), // The .animate() wraps the Gap
)

I believe the issue: Because Gap checks to make sure its immediate parent is a Flex widget (like Column or Row), it crashes because it now sees Animate as its parent instead of the Column.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions