Skip to content

Can't get simple gallery to layout properly #70

@timcreatedit

Description

@timcreatedit

Hey there! I've tried to implement this package in two projects now, but both times I somehow couldn't get a simple Gallery to run. I must do something wrong because I've legitimately tried everyting I could think of (in the time I had), and I couldn't get past the layout issues even in the most basic cases.

Minimal repro:

testWidgets('can be used', (tester) async {
  final gallery = Gallery(
    'What am I doing wrong?',
    fileName: 'test',
    layout: const GridGoldenSceneLayout(),
  );

  for (final thickness in [0.0, 5, 10, 15, 20, 40, 100]) {
    gallery.itemFromWidget(
      description: 'thickness $thickness',
      widget: FlutterLogo(size: 200),
    );
  }

  await gallery.run(tester);
});

Produces this golden, along with a bunch of overflow exceptions

Image

Things I've tried

  • ColumnSceneLayout and RowSceneLayout
  • Passing itemConstraints to the gallery
  • A bunch of ways of trying to size the child explicitly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions