flutter/dev/tools
Taha Tesser 7abb083ae2
Add ability to override NavigationDestination.label padding for NavigationBar (#158260)
Fixes [Long NavigationBar tab titles can't be padded from the sides of the screen](https://github.com/flutter/flutter/issues/158130)

### Code sample

<details>
<summary>expand to view the code sample</summary> 

```dart
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,
      theme: ThemeData(
          navigationBarTheme: const NavigationBarThemeData(
        labelTextStyle:
            WidgetStatePropertyAll(TextStyle(overflow: TextOverflow.ellipsis)),
        labelPadding: EdgeInsets.symmetric(horizontal: 16, vertical: 4),
      )),
      home: Scaffold(
        body: Center(
          child: Text(
            'Custom NavigationBar label padding',
            style: Theme.of(context).textTheme.titleMedium,
          ),
        ),
        bottomNavigationBar: NavigationBar(
          destinations: const [
            NavigationDestination(
              icon: Icon(Icons.favorite_rounded),
              label: 'Long Label Text',
            ),
            NavigationDestination(
              // icon: SizedBox.shrink(),
              icon: Icon(Icons.favorite_rounded),
              label: 'Long Label Text',
            ),
            NavigationDestination(
              icon: Icon(Icons.favorite_rounded),
              label: 'Long Label Text',
            ),
          ],
        ),
      ),
    );
  }
}

```

</details>

### Default `NavigationDestination.label` padding  with long label

<img width="458" alt="Screenshot 2024-11-06 at 14 30 52" src="https://github.com/user-attachments/assets/637e5e66-e05f-49fa-a4ae-72083b6ff884">

### Custom `NavigationDestination.label` padding with long label

<img width="458" alt="Screenshot 2024-11-06 at 14 32 02" src="https://github.com/user-attachments/assets/23ebf715-30d3-433c-92cd-c8f0fdb1571b">
2024-11-08 14:19:18 +00:00
..
bin Fix use of deprecated buildDir in Android templates/tests/examples (#157560) 2024-11-06 21:34:23 +00:00
gen_defaults Add ability to override NavigationDestination.label padding for NavigationBar (#158260) 2024-11-08 14:19:18 +00:00
gen_keycodes Roll pub packages (#158281) 2024-11-06 19:37:09 +00:00
localization Use correct locale for CupertinoDatePicker weekday (#151494) 2024-07-11 00:10:17 +00:00
native_driver Roll pub packages (#158281) 2024-11-06 19:37:09 +00:00
test Make hash script for Frob (#157390) 2024-10-22 23:37:27 +00:00
vitool Roll pub packages (#158281) 2024-11-06 19:37:09 +00:00
.gitignore [flutter_conductor] update dev/tools with release tool (#69791) 2020-11-06 11:14:04 -08:00
create_api_docs.dart create_api_docs.dart: correct command logging (#155226) 2024-09-22 16:01:41 +00:00
dartdoc_checker.dart Add info strings to code blocks. (#146085) 2024-04-01 14:05:16 -07:00
examples_smoke_test.dart Implementing control flow collections (#146601) 2024-04-15 16:06:07 +00:00
find_engine_commit.dart begin migrating //flutter/dev/tools to null-safety (#80834) 2021-04-23 20:24:03 -07:00
mega_gallery.dart Implementing a few switch statements (#150946) 2024-07-01 23:36:32 +00:00
pubspec.yaml Roll pub packages (#158281) 2024-11-06 19:37:09 +00:00
repackage_gradle_wrapper.sh Point to a new artifacts location. (#70673) 2021-02-04 18:44:47 -08:00
update_icons.dart Update old wiki links (#149544) 2024-06-17 17:26:08 +00:00