Skip to content

Long NavigationBar tab titles can't be padded from the sides of the screen #158130

@math1man

Description

@math1man

Steps to reproduce

  1. Run the code sample below in DartPad
  2. Adjust the width of the Flutter window and observe the behavior of the labels relative to the window edges and each other.

Expected results

There should be a way to apply padding between the tab labels and the edges of the screen.

Actual results

There is no padding, and I don't believe there is any way to apply such padding.

Code sample

Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: const Center(
          child: Text('Hello, World!'),
        ),
        bottomNavigationBar: NavigationBar(
          destinations: [
            NavigationDestination(
              icon: Icon(Icons.add),
              label: 'Long tab name one',
            ),
            NavigationDestination(
              icon: Icon(Icons.add),
              label: 'Long tab name two',
            ),
            NavigationDestination(
              icon: Icon(Icons.add),
              label: 'Long tab name three',
            ),
          ],
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

image

Logs

No response

Flutter Doctor output

Internal google client, skipping Flutter Doctor output

Metadata

Metadata

Assignees

Labels

f: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages team

Type

No type

Projects

Status

Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions