Greg Spencer
301577a34f
Fixing a memory leak in About box/dialog overlays ( #130842 )
...
## Description
Fix three memory leaks detected by `about_test.dart`, but were really in the `Route` and `OverlayEntry` classes.
## Related Issues
- Fixes https://github.com/flutter/flutter/issues/130354
## Tests
- Updates about_test.dart to not ignore the leaks anymore.
2023-08-15 21:58:21 +00:00
Polina Cherkasova
f0e7c51816
Upgrade flutter packages. ( #132585 )
2023-08-15 13:50:17 -07:00
Srujan Gaddam
03b9911a07
Make completeError be a proper JS function ( #132492 )
...
Function.toJS will start requiring that the function accept and return
JS types only.
Allows https://dart-review.googlesource.com/c/sdk/+/316867 to land.
2023-08-15 11:50:31 -07:00
Ian Hickson
cc0d63ea66
Further clarification of the TextSelectionControls migration ( #132539 )
...
Further follow-up for https://github.com/flutter/flutter/issues/122421 .
2023-08-15 16:37:16 +00:00
Ian Hickson
ccdf826466
PaginatedDataTable improvements ( #131374 )
...
- slightly improved assert message when row cell counts don't match column count.
- more breadcrumbs in API documentation. more documentation in general.
- added more documentation for the direction of the "ascending" arrow.
- two samples for PaginatedDataTable.
- make PaginatedDataTable support hot reloading across changes to the number of columns.
- introduce matrix3MoreOrLessEquals. An earlier version of this PR used it in tests, but eventually it was not needed. The function seems useful to keep though.
2023-08-15 00:55:07 +00:00
Renzo Olivares
9a39a5d697
Selection area should move selection word by word on a long press drag ( #132518 )
...
On native iOS and Android when long pressing and then dragging the selection expands word by word. Before this change `SelectionArea` expanded the selection character by character on a long press drag.
Fixes #104603
2023-08-14 22:51:05 +00:00
Polina Cherkasova
a7b69b069f
Unpin leak_tracker and handle breaking changes in API. ( #132352 )
2023-08-14 10:05:20 -07:00
Casey Hillers
7ce2d83b84
Revert "Fix PopupMenuItem & CheckedPopupMenuItem has redundant ListTile padding and update default horizontal padding for Material 3" ( #132457 )
...
Reverts flutter/flutter#131609
b/295497265 - This broke Google Testing. We'll need the internal patch
before landing as there's a large number of customer codebases impacted.
2023-08-13 14:27:01 -07:00
LongCatIsLooong
881945ddb8
Read --dart-define in RendererBinding.initInstances() ( #132408 )
...
Move `SKPARAGRAPH_REMOVE_ROUNDING_HACK` reading to the framework from `dart:ui` so `flutter run --dart-define="SKPARAGRAPH_REMOVE_ROUNDING_HACK=false"` works
2023-08-12 01:56:22 +00:00
Renzo Olivares
457d00449d
Add double click and double click + drag gestures to SelectionArea ( #124817 )
...
Adds double click to select a word.
Adds double click + drag to select word by word.
https://user-images.githubusercontent.com/948037/234363577-941c36bc-ac42-4b7f-84aa-26b106c9ff05.mov
Partially fixes #104552
2023-08-11 21:08:39 +00:00
Ian Hickson
a2e2574941
Remove the fast reassemble / single widget reload feature ( #132255 )
...
Fixes https://github.com/flutter/flutter/issues/132157
2023-08-10 21:48:06 +00:00
pdblasi-google
5df1c996ad
Adds SemanticsNode Finders for searching the semantics tree ( #127137 )
...
* Pulled `FinderBase` out of `Finder`
* `FinderBase` can be used for any object, not just elements
* Terminology was updated to be more "find" related
* Re-implemented `Finder` using `FinderBase<Element>`
* Backwards compatibility maintained with `_LegacyFinderMixin`
* Introduced base classes for SemanticsNode finders
* Introduced basic SemanticsNode finders through `find.semantics`
* Updated some relevant matchers to make use of the more generic `FinderBase`
Closes #123634
Closes #115874
2023-08-10 21:31:06 +00:00
Renzo Olivares
73e0dbf5f4
TextField should correctly resolve provided style for material states ( #132330 )
...
This change makes sure the style provided through the `TextField`s `style` parameter is resolved for material states before merging it with defaults.
Fixes #132212
2023-08-10 21:25:05 +00:00
Ian Hickson
1e35d3a6b7
setState documentation ( #132090 )
...
Fixes https://github.com/flutter/flutter/issues/12296
2023-08-10 21:14:06 +00:00
Ian Hickson
4d42f1a852
GridView sample code ( #131900 )
2023-08-10 20:53:05 +00:00
Polina Cherkasova
60634c65b2
Upgrade flutter packages. ( #132326 )
2023-08-10 13:44:05 -07:00
LongCatIsLooong
e1fd2ace92
TextPainter migration cleanup ( #132317 )
...
Undo temporary changes made in #132094
2023-08-10 20:18:51 +00:00
Ian Hickson
f9a578dd82
An example of parentData usage. ( #131818 )
2023-08-10 19:40:06 +00:00
Fré Dumazy
e972d5a3f6
Add hasInteractedByUser getter in FormField ( #131539 )
...
Adds a getter to access the value of the private `RestorableBool _hasInteractedByUser`.
*List which issues are fixed by this PR. You must list at least one issue.*
Fixes #131538
2023-08-10 18:53:56 +00:00
Taha Tesser
96e02c61dc
Fix PopupMenuItem & CheckedPopupMenuItem has redundant ListTile padding and update default horizontal padding for Material 3 ( #131609 )
...
fixes [`PopupMenuItem` adds redundant padding when using `ListItem`](https://github.com/flutter/flutter/issues/128553 )
### Description
- Fixed redundant `ListTile` padding when using `CheckedPopupMenuItem` or `PopupMenuItem` with the `ListTile` child for complex popup menu items as suggested in the docs.
- Updated default horizontal padding for popup menu items.
### Code sample
<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),
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(
appBar: AppBar(title: const Text('PopupMenuButton')),
body: Center(
child: SizedBox(
width: 150,
height: 100,
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

- Default horizontal padding is the same as M2 (16.0), while the specs use a smaller value (12.0)
- `ListTile` nested by default in `CheckedPopupMenuItem` has redundant padding
- `PopupMenuItem` using `ListTile` as a child for complex menu items contains redundant padding.

### After
- Default horizontal padding is updated for Material 3.
- `PopupMenuItem` & `CheckedPopupMenuItem` override `ListTile` padding (similar to how `ExpansionTile` overrides `ListTile` text and icon color.

2023-08-10 16:05:03 +00:00
Taha Tesser
bb6b72d6c6
Fix DropdownButtonFormField input border clipping ( #131481 )
...
fixes [BUG: DropdownButtonFormField input decorator focus/hover is not clipped
](https://github.com/flutter/flutter/issues/131282 )
### Description
This fixes an issue where `DropdownButtonFormField`'s input border isn't used for clipping with `InkWell`.
### Before

### After

2023-08-10 08:36:17 +00:00
Kate Lovett
0c80ed6d12
Keep alive support for 2D scrolling ( #131641 )
...
Fixes https://github.com/flutter/flutter/issues/126297
This adds support for keep alive to the 2D scrolling foundation. The TwoDimensionalChildBuilderDelegate and TwoDimensionalChildListDelegate will both add automatic keep alives to their children, matching the convention from SliverChildDelegates. The TwoDimensionalViewportParentData now incorporates keep alive and which is managed by the RenderTwoDimensionalViewport.
2023-08-10 05:46:05 +00:00
LongCatIsLooong
9156f6b5f3
Add missing ignore: deprecated_member_use to unblock the engine roller ( #132280 )
...
## Pre-launch Checklist
- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2023-08-09 22:00:05 -07:00
Sam Rawlins
9a32f24a34
Fix prefer_null_aware_operators violation ( #132242 )
...
Use a null-aware `?.` operator instead of a conditional operator. This complies with the `prefer_null_aware_operators` rule. Fixes https://github.com/flutter/flutter/issues/132241
*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
2023-08-10 03:08:11 +00:00
LongCatIsLooong
3f831b694f
Making TextPainter rounding hack disabled by default ( #132094 )
...
Migrate tests in flutter/flutter. Once the tests here and in `*_customer_testing` are migrated, the default value of the migration flag will be changed from false to true, making the rounding hack disabled by default.
2023-08-10 00:30:52 +00:00
Ian Hickson
9c8f3950e3
Sample code for ImageProvider ( #131952 )
...
Also:
- minor improvements to documentation
- wrap one of our test error messages in a manner more consistent with other messages
2023-08-09 22:58:26 +00:00
Tae Hyung Kim
702b78c6be
Remove shrinkWrap from flexible_space_bar_test.dart ( #132173 )
...
See title.
2023-08-09 22:29:58 +00:00
Bernardo Ferrari
6da6fbf5a8
Deprecate describeEnum. ( #125016 )
...
Final part of https://github.com/flutter/flutter/issues/123346 .
2023-08-09 21:58:52 +00:00
Justin McCandless
f5ceaf9810
Handle hasStrings on web ( #132093 )
...
By default, Flutter web uses the browser's built-in context menu.
<img width="200" src="https://github.com/flutter/flutter/assets/389558/990f99cb-bc38-40f1-9e88-8839bc342da5 " />
As of [recently](https://github.com/flutter/engine/pull/38682 ), it's possible to use a Flutter-rendered context menu like the other platforms.
```dart
void main() {
runApp(const MyApp());
BrowserContextMenu.disableContextMenu();
}
```
But there is a bug (https://github.com/flutter/flutter/issues/129692 ) that the Paste button is missing and never shows up.
<img width="284" alt="Screenshot 2023-08-07 at 2 39 03 PM" src="https://github.com/flutter/flutter/assets/389558/f632be25-28b1-4e2e-98f7-3bb443f077df ">
The reason why it's missing is that Flutter first checks if there is any pasteable text on the clipboard before deciding to show the Paste button using the `hasStrings` platform channel method, but that was never implemented for web ([original hasStrings PR](https://github.com/flutter/flutter/pull/87678 )).
So let's just implement hasStrings for web? No, because Chrome shows a permissions prompt when the clipboard is accessed, and there is [no browser clipboard API](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API ) to avoid it. The prompt will show immediately when the EditableText is built, not just when the Paste button is pressed.
<img width="200" src="https://github.com/flutter/flutter/assets/389558/5abdb160-1b13-4f1a-87e1-4653ca19d73e " />
### This PR's solution
Instead, before implementing hasStrings for web, this PR disables the hasStrings check for web. The result is that users will always see a paste button, even in the (unlikely) case that they have nothing pasteable on the clipboard. However, they will not see a permissions dialog until they actually click the Paste button. Subsequent pastes don't show the permission dialog.
<details>
<summary>Video of final behavior with this PR</summary>
https://github.com/flutter/flutter/assets/389558/ed16c925-8111-44a7-99e8-35a09d682748
</details>
I think this will be the desired behavior for the vast majority of app developers. Those that want different behavior can use hasStrings themselves, which will be implemented in https://github.com/flutter/engine/pull/43360 .
### References
Fixes https://github.com/flutter/flutter/issues/129692
Engine PR to be merged after this: https://github.com/flutter/engine/pull/43360
2023-08-09 20:36:45 +00:00
Renzo Olivares
6ac161f909
Add an example for TapAndPanGestureRecognizer ( #131873 )
...
This adds an example for `TapAndPanGestureRecognizer` that demonstrates how to scale a widget using a double tap + vertical drag gesture.
https://github.com/flutter/flutter/assets/948037/4c6c5467-2157-4b6a-bc52-264a3b6303de
2023-08-09 19:59:03 +00:00
Mouad Debbar
632681da99
Reland "[web] Migrate framework to fully use package:web ( #128901 )" ( #132092 )
...
Relanding https://github.com/flutter/flutter/pull/128901
Part of https://github.com/flutter/flutter/issues/113402
Part of https://github.com/flutter/flutter/issues/127030
2023-08-09 19:41:45 +00:00
Zachary Anderson
f4c25bbb35
Revert "Handle breaking changes in leak_tracker." ( #132223 )
...
Reverts flutter/flutter#131998
Reverting for https://github.com/flutter/flutter/issues/132222
2023-08-09 08:14:39 -07:00
LongCatIsLooong
aac018974f
Use pattern matching to avoid strange type annotations ( #131964 )
...
Addresses https://github.com/flutter/flutter/pull/131640#discussion_r1284861384
2023-08-09 04:43:57 +00:00
LongCatIsLooong
5de6684b9c
Add more info to OverlayState.insert error messages ( #129363 )
...
I was debugging an Overlay issue and felt I could have identified the problem faster if the existing assertions provided more information about the current state of the OverlayEntry and Overlay.
2023-08-09 00:53:10 +00:00
Qun Cheng
0bc5a2bca4
Add textCapitalization property for SearchBar and SearchAnchor ( #131459 )
...
This is to add `textCapitalization` property for `SearchBar` and `SearchAnchor`.
Fixes : #131260
2023-08-08 23:24:19 +00:00
Jesús S Guerrero
2728ba0f23
Revert of #120385 ( #132167 )
...
Breaking google testing
revert of: https://github.com/flutter/flutter/pull/120385
b/295065534
2023-08-08 16:16:52 -07:00
Taha Tesser
b77b149df6
Add PopupMenuButton.iconColor, PopupMenuTheme.iconSize and fix button icon using unexpected color propert ( #132054 )
...
fixes [PopupMenuButton uses color property for icon color](https://github.com/flutter/flutter/issues/127802 )
fixes [`popup_menu_test.dart` lacks default icon color tests.](https://github.com/flutter/flutter/issues/132050 )
### Description
- Add `PopupMenuButton..iconColor` and fix the PopupMenu button icon using an unexpected color property.
- Add the missing `PopupMenuTheme.iconSize`.
- Clean up some tests and minor improvements.
### Code sample
<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(
popupMenuTheme: PopupMenuThemeData(
// iconSize: 75,
// iconColor: Colors.amber,
color: Colors.deepPurple[100],
),
),
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(
appBar: AppBar(title: const Text('PopupMenuButton')),
body: Center(
child: PopupMenuButton<SampleItem>(
iconSize: 75,
// iconColor: Colors.amber,
color: Colors.deepPurple[100],
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('Item 1'),
),
const PopupMenuItem<SampleItem>(
value: SampleItem.itemTwo,
child: Text('Item 2'),
),
const PopupMenuDivider(),
const CheckedPopupMenuItem<SampleItem>(
value: SampleItem.itemThree,
checked: true,
child: Text('Item 3'),
),
],
),
),
);
}
}
```
</details>


2023-08-08 22:23:30 +00:00
Ian Hickson
e65c37ee45
More PageStorage clarity in the documentation ( #131954 )
...
Fixes https://github.com/flutter/flutter/issues/10867
2023-08-08 22:08:32 +00:00
Taha Tesser
ee47267d26
Fix TabBarTheme.indicatorColor not applied in Material 2 ( #132123 )
...
fixes [[Proposal] Improve TabBarTheme styling API for indicator color ](https://github.com/flutter/flutter/issues/130392 )
### Description
This fixes an issue where the `TabBarTheme.indicator` isn't applied in Material 2 and also adds indicator color tests for both M3 and M2.
### Code sample
<details>
<summary>expand to view the code sample</summary>
```dart
import 'package:flutter/material.dart';
/// Flutter code sample for [TabBar].
void main() => runApp(const TabBarApp());
class TabBarApp extends StatelessWidget {
const TabBarApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
useMaterial3: false,
tabBarTheme: const TabBarTheme(
indicatorColor: Colors.amber,
)
),
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(
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>
### Before

### After

2023-08-08 19:37:16 +00:00
Aakash Pamnani
0b81347897
Paginated Data Table : Fixed Row number at footer in last page ( #130389 )
...
Fixed the row count in the footer.
Before

After

*Issues Resolved*
Fixes #80421
2023-08-08 19:25:53 +00:00
LouiseHsu
d9cb50e63d
[framework] Add Search Web to selection controls for iOS ( #131898 )
...
This PR adds framework support for the Search Web feature in iOS.
https://github.com/flutter/flutter/assets/36148254/c159f0d9-8f14-45e7-b295-e065b0826fab
The corresponding merged engine PR can be found [here](https://github.com/flutter/engine/pull/43324 ).
This PR addresses https://github.com/flutter/flutter/issues/82907
More details are available in this [design doc](https://docs.google.com/document/d/1QizXwBiO-2REIcEovl5pK06BaLPOWYmNwOE5jactJZA/edit?resourcekey=0-1pb9mJiAq29Gesmt25GAug )
2023-08-08 17:34:17 +00:00
Justin McCandless
9655311545
Remove Iterator from _History ( #132101 )
...
Cleaning up private code in Navigator.
2023-08-08 10:25:27 -07:00
Ian Hickson
9dbd1e9872
More documentation about warm-up frames ( #132085 )
2023-08-08 17:11:15 +00:00
Polina Cherkasova
acd636f7ba
Handle breaking changes in leak_tracker. ( #131998 )
2023-08-08 09:39:19 -07:00
Jesús S Guerrero
cef00d0c53
Revert "Replace TextField.canRequestFocus with TextField.focusNode.canRequestFocus" ( #132104 )
...
Reverts flutter/flutter#130164
reverting because it cause internal google testing failures b/294917394
2023-08-07 17:30:07 -07:00
chunhtai
b01cb301cf
Adds more documentations around ignoreSemantics deprecations. ( #131287 )
...
migration guide update https://github.com/flutter/website/pull/9124
fixes the concerns in https://github.com/flutter/flutter/pull/120619
2023-08-07 23:59:48 +00:00
Mouad Debbar
55fe41be59
[web] New HtmlElementView.fromTagName constructor ( #130513 )
...
This wraps up the platform view improvements discussed in https://github.com/flutter/flutter/issues/127030 .
- Splits `HtmlElementView` into 2 files that are conditionally imported.
- The non-web version can be instantiated but it throws if it ends up being built in a widget tree.
- Out-of-the-box view factories that create visible & invisible DOM elements given a `tagName` parameter.
- New `HtmlElementView.fromTagName()` constructor that uses the default factories to create DOM elements.
- Tests covering the new API.
Depends on https://github.com/flutter/engine/pull/43828
Fixes https://github.com/flutter/flutter/issues/127030
2023-08-07 23:45:19 +00:00
Kate Lovett
f054f5aa09
Move mock canvas to flutter_test ( #131631 )
...
Fixes https://github.com/flutter/flutter/issues/59413
This relocates `mock_canvas.dart` and `recording_canvas.dart` from `flutter/test/rendering` to `flutter_test`.
The testing functionality afforded by mock_canvas should be available to everyone, not just the framework. :)
mock_canvas.dart needed a bit of cleanup - things like formatting and super parameters.
2023-08-07 23:43:03 +00:00
Justin McCandless
ebbb4b3887
Android context menu theming and visual update ( #131816 )
...
Fixes https://github.com/flutter/flutter/issues/89939 and updates the look of the Android context menu to match API 34.
## The problem
Before this PR, setting `surface` in the color scheme caused the background color of the Android context menu to change, but it wasn't possible to change the text color.
```dart
MaterialApp(
theme: ThemeData(
// Using a dark theme made the context menu text color be white.
colorScheme: ThemeData.dark().colorScheme.copyWith(
// Setting the surface here worked.
surface: Colors.white,
// But there was no way to set the text color. This didn't work.
onSurface: Colors.black,
),
),
),
```
| Expected (after PR) | Actual (before PR) |
| --- | --- |
| <img width="239" alt="Screenshot 2023-08-07 at 11 45 37 AM" src="https://github.com/flutter/flutter/assets/389558/a9fb75e5-b6c3-4f8e-8c59-2021780c44a7 "> | <img width="250" alt="Screenshot 2023-08-07 at 11 51 10 AM" src="https://github.com/flutter/flutter/assets/389558/a5abd2d2-49bb-47a0-836f-864d56af2f58 "> |
## Other examples
<table>
<tr>
<th>Scenario</th>
<th>Result</th>
</tr>
<tr>
<td>
```dart
MaterialApp(
theme: ThemeData(
colorScheme: ThemeData.light(),
),
...
),
```
</td>
<td>
<img width="244" alt="Screenshot 2023-08-07 at 11 42 05 AM" src="https://github.com/flutter/flutter/assets/389558/74c6870b-5ff7-4b1a-9e0c-b2bb4809ef1e ">
</td>
</tr>
<tr>
<td>
```dart
MaterialApp(
theme: ThemeData(
colorScheme: ThemeData.dark(),
),
...
),
```
</td>
<td>
<img width="239" alt="Screenshot 2023-08-07 at 11 42 23 AM" src="https://github.com/flutter/flutter/assets/389558/91fe32f8-bd62-4d9b-96e8-ae5a9a769745 ">
</td>
</tr>
<tr>
<td>
```dart
MaterialApp(
theme: ThemeData(
colorScheme: ThemeData.light().colorScheme.copyWith(
surface: Colors.blue,
onSurface: Colors.red,
),
),
...
),
```
</td>
<td>
<img width="240" alt="Screenshot 2023-08-07 at 11 43 06 AM" src="https://github.com/flutter/flutter/assets/389558/e5752f8b-3738-4391-9055-15c38bd4af21 ">
</td>
</tr>
<tr>
<td>
```dart
MaterialApp(
theme: ThemeData(
colorScheme: ThemeData.light().colorScheme.copyWith(
surface: Colors.blue,
onSurface: Colors.red,
),
),
...
),
```
</td>
<td>
<img width="244" alt="Screenshot 2023-08-07 at 11 42 47 AM" src="https://github.com/flutter/flutter/assets/389558/68cc68f0-b338-4d94-8810-d8e46fb1e48e ">
</td>
</tr>
</table>
2023-08-07 20:59:08 +00:00
xhzq233
ff5b0e1457
CupertinoContextMenu improvement ( #131030 )
...
Fixes overlapping gestures in CupertinoContextMenu's subtree
2023-08-07 09:30:21 -07:00