Skip to content

In release mode we start off at 0x0 but we don't in debug mode #5259

@dragostis

Description

@dragostis

Consider the following applet:

void main() {
  runApp(
    new MaterialApp(
      title: 'Bug Showcase',
      theme: new ThemeData(
        primarySwatch: Colors.blue
      ),
      home: new LayoutBuilder(
        builder: (BuildContext context, BoxConstraints constraints) {
          print(constraints);
          return new Container();
        }
      )
    )
  );
}

Running with flutter run this outputs:

I/flutter : BoxConstraints(w=360.0, h=640.0)

Running with flutter run --release this outputs:

I/flutter : BoxConstraints(w=0.0, h=0.0)
I/flutter : BoxConstraints(w=360.0, h=640.0)

This is problematic especially in the case of animating a widget based on its initial constraints.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: animationAnimation APIsframeworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions