Skip to content

Unable to add footer elements to the new NavigationDrawer widget #127621

@lucasoares

Description

@lucasoares

Hello. I can't use Navigation Drawer like I'm used to with the Drawer to add footer elements.

Steps to reproduce

  1. Create a NavigationDrawer
  2. Add destinations inside other children elements (like sizedbox, containers, columns, etc)

Code sample

Code sample
    NavigationDrawer(
      onDestinationSelected: (selectedIndex) {
        setState(() {
          navDrawerIndex = selectedIndex;
        });
      },
      selectedIndex: navDrawerIndex,
      children: [
        SizedBox(
          height: MediaQuery.of(context).size.height,
          child: Column(
            children: <Widget>[
              ...destinations.map(
                (DrawerDestination destination) {
                  return NavigationDrawerDestination(
                    label: Text(destination.label),
                    icon: destination.icon,
                    selectedIcon: destination.selectedIcon,
                  );
                },
              ),
              Expanded(
                child: Container(),
              ),
              const Divider(
                thickness: 1.0,
              ),
              Row(
                children: [
                  IconButton(
                    icon: const Opacity(
                        opacity: 0.6, child: Icon(Icons.lightbulb_outline)),
                    onPressed: () {
                      showThemeSelectModal(context);
                    },
                  ),
                  const Spacer(),
                  IconButton(
                    icon: const Opacity(
                        opacity: 0.6, child: Icon(Icons.info_outline)),
                    onPressed: () {
                      showAboutDialog(
                          context: context,
                          applicationVersion: version,
                          applicationName: appName,
                          applicationIcon: const Icon(Icons.info_outline),
                          applicationLegalese: 'TODO');
                    },
                  ),
                ],
              ),
            ],
          ),
        )
      ],
    );

Screenshots or Video

Screenshot ![image](https://github.com/flutter/flutter/assets/10624972/dfd5b4aa-f015-4db9-a241-135f01df3ff9)

Flutter Doctor output

Doctor output

(not using android in this environment)

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.10.1, on Debian GNU/Linux 11 (bullseye) 5.19.0-42-generic, locale en_US.UTF-8)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    ✗ Android SDK file not found: adb.
[!] Android Studio (not installed)
[✓] Connected device (1 available)
[✓] Network resources

! Doctor found issues in 2 categories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.found in release: 3.10Found to occur in 3.10found in release: 3.11Found to occur in 3.11frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions