Skip to content

SizedBox should not pass its size to child SizedBox #40141

@wslaimin

Description

@wslaimin
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Welcome to Flutter',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Welcome to Flutter'),
        ),
        body: SizedBox(
          width: 300,
          height: 300,
          child: SizedBox(
            width: 200,
            height: 200,
            child: SizedBox(
              width: 200,
              height: 200,
              child: Container(
                color: Colors.red,
              ),
            ),
          ),
        ),
      ),
    );
  }
}

The size of Container should be 200,but not 300.

Metadata

Metadata

Assignees

No one assigned

    Labels

    found in release: 1.21Found to occur in 1.21frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions