- 08 Sep, 2023 3 commits
-
-
Taha Tesser authored
fixes [`Drawer` examples are misssing `dartpad` tag]( https://github.com/flutter/flutter/issues/134217) these examples were updated in https://github.com/flutter/flutter/pull/130523
-
Polina Cherkasova authored
-
Polina Cherkasova authored
-
- 07 Sep, 2023 8 commits
-
-
Polina Cherkasova authored
Relanding of revert: https://github.com/flutter/flutter/pull/134072 Verified failed tests succeeded now:
-
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
-
Polina Cherkasova authored
-
Polina Cherkasova authored
-
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.
-
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  ### After 
-
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" /> |
-
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" />
-
- 06 Sep, 2023 3 commits
-
-
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].*
-
Tirth authored
Adds parent prop `onTap` to CheckedPopupMenuItem. Fixes #127800
-
Polina Cherkasova authored
-
- 05 Sep, 2023 5 commits
-
-
Polina Cherkasova authored
Reverts flutter/flutter#133947 as it causes build failures.
-
Polina Cherkasova authored
-
Polina Cherkasova authored
-
Polina Cherkasova authored
-
Polina Cherkasova authored
-
- 01 Sep, 2023 3 commits
-
-
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
-
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.
-
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`.
-
- 31 Aug, 2023 1 commit
-
-
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
-
- 30 Aug, 2023 4 commits
-
-
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`)  ### After (action buttons use the style from the `TimePickerTheme`) 
-
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 
-
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.
-
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.
-
- 29 Aug, 2023 3 commits
-
-
Polina Cherkasova authored
-
Hans Muller authored
-
Taha Tesser authored
fixes [Additional color mappings for FAB in Material 3](https://github.com/flutter/flutter/issues/130702) ### Preview 
-
- 28 Aug, 2023 6 commits
-
-
Polina Cherkasova authored
-
Renzo Olivares authored
Fixes #133027 When setting a `textButtonTheme` it should not override the native context menu colors. ```dart theme: ThemeData( textButtonTheme: const TextButtonThemeData( style: ButtonStyle( backgroundColor: MaterialStatePropertyAll<Color>( Color(0xff05164d)), // blue color ), ), ), ``` Before|After --|-- <img width="341" alt="Screenshot 2023-08-24 at 1 17 25 PM" src="https://github.com/flutter/flutter/assets/948037/30ea0ef8-b41a-4e1f-93a3-50fcd87ab2bf">|<img width="341" alt="Screenshot 2023-08-24 at 1 15 35 PM" src="https://github.com/flutter/flutter/assets/948037/5f59481c-aa5d-4850-aa4b-daa678e54044">
-
Taha Tesser authored
Fix `DatePickerDialog` & `DateRangePickerDialog` overflow when resized from landscape to portrait (#133327) fixes [resize window with a `showDateRangePicker` will make RenderFlex overflowed error](https://github.com/flutter/flutter/issues/131989) ### Description - This fixes `DatePickerDialog` & `DateRangePickerDialog` overflow error when resized from landscape to portrait. - Added tests that check these two widgets from landscape to portrait for no overflow errors. <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> { bool _portait = false; @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text('DatePicker & DateRangePicker'), ), body: MediaQuery( data: MediaQuery.of(context).copyWith( size: _portait ? const Size(400, 800) : const Size(800, 400), ), child: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ DatePickerDialog( initialDate: DateTime.now(), firstDate: DateTime(2020), lastDate: DateTime(2030), initialEntryMode: DatePickerEntryMode.inputOnly, ), DateRangePickerDialog( currentDate: DateTime.now(), firstDate: DateTime(2020), lastDate: DateTime(2030), initialEntryMode: DatePickerEntryMode.inputOnly, ), ], ), ), floatingActionButton: FloatingActionButton( onPressed: () { setState(() { _portait = !_portait; }); }, child: const Icon(Icons.refresh), ), ); } } ``` </details> ### Before https://github.com/flutter/flutter/assets/48603081/81387cbb-cdcf-42bd-b4f8-b7a08317c955 ### After https://github.com/flutter/flutter/assets/48603081/36d28ea9-cfed-48ad-90f5-0459755e08c0
-
Victoria Ashworth authored
Reverts flutter/flutter#133352 Tree is failing on Mac and Linux customer_testing on this PR. https://ci.chromium.org/ui/p/flutter/builders/prod/Mac%20customer_testing/14646/overview https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20customer_testing/14974/overview
-
Polina Cherkasova authored
-
Salmanul Farisi.M authored
Paginated datatable widget cannot give color to table header fixes #132428 --------- Co-authored-by:
Hans Muller <hansmuller@google.com>
-
- 25 Aug, 2023 4 commits
-
-
Kate Lovett authored
-
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  ### After 
-
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'), ), ), ```  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'), ), ), ```  --- ### 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'), ), ), ```  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'), ), ), ```  ---
-
Tomasz Gucio authored
-