flutter/dev/tools/gen_defaults/lib
Taha Tesser 7cef966147
Fix NavigationDrawer selected item has wrong icon color (#129625)
fixes [NavigationDrawer selected item has wrong icon color [Material3 spec]](https://github.com/flutter/flutter/issues/129572)

### Description
This PR fixes a mistake in the `NavigationDrawer` defaults, where generated token value returns a `null`. 
This issue can be detected when you want to customize the selected icon color for `NavigationDrawerDestination` using a custom color scheme.

### Code sample

<details> 
<summary>expanded 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,
      themeMode: ThemeMode.light,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue).copyWith(
          onSecondaryContainer: Colors.red,
        ),
        useMaterial3: true,
      ),
      home: const Example(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('NavigationDrawer Sample'),
      ),
      drawer: const NavigationDrawer(
        children: <Widget>[
          NavigationDrawerDestination(
            icon: Icon(Icons.favorite_outline_rounded),
            label: Text('Favorite'),
            selectedIcon: Icon(Icons.favorite_rounded),
          ),
          NavigationDrawerDestination(
            icon: Icon(Icons.favorite_outline_rounded),
            label: Text('Favorite'),
          ),
        ],
      ),
    );
  }
}
``` 
	
</details>

### Before
 
<img width="1053" alt="Screenshot 2023-06-27 at 13 24 38" src="https://github.com/flutter/flutter/assets/48603081/18c13a73-688f-4586-bb60-bddef45d173f">

### After

<img width="1053" alt="Screenshot 2023-06-27 at 13 24 25" src="https://github.com/flutter/flutter/assets/48603081/8a1427c6-517f-424a-b0bd-24bad7c5fbb0">
2023-06-30 08:58:14 +00:00
..
action_chip_template.dart Introduce MaterialState color property for chips (#128584) 2023-06-19 22:03:26 +00:00
app_bar_template.dart Improve defaults generation with logging, stats, and token validation (#128244) 2023-06-09 11:28:18 +00:00
badge_template.dart Improve defaults generation with logging, stats, and token validation (#128244) 2023-06-09 11:28:18 +00:00
banner_template.dart Cleanup M3 token templates for theme lookups (#122601) 2023-03-14 17:01:13 +00:00
bottom_app_bar_template.dart Improve defaults generation with logging, stats, and token validation (#128244) 2023-06-09 11:28:18 +00:00
bottom_sheet_template.dart Provide default constraints for M3 bottom sheets (#120065) 2023-04-27 09:28:11 +02:00
button_template.dart Improve defaults generation with logging, stats, and token validation (#128244) 2023-06-09 11:28:18 +00:00
card_template.dart Cleanup M3 token templates for theme lookups (#122601) 2023-03-14 17:01:13 +00:00
checkbox_template.dart Improve defaults generation with logging, stats, and token validation (#128244) 2023-06-09 11:28:18 +00:00
chip_template.dart Introduce MaterialState color property for chips (#128584) 2023-06-19 22:03:26 +00:00
color_scheme_template.dart Improve defaults generation with logging, stats, and token validation (#128244) 2023-06-09 11:28:18 +00:00
date_picker_template.dart Improve defaults generation with logging, stats, and token validation (#128244) 2023-06-09 11:28:18 +00:00
dialog_template.dart Add Dialog.fullscreen and example (#112261) 2022-09-29 09:12:05 -07:00
divider_template.dart Improve defaults generation with logging, stats, and token validation (#128244) 2023-06-09 11:28:18 +00:00
drawer_template.dart Fix M3 Drawer default shape in RTL (#118185) 2023-01-12 14:22:53 +00:00
expansion_tile_template.dart Reland "Update ExpansionTile to support Material 3 & add an example" (#121212) 2023-02-24 06:30:33 -08:00
fab_template.dart Improve defaults generation with logging, stats, and token validation (#128244) 2023-06-09 11:28:18 +00:00
filter_chip_template.dart Introduce MaterialState color property for chips (#128584) 2023-06-19 22:03:26 +00:00
icon_button_template.dart Improve defaults generation with logging, stats, and token validation (#128244) 2023-06-09 11:28:18 +00:00
input_chip_template.dart Introduce MaterialState color property for chips (#128584) 2023-06-19 22:03:26 +00:00
input_decorator_template.dart Improve defaults generation with logging, stats, and token validation (#128244) 2023-06-09 11:28:18 +00:00
list_tile_template.dart Update ListTile text defaults to use ColorScheme (#128581) 2023-06-12 14:52:06 +00:00
menu_template.dart Update Material tokens to 0.162 (#122388) 2023-03-13 16:16:07 +00:00
navigation_bar_template.dart Improve defaults generation with logging, stats, and token validation (#128244) 2023-06-09 11:28:18 +00:00
navigation_drawer_template.dart Fix NavigationDrawer selected item has wrong icon color (#129625) 2023-06-30 08:58:14 +00:00
navigation_rail_template.dart Improve defaults generation with logging, stats, and token validation (#128244) 2023-06-09 11:28:18 +00:00
popup_menu_template.dart Update Material tokens to 0.162 (#122388) 2023-03-13 16:16:07 +00:00
progress_indicator_template.dart Improve defaults generation with logging, stats, and token validation (#128244) 2023-06-09 11:28:18 +00:00
radio_template.dart Update Radio button to material 3 (#111774) 2022-09-20 14:09:20 -07:00
search_bar_template.dart Improve defaults generation with logging, stats, and token validation (#128244) 2023-06-09 11:28:18 +00:00
search_view_template.dart Improve defaults generation with logging, stats, and token validation (#128244) 2023-06-09 11:28:18 +00:00
segmented_button_template.dart Improve defaults generation with logging, stats, and token validation (#128244) 2023-06-09 11:28:18 +00:00
slider_template.dart Improve defaults generation with logging, stats, and token validation (#128244) 2023-06-09 11:28:18 +00:00
snackbar_template.dart Cleanup M3 token templates for theme lookups (#122601) 2023-03-14 17:01:13 +00:00
surface_tint.dart Improve defaults generation with logging, stats, and token validation (#128244) 2023-06-09 11:28:18 +00:00
switch_template.dart Improve defaults generation with logging, stats, and token validation (#128244) 2023-06-09 11:28:18 +00:00
tabs_template.dart Revert "Fix Material 3 Scrollable TabBar" (#129383) 2023-06-22 22:34:06 +00:00
template.dart Improve defaults generation with logging, stats, and token validation (#128244) 2023-06-09 11:28:18 +00:00
text_field_template.dart TextField should support disabled input text style (#119216) 2023-03-17 10:09:49 -07:00
time_picker_template.dart Reorder materialStateProperty defaults (#125905) 2023-05-11 00:03:09 +00:00
token_logger.dart Improve defaults generation with logging, stats, and token validation (#128244) 2023-06-09 11:28:18 +00:00
typography_template.dart Improve defaults generation with logging, stats, and token validation (#128244) 2023-06-09 11:28:18 +00:00