Skip to content

Expanded widget not working properly on Android API 30 #101118

@rafaelhks

Description

@rafaelhks

When using the Expanded widget inside a column with another widget it is taking up all the space, not just filling the available space as usual.

Simple build function for reproducing the problem:

Widget build(BuildContext context) {
    return Scaffold(
      key: _scaffoldKey,
      appBar: AppBar(
        title: const Text('Despesa'),
        centerTitle: true,
      ),
      body: Column(
          children: <Widget>[
            Expanded(
              child: Container(
                color: Colors.yellow,
              )
            ), 
            ElevatedButton(child: Text('test button'), onPressed: () {}),
          ],
        ),
      );
  }

When testing the code above on API 29 or below it renders the following:
screenshot_1648731597

When testing the same code on API 30 it shows only the Expanded:
Webp net-resizeimage

As stated by the Flutter documentation, the Expanded makes a child of a Row, Column, or Flex expand to fill the available space along the main axis, but on API 30 it seems to not be working properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in triagePresently being triaged by the triage teamwaiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter responds

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions