1. 22 Feb, 2024 1 commit
  2. 20 Feb, 2024 1 commit
  3. 01 Nov, 2023 1 commit
    • Qun Cheng's avatar
      Add `Card.filled` and `Card.outlined` factory methods (#136229) · 4a0f261b
      Qun Cheng authored
      Fixes #119401
      
      This PR is to:
      * add `Card.filled` and `Card.outlined` factory methods so that we can use tokens for these two types of cards to generate default theme instead of providing hard-corded values in example.
      * update card.2.dart example.
      * add test file for card.2.dart example.
      * fix some mismatch caused by editing the auto-generated defaults by hand in navigation_bar.dart and navigation_drawer.dart.
      4a0f261b
  4. 30 Jun, 2023 1 commit
    • Taha Tesser's avatar
      Fix `NavigationDrawer` selected item has wrong icon color (#129625) · 7cef9661
      Taha Tesser authored
      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">
      7cef9661
  5. 09 Jun, 2023 1 commit
    • Pierre-Louis's avatar
      Improve defaults generation with logging, stats, and token validation (#128244) · 66cda591
      Pierre-Louis authored
      ## Description
      
      This improves defaults generation with logging, stats, and token validation. 
      
      This PR includes these changes:
      * introduce `TokenLogger`, with a verbose mode
        * prints versions and tokens usage to the console
        * outputs `generated/used_tokens.csv`, a list of all used tokens, for use by Google
      * find token files in `data` automatically
      * hide tokens `Map`
        * tokens can be obtained using existing resolvers (e.g. `color`, `shape`), or directly through `getToken`.
        * tokens can be checked for existence with `tokenAvailable`
      * remove version from template, since the tokens are aggregated and multiple versions are possible (as is the case currently), it does not make sense to attribute a single version
      * improve documentation
      
      ## Related Issues
       - Fixes https://github.com/flutter/flutter/issues/122602
      
      ## Tests
       - Added tests for `TokenLogger`
       - Regenerated tokens, no-op except version removal
      
      ## Future work
      A future PR should replace or remove the following invalid tokens usages
      
      <img width="578" alt="image" src="https://github.com/flutter/flutter/assets/6655696/b6f9e5a7-523f-4f72-94f9-1b0bf4cc9f00">
      66cda591
  6. 14 Mar, 2023 1 commit
  7. 18 Nov, 2022 1 commit