1. 08 Sep, 2023 3 commits
  2. 07 Sep, 2023 8 commits
    • Polina Cherkasova's avatar
      _SearchBarState should dispose FocusNode, if it created it. (#134076) · 1c0b4ad5
      Polina Cherkasova authored
      Relanding of revert: https://github.com/flutter/flutter/pull/134072
      
      Verified failed tests succeeded now:
      1c0b4ad5
    • Taha Tesser's avatar
      Fix `ExpansionTile` properties cannot be updated with `setState` (#134218) · 30234a00
      Taha Tesser authored
      fixes [`ExpansionTile` properties aren't updated with `setState`](https://github.com/flutter/flutter/issues/24493)
      
      ### 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 const MaterialApp(
            debugShowCheckedModeBanner: false,
            home: Example(),
          );
        }
      }
      
      class Example extends StatefulWidget {
        const Example({super.key});
      
        @override
        State<Example> createState() => _ExampleState();
      }
      
      class _ExampleState extends State<Example> {
        ShapeBorder collapsedShape = const RoundedRectangleBorder(
          borderRadius: BorderRadius.all(Radius.circular(4)),
        );
        Color collapsedTextColor = const Color(0xffffffff);
        Color collapsedBackgroundColor = const Color(0xffff0000);
        Color collapsedIconColor = const Color(0xffffffff);
        ShapeBorder shape = const RoundedRectangleBorder(
          borderRadius: BorderRadius.all(Radius.circular(16)),
        );
        Color backgroundColor = const Color(0xffff0000);
        Color textColor = const Color(0xffffffff);
        Color iconColor = const Color(0xffffffff);
      
        @override
        Widget build(BuildContext context) {
          return Scaffold(
            body: Center(
              child: Padding(
                padding: const EdgeInsets.symmetric(horizontal: 16.0),
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    ExpansionTile(
                      shape: shape,
                      backgroundColor: backgroundColor,
                      textColor: textColor,
                      iconColor: iconColor,
                      collapsedShape: collapsedShape,
                      collapsedTextColor: collapsedTextColor,
                      collapsedBackgroundColor: collapsedBackgroundColor,
                      collapsedIconColor: collapsedIconColor,
                      title: const Text('Collapsed ExpansionTile'),
                      children: const [
                        ListTile(
                          title: Text('Revealed!'),
                        ),
                      ],
                    ),
                    const SizedBox(height: 16),
                    ExpansionTile(
                      shape: shape,
                      backgroundColor: backgroundColor,
                      textColor: textColor,
                      iconColor: iconColor,
                      initiallyExpanded: true,
                      title: const Text('Expanded ExpansionTile'),
                      children: const [
                        ListTile(
                          title: Text('Revealed!'),
                        ),
                      ],
                    ),
                    const SizedBox(height: 16),
                    FilledButton(
                      onPressed: () {
                        setState(() {
                          collapsedShape = const RoundedRectangleBorder(
                            borderRadius: BorderRadius.all(Radius.circular(50)),
                          );
                          collapsedTextColor = const Color(0xfff00000);
                          collapsedBackgroundColor = const Color(0xffffff00);
                          collapsedIconColor = const Color(0xfff00000);
      
                          shape = const RoundedRectangleBorder();
                          backgroundColor = const Color(0xfffff000);
                          textColor = const Color(0xfff00000);
                          iconColor = const Color(0xfff00000);
                        });
                      },
                      child: const Text('Update properties'),
                    ),
                  ],
                ),
              ),
            ),
          );
        }
      }
      ```
      
      </details> 
      
      ### Before
      
      https://github.com/flutter/flutter/assets/48603081/b29aed98-38ff-40a3-9ed3-c4342ada35b6
      
      ### After
      
      https://github.com/flutter/flutter/assets/48603081/5e0b6a34-c577-40ed-8456-7ef55caa277b
      30234a00
    • Polina Cherkasova's avatar
    • Polina Cherkasova's avatar
    • Matheus Kirchesch's avatar
      Fixed [NavigationRailDestination]'s label opacity while disabled not being... · 2867b31f
      Matheus Kirchesch authored
      Fixed [NavigationRailDestination]'s label opacity while disabled not being coherent with the icon (#132345)
      
      Fixing the opacity of the NavigationRailDestination widget label while
      it is disabled, right now it doesn't get affected by the disabled
      attribute, which doesn't match the icon that gets affected
      
      * https://github.com/flutter/flutter/issues/132344
      
      I believe this PR should be marked as [test-exempt]
      
      ## Pre-launch Checklist
      
      - [x] I read the [Contributor Guide] and followed the process outlined
      there for submitting PRs.
      - [x] I read the [Tree Hygiene] wiki page, which explains my
      responsibilities.
      - [x] I read and followed the [Flutter Style Guide], including [Features
      we expect every widget to implement].
      - [x] I signed the [CLA].
      - [x] I listed at least one issue that this PR fixes in the description
      above.
      - [x] I updated/added relevant documentation (doc comments with `///`).
      - [x] I added new tests to check the change I am making, or this PR is
      [test-exempt].
      - [x] All existing and new tests are passing.
      2867b31f
    • Taha Tesser's avatar
      Fix `TabBar` doesn't use `labelStyle` & `unselectedLabelStyle` color (#133989) · f5355af4
      Taha Tesser authored
      Fixes [TabBar labelStyle.color and unselectedLabelStyle.color does not take effect](https://github.com/flutter/flutter/issues/109484)
      
      ### Code sample
      
      <details>
      <summary>expand to view the code sample</summary> 
      
      ```dart
      import 'package:flutter/material.dart';
      
      /// Flutter code sample for [TabBar].
      
      const Color labelColor = Color(0xFFFF0000);
      const Color unselectedLabelColor = Color(0x95FF0000);
      const TextStyle labelStyle = TextStyle(
        color: Color(0xff0000ff),
        fontWeight: FontWeight.bold,
      );
      const TextStyle unselectedLabelStyle = TextStyle(
        color: Color(0x950000ff),
        fontStyle: FontStyle.italic,
      );
      
      void main() => runApp(const TabBarApp());
      
      class TabBarApp extends StatelessWidget {
        const TabBarApp({super.key});
      
        @override
        Widget build(BuildContext context) {
          return MaterialApp(
            theme: ThemeData(useMaterial3: true),
            home: const TabBarExample(),
          );
        }
      }
      
      class TabBarExample extends StatelessWidget {
        const TabBarExample({super.key});
      
        @override
        Widget build(BuildContext context) {
          return DefaultTabController(
            initialIndex: 1,
            length: 3,
            child: Scaffold(
              appBar: AppBar(
                title: const Text('TabBar Sample'),
                bottom: const TabBar(
                  // labelColor: labelColor,
                  // unselectedLabelColor: unselectedLabelColor,
                  labelStyle: labelStyle,
                  unselectedLabelStyle: unselectedLabelStyle,
                  tabs: <Widget>[
                    Tab(
                      icon: Icon(Icons.cloud_outlined),
                      text: 'Cloudy',
                    ),
                    Tab(
                      icon: Icon(Icons.beach_access_sharp),
                      text: 'Sunny',
                    ),
                    Tab(
                      icon: Icon(Icons.brightness_5_sharp),
                      text: 'Rainy',
                    ),
                  ],
                ),
              ),
              body: const TabBarView(
                children: <Widget>[
                  Center(
                    child: Text("It's cloudy here"),
                  ),
                  Center(
                    child: Text("It's rainy here"),
                  ),
                  Center(
                    child: Text("It's sunny here"),
                  ),
                ],
              ),
            ),
          );
        }
      }
      ```
      
      </details>
      
      #### When `labelStyle` and `unselectedLabelStyle` are specified with a color.
      
      ### Before
      ![image](https://github.com/flutter/flutter/assets/48603081/4138f928-aa63-40bc-9d4e-4d2aeefe72c1)
      
      ### After
      
      ![image](https://github.com/flutter/flutter/assets/48603081/2ce552c5-3972-4b5d-9492-eb487764e58f)
      f5355af4
    • Taha Tesser's avatar
      Fix `DataTable`'s `headingTextStyle` & `dataTextStyle` are not merged with... · 75797a8a
      Taha Tesser authored
      Fix `DataTable`'s `headingTextStyle` & `dataTextStyle` are not merged with default text style (#134138)
      
      fixes [Inconsistent text color on DataTable in different platforms](https://github.com/flutter/flutter/issues/114470)
      
      ### Code sample
      
      <details>
      <summary>expand to view the code sample</summary> 
      
      ```dart
      import 'package:flutter/material.dart';
      
      /// Flutter code sample for [DataTable].
      
      void main() => runApp(const DataTableExampleApp());
      
      class DataTableExampleApp extends StatelessWidget {
        const DataTableExampleApp({super.key});
      
        @override
        Widget build(BuildContext context) {
          return MaterialApp(
            themeMode: ThemeMode.dark,
            theme: ThemeData(),
            darkTheme: ThemeData.dark(),
            home: Scaffold(
              appBar: AppBar(title: const Text('DataTable Sample')),
              body: const DataTableExample(),
            ),
          );
        }
      }
      
      class DataTableExample extends StatelessWidget {
        const DataTableExample({super.key});
      
        @override
        Widget build(BuildContext context) {
          return DataTable(
            headingTextStyle: const TextStyle(),
            dataTextStyle: const TextStyle(),
            columns: const <DataColumn>[
              DataColumn(
                label: Expanded(
                  child: Text(
                    'Name',
                    style: TextStyle(fontStyle: FontStyle.italic),
                  ),
                ),
              ),
              DataColumn(
                label: Expanded(
                  child: Text(
                    'Age',
                    style: TextStyle(fontStyle: FontStyle.italic),
                  ),
                ),
              ),
              DataColumn(
                label: Expanded(
                  child: Text(
                    'Role',
                    style: TextStyle(fontStyle: FontStyle.italic),
                  ),
                ),
              ),
            ],
            rows: const <DataRow>[
              DataRow(
                cells: <DataCell>[
                  DataCell(Text('Sarah')),
                  DataCell(Text('19')),
                  DataCell(Text('Student')),
                ],
              ),
              DataRow(
                cells: <DataCell>[
                  DataCell(Text('Janine')),
                  DataCell(Text('43')),
                  DataCell(Text('Professor')),
                ],
              ),
              DataRow(
                cells: <DataCell>[
                  DataCell(Text('William')),
                  DataCell(Text('27')),
                  DataCell(Text('Associate Professor')),
                ],
              ),
            ],
          );
        }
      }
      
      ```
      
      </details>
      
      ### Before
      
      | Desktop | Mobile |
      | --------------- | --------------- |
      | <img src="https://github.com/flutter/flutter/assets/48603081/19c3908d-6b6a-4408-9c6b-da83c8efaa4a"  /> | <img src="https://github.com/flutter/flutter/assets/48603081/efda08fb-05f9-437e-be5c-6b6861babe19" width="350"  /> |
      
      ### After
      
      | Desktop | Mobile |
      | --------------- | --------------- |
      | <img src="https://github.com/flutter/flutter/assets/48603081/6bd3433f-d61f-4f35-8a2a-f7539a74f93e" /> | <img src="https://github.com/flutter/flutter/assets/48603081/5123a79b-6c2a-4bea-9fbc-64ed3e599826" width="350" /> |
      75797a8a
    • Taha Tesser's avatar
      Reland "Fix `Chip.shape`'s side is not used when provided in Material 3" (#133856) · ded8b8e3
      Taha Tesser authored
      fixes [Chip border side color not working in Material3](https://github.com/flutter/flutter/issues/132922)
      Relands https://github.com/flutter/flutter/pull/132941 with an updated fix and a regression test.
      
      <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(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('Chips'),
            ),
            body: Center(
              child: Column(
                mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                children: <Widget>[
                  const RawChip(
                    shape: RoundedRectangleBorder(
                      side: BorderSide(color: Colors.amber),
                    ),
                    side: BorderSide(color: Colors.red),
                    label: Text('RawChip'),
                  ),
                  const Chip(
                    shape: RoundedRectangleBorder(
                      side: BorderSide(color: Colors.amber),
                    ),
                    side: BorderSide(color: Colors.red),
                    label: Text('Chip'),
                  ),
                  ActionChip(
                    shape: const RoundedRectangleBorder(
                      side: BorderSide(color: Colors.amber),
                    ),
                    side: const BorderSide(color: Colors.red),
                    label: const Text('ActionChip'),
                    onPressed: () {},
                  ),
                  FilterChip(
                    shape: const RoundedRectangleBorder(
                      side: BorderSide(color: Colors.amber),
                    ),
                    side: const BorderSide(color: Colors.red),
                    label: const Text('FilterChip'),
                    onSelected: (value) {},
                  ),
                  ChoiceChip(
                    shape: const RoundedRectangleBorder(
                      side: BorderSide(color: Colors.amber),
                    ),
                    side: const BorderSide(color: Colors.red),
                    label: const Text('ChoiceChip'),
                    selected: false,
                    onSelected: (value) {},
                  ),
                  InputChip(
                    shape: const RoundedRectangleBorder(
                      side: BorderSide(color: Colors.amber),
                    ),
                    side: const BorderSide(color: Colors.red),
                    label: const Text('InputChip'),
                    onSelected: (value) {},
                  ),
                ],
              ),
            ),
          );
        }
      }
      ```
      
      </details>
      
      <img src="https://github.com/flutter/flutter/assets/48603081/f713fd84-cf9a-4e52-8cdb-5faba63d8e91" height="450" /> <img src="https://github.com/flutter/flutter/assets/48603081/a142efc7-041e-4e6e-87cf-e6c4ebe735f3" height="450" />
      
      <img src="https://github.com/flutter/flutter/assets/48603081/377df55b-499f-403f-96c5-0be0334795dc" height="450" /> <img src="https://github.com/flutter/flutter/assets/48603081/731a2752-7822-4605-8e9c-db0a71dd6f08" height="450" />
      ded8b8e3
  3. 06 Sep, 2023 3 commits
    • Burak İmdat's avatar
      Fix `subtitleTextStyle.color` isn't applied to the `ListTile.subtitle` in Material 2 (#133422) · cd9a257d
      Burak İmdat authored
      The difference between header text style and subtitle text style and the reason why it doesn't work is the code difference below. If we make the subtitle text style the same as the title text style it will work
      
      <details>
        <summary>Title Text Style</summary>
        
        ###  All Code
        
        ```dart
        TextStyle titleStyle = titleTextStyle
            ?? tileTheme.titleTextStyle
            ?? defaults.titleTextStyle!;
          final Color? titleColor = effectiveColor;
          titleStyle = titleStyle.copyWith(
            color: titleColor,
            fontSize: _isDenseLayout(theme, tileTheme) ? 13.0 : null,
          );
          final Widget titleText = AnimatedDefaultTextStyle(
            style: titleStyle,
            duration: kThemeChangeDuration,
            child: title ?? const SizedBox(),
          );
        ```
        
        ## Different Code Section
        
        ```dart
        final Color? titleColor = effectiveColor;
        ```
      </details>
      
      <details>
        <summary>Subtitle Text Style</summary>
        
        ## All Code
        
        ```dart
        subtitleStyle = subtitleTextStyle
              ?? tileTheme.subtitleTextStyle
              ?? defaults.subtitleTextStyle!;
            final Color? subtitleColor = effectiveColor
              ?? (theme.useMaterial3 ? null : theme.textTheme.bodySmall!.color);
            subtitleStyle = subtitleStyle.copyWith(
              color: subtitleColor,
              fontSize: _isDenseLayout(theme, tileTheme) ? 12.0 : null,
            );
            subtitleText = AnimatedDefaultTextStyle(
              style: subtitleStyle,
              duration: kThemeChangeDuration,
              child: subtitle!,
            );
        ```
        
        ## Different Code Section
        
        ```dart
        final Color? subtitleColor = effectiveColor
              ?? (theme.useMaterial3 ? null : theme.textTheme.bodySmall!.color);
        ```
      
      ### Description for code 
      - The value `theme.textTheme.bodySmall!.color` is given because the `effectiveColor` value is `null` and the `theme.useMaterial3` value is `false`
      </details>
      
      <details>
        <summary>Problem solved code</summary>
        
        ## All Code
        
        ```dart
        subtitleStyle = subtitleTextStyle
              ?? tileTheme.subtitleTextStyle
              ?? defaults.subtitleTextStyle!;
            final Color? subtitleColor = effectiveColor;
            subtitleStyle = subtitleStyle.copyWith(
              color: subtitleColor,
              fontSize: _isDenseLayout(theme, tileTheme) ? 12.0 : null,
            );
            subtitleText = AnimatedDefaultTextStyle(
              style: subtitleStyle,
              duration: kThemeChangeDuration,
              child: subtitle!,
            );
        ```
      </details>
      
      <details>
      <summary>Screenshot of the result after making the necessary change</summary>
      <img src="https://github.com/flutter/flutter/assets/70351342/b552fd4c-fdcd-4bf5-b4ba-d6b2cfe527cc" width=250>
      </details>
      
      #133412
      
      *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
      cd9a257d
    • Tirth's avatar
      Add `CheckedPopupMenuItem.onTap` callback (#134000) · b0e5a5ca
      Tirth authored
      Adds parent prop `onTap` to CheckedPopupMenuItem.
      
      Fixes #127800
      b0e5a5ca
    • Polina Cherkasova's avatar
  4. 05 Sep, 2023 5 commits
  5. 01 Sep, 2023 3 commits
    • Mark O'Sullivan's avatar
      Fixed `PaginatedDataTable` not using `dataRowMinHeight` and `dataRowMaxHeight` from Theme (#133634) · 1b1c8a16
      Mark O'Sullivan authored
      `PaginatedDataTable` will now make use of `dataRowMinHeight` and `dataRowMaxHeight` from the Theme
      
      *List which issues are fixed by this PR. You must list at least one issue.*
      
      Resolves #133633
      1b1c8a16
    • Bruno Leroux's avatar
      Fix MaterialState.pressed is missing when pressing button with keyboard (#133558) · 510ecaa4
      Bruno Leroux authored
      ## Description
      
      This PR fixes changes how `InkWell` reacts to keyboard activation. 
      
      **Before**: the activation started a splash and immediately terminated it which did not let time for widgets that resolve material state properties to react (visually it also mean the splash does not have time to expand).
      
      **After**: the activation starts and terminates after a delay (I arbitrary choose 200ms for the moment).
      
      ## Related Issue
      
      Fixes https://github.com/flutter/flutter/issues/132377.
      
      ## Tests
      
      Adds one test.
      510ecaa4
    • Andrea Cioni's avatar
      Add an example for `InputChip` generated by user input (#130645) · 400702d1
      Andrea Cioni authored
      New example for `InputChip` that demonstrate how to create/delete them based on user text inputs.
      
      The sample application shows a custom text area where user can enter text. After the user has typed and hits _Enter_ the text will be replaced with an `InputChip` that contains that text. Is it possible to continue typing and add more chips in this way. All of them will be placed in a scrollable horizontal row. Also is it possible to have suggestion displayed below the text input field in case the typed text match some of the available suggestions.
      
      Issue I'm trying to solve:
      
      - https://github.com/flutter/flutter/issues/128247
      
      **Code structure:**
      
      The example app is composed of 2 main components that find places inside `MainScreen`:
      
       - `ChipsInput`
       - `ListView`
      
      `ChipsInput` emulates a `TextField` where you can enter text. This text field accepts also a list of values of generic type T (`Topping` in my example), that gets rendered as `InputChip` inside the text field, before the text inserted by the user. This widgets is basically an `InputDecorator` widget that implements `TextInputClient` to get `TextEditingValue` events from the user keyboard. At the end of the input field there is another component, the `TextCursor`, that is displayed just when the user give the focus to the field and emulates the carrets that `TextField` has.
      
      There are also some available callbacks that the user can use to capture events in the `ChipsInput` field like: `onChanged`, `onChipTapped`, `onSubmitted` and `onTextChanged`. This last callback is used to build a list of suggestion that will be placed just below the `ChipsInput` field inside the `ListView`.
      400702d1
  6. 31 Aug, 2023 1 commit
    • Delwin Mathew's avatar
      `InputDecorationTheme.isCollapsed` doesn't work if... · dd1ee24f
      Delwin Mathew authored
      `InputDecorationTheme.isCollapsed` doesn't work if `InputDecoration.isCollapsed` is not provided. (#133189)
      
      `appleDefault` method didn't include setting values for non-null (here `isCollapsed`) parameters initially, which has been updated and documented in this commit.
      
      Existing and new tests are passing.
      
      Fixes #133144
      dd1ee24f
  7. 30 Aug, 2023 4 commits
    • Taha Tesser's avatar
      Fix `cancelButtonStyle` & `confirmButtonStyle` properties from... · d7a3a682
      Taha Tesser authored
      Fix `cancelButtonStyle` & `confirmButtonStyle` properties  from `TimePickerTheme`  aren't working (#132843)
      
      fixes [`TimePickerThemeData` action buttons styles aren't working](https://github.com/flutter/flutter/issues/132760)
      
      ### 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(
              useMaterial3: true,
              timePickerTheme: TimePickerThemeData(
                cancelButtonStyle: TextButton.styleFrom(
                  shape: const RoundedRectangleBorder(
                    borderRadius: BorderRadius.all(Radius.circular(4)),
                    side: BorderSide(color: Colors.red),
                  ),
                  backgroundColor: Colors.white,
                  foregroundColor: Colors.red,
                  elevation: 3,
                  shadowColor: Colors.red,
                ),
                confirmButtonStyle: TextButton.styleFrom(
                  shape: const RoundedRectangleBorder(
                    borderRadius: BorderRadius.all(Radius.circular(4)),
                  ),
                  backgroundColor: Colors.green[700],
                  foregroundColor: Colors.white,
                  elevation: 3,
                  shadowColor: Colors.green[700],
                ),
              ),
            ),
            home: const Example(),
          );
        }
      }
      
      class Example extends StatelessWidget {
        const Example({super.key});
      
        @override
        Widget build(BuildContext context) {
          return Scaffold(
            body: Center(
              child: TimePickerDialog(initialTime: TimeOfDay.now()),
            ),
          );
        }
      }
      
      ``` 
      
      </details>
      
      ### Before (action buttons don't use the style from the `TimePickerTheme`)
      
      ![Screenshot 2023-08-18 at 14 57 37](https://github.com/flutter/flutter/assets/48603081/c95160e2-76a2-4bb5-84e0-3731fce19c0b)
      
      ### After (action buttons use the style from the `TimePickerTheme`)
      
      ![Screenshot 2023-08-18 at 14 57 18](https://github.com/flutter/flutter/assets/48603081/422d348a-bee2-4696-8d9a-5fce56191aaa)
      d7a3a682
    • Taha Tesser's avatar
      Add `cancelButtonStyle` & `confirmButtonStyle` to the `DatePickerThemeData` (#132847) · 1e770c38
      Taha Tesser authored
      fixes [Unable to adjust the color for "Cancel" and "Ok" button in datePicker dialog](https://github.com/flutter/flutter/issues/127739)
      
      ### 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(
              useMaterial3: true,
              datePickerTheme: DatePickerThemeData(
                cancelButtonStyle: TextButton.styleFrom(
                  shape: const RoundedRectangleBorder(
                    borderRadius: BorderRadius.all(Radius.circular(16)),
                    side: BorderSide(color: Colors.red),
                  ),
                  backgroundColor: Colors.white,
                  foregroundColor: Colors.red,
                  elevation: 3,
                  shadowColor: Colors.red,
                ),
                confirmButtonStyle: TextButton.styleFrom(
                  shape: const RoundedRectangleBorder(
                    borderRadius: BorderRadius.all(Radius.circular(16)),
                  ),
                  backgroundColor: Colors.green[700],
                  foregroundColor: Colors.white,
                  elevation: 3,
                  shadowColor: Colors.green[700],
                ),
              ),
            ),
            home: const Example(),
          );
        }
      }
      
      class Example extends StatelessWidget {
        const Example({super.key});
      
        @override
        Widget build(BuildContext context) {
          return Scaffold(
            body: Center(
              child: DatePickerDialog(
                initialDate: DateTime.now(),
                firstDate: DateTime(2020),
                lastDate: DateTime(2030),
              ),
            ),
          );
        }
      }
      ``` 
      
      </details>
      
      ### Before 
      
      Not possible to customize action buttons from the `DatePickerThemeData`.
      
      ### After 
      
      ![Screenshot 2023-08-18 at 16 42 00](https://github.com/flutter/flutter/assets/48603081/4ec01e93-c661-491d-9253-d687da8b76f3)
      1e770c38
    • Bruno Leroux's avatar
      Expose barrierDismissible in PageRoute constructor (#133659) · b2310527
      Bruno Leroux authored
      ## Description
      
      This PR exposes `barrierDismissible` in `PageRoute`, `MaterialPageRoute` and `CupertinoPageRoute` constructors.
      Setting this property to true will enable the escape key binding.
      
      ## Related Issue
      
      Fixes https://github.com/flutter/flutter/issues/132138.
      
      ## Tests
      
      Adds one test.
      b2310527
    • Xilai Zhang's avatar
      [flutter roll] Revert "Fix `Chip.shape`'s side is not used when provided in Material 3" (#133615) · 6fd42536
      Xilai Zhang authored
      Reverts flutter/flutter#132941
      context: b/298110031
      
      The rounded rectangle borders don't appear in some of the internal
      golden image tests.
      6fd42536
  8. 29 Aug, 2023 3 commits
  9. 28 Aug, 2023 6 commits
  10. 25 Aug, 2023 4 commits
    • Kate Lovett's avatar
    • Taha Tesser's avatar
      Fix `PopupMenuItem` with a `ListTile` doesn't use the correct style. (#133141) · ea005219
      Taha Tesser authored
      fixes [`PopupMenuItem` with a `ListTile`  doesn't use the correct text style.](https://github.com/flutter/flutter/issues/133138)
      
      ### Description
      
      This fixes an issue text style issue for `PopupMenuItem` with a `ListTile` (for an elaborate popup menu) 
      
      https://api.flutter.dev/flutter/material/PopupMenuItem-class.html
      
      <details> 
      <summary>expand to view the code sample</summary> 
      
      ```dart
      import 'package:flutter/material.dart';
      
      /// Flutter code sample for [PopupMenuButton].
      
      // This is the type used by the popup menu below.
      enum SampleItem { itemOne, itemTwo, itemThree }
      
      void main() => runApp(const PopupMenuApp());
      
      class PopupMenuApp extends StatelessWidget {
        const PopupMenuApp({super.key});
      
        @override
        Widget build(BuildContext context) {
          return MaterialApp(
            theme: ThemeData(
              useMaterial3: true,
              textTheme: const TextTheme(
                labelLarge: TextStyle(
                  fontStyle: FontStyle.italic,
                  fontWeight: FontWeight.bold,
                ),
              ),
            ),
            home: const PopupMenuExample(),
          );
        }
      }
      
      class PopupMenuExample extends StatefulWidget {
        const PopupMenuExample({super.key});
      
        @override
        State<PopupMenuExample> createState() => _PopupMenuExampleState();
      }
      
      class _PopupMenuExampleState extends State<PopupMenuExample> {
        SampleItem? selectedMenu;
      
        @override
        Widget build(BuildContext context) {
          return Scaffold(
            body: Center(
              child: SizedBox(
                width: 300,
                height: 130,
                child: Align(
                  alignment: Alignment.topLeft,
                  child: PopupMenuButton<SampleItem>(
                    initialValue: selectedMenu,
                    // Callback that sets the selected popup menu item.
                    onSelected: (SampleItem item) {
                      setState(() {
                        selectedMenu = item;
                      });
                    },
                    itemBuilder: (BuildContext context) =>
                        <PopupMenuEntry<SampleItem>>[
                      const PopupMenuItem<SampleItem>(
                        value: SampleItem.itemOne,
                        child: Text('PopupMenuItem'),
                      ),
                      const CheckedPopupMenuItem<SampleItem>(
                        checked: true,
                        value: SampleItem.itemTwo,
                        child: Text('CheckedPopupMenuItem'),
                      ),
                      const PopupMenuItem<SampleItem>(
                        value: SampleItem.itemOne,
                        child: ListTile(
                          leading: Icon(Icons.cloud),
                          title: Text('ListTile'),
                          contentPadding: EdgeInsets.zero,
                          trailing: Icon(Icons.arrow_right_rounded),
                        ),
                      ),
                    ],
                  ),
                ),
              ),
            ),
          );
        }
      }
      ``` 
      
      </details>
      
      ### Before
      
      ![Screenshot 2023-08-23 at 14 08 48](https://github.com/flutter/flutter/assets/48603081/434ac95e-2981-4ab5-9843-939b39d771a2)
      
      ### After
      
      ![Screenshot 2023-08-23 at 14 08 32](https://github.com/flutter/flutter/assets/48603081/f6aba7e0-3d03-454f-8e0b-c031492f3f2d)
      ea005219
    • Taha Tesser's avatar
      Fix `Chip.shape`'s side is not used when provided in Material 3 (#132941) · 612117a6
      Taha Tesser authored
      fixes [Chip border side color not working in Material3](https://github.com/flutter/flutter/issues/132922)
      
      ### 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(
            theme: ThemeData(
              useMaterial3: true,
              chipTheme: const ChipThemeData(
                  // shape: RoundedRectangleBorder(
                  //   side: BorderSide(color: Colors.amber),
                  //   borderRadius: BorderRadius.all(Radius.circular(12)),
                  // ),
                  // side: BorderSide(color: Colors.red),
                  ),
            ),
            home: const Example(),
          );
        }
      }
      
      class Example extends StatelessWidget {
        const Example({super.key});
      
        @override
        Widget build(BuildContext context) {
          return const Scaffold(
            body: Center(
              child: RawChip(
                shape: RoundedRectangleBorder(
                  side: BorderSide(color: Colors.amber),
                  borderRadius: BorderRadius.all(Radius.circular(12)),
                ),
                // side: BorderSide(color: Colors.red),
                label: Text('Chip'),
              ),
            ),
          );
        }
      }
      
      ``` 
      
      </details>
      
      ---
      
      ### Before
      
      When `RawChip.shape` is provided with a `BorderSide`.
      
      ```dart
            body: Center(
              child: RawChip(
                shape: RoundedRectangleBorder(
                  side: BorderSide(color: Colors.amber),
                  borderRadius: BorderRadius.all(Radius.circular(12)),
                ),
                label: Text('Chip'),
              ),
            ),
      ```
      
      ![Screenshot 2023-08-24 at 17 54 54](https://github.com/flutter/flutter/assets/48603081/89e2c9b5-44c2-432e-97ff-8bb95b0d0fb1)
      
      When `RawChip.shape` is provided with a `BorderSide` and also `RawChip.side` is provided. The  `RawChip.side` overrides the shape's side.
      
      ```dart
            body: Center(
              child: RawChip(
                shape: RoundedRectangleBorder(
                  side: BorderSide(color: Colors.amber),
                  borderRadius: BorderRadius.all(Radius.circular(12)),
                ),
                side: BorderSide(color: Colors.red),
                label: Text('Chip'),
              ),
            ),
      ```
      
      ![Screenshot 2023-08-24 at 17 55 37](https://github.com/flutter/flutter/assets/48603081/938803cc-d514-464b-b06b-e4841b9ad040)
      
      ---
      
      ### After
      
      When `RawChip.shape` is provided with a `BorderSide`.
      
      ```dart
            body: Center(
              child: RawChip(
                shape: RoundedRectangleBorder(
                  side: BorderSide(color: Colors.amber),
                  borderRadius: BorderRadius.all(Radius.circular(12)),
                ),
                label: Text('Chip'),
              ),
            ),
      ```
      
      ![Screenshot 2023-08-24 at 17 51 29](https://github.com/flutter/flutter/assets/48603081/d6fcaaa9-8f5d-4180-ad14-062dd459ec45)
      
      When `RawChip.shape` is provided with a `BorderSide` and also `RawChip.side` is provided. The  `RawChip.side` overrides the shape's side.
      
      ```dart
            body: Center(
              child: RawChip(
                shape: RoundedRectangleBorder(
                  side: BorderSide(color: Colors.amber),
                  borderRadius: BorderRadius.all(Radius.circular(12)),
                ),
                side: BorderSide(color: Colors.red),
                label: Text('Chip'),
              ),
            ),
      ```
      
      ![Screenshot 2023-08-24 at 17 52 31](https://github.com/flutter/flutter/assets/48603081/3fa46341-43f0-4fe7-a922-f1d8ba34028c)
      
      ---
      612117a6
    • Tomasz Gucio's avatar
      Dispose overlay entries (#132826) · 5c17a37b
      Tomasz Gucio authored
      5c17a37b