David Iglesias
ad5235b4e4
[CP] Migrate web-only initialization APIs ( #133891 )
...
This CP lands PR https://github.com/flutter/flutter/pull/129856 into `stable`.
The PR above was part of a engine+framework change that got split in half during the stable cut, so now users are seeing some warnings that they can't act on.
(Those warnings were only intended for people who were using our methods manually, rather than using normal flutter tooling).
## Issues
Fixes https://github.com/flutter/flutter/issues/133069
2023-09-06 01:44:49 +00:00
Kate Lovett
441432b5be
[CP] Fix visual overflow for SliverMainAxisGroup ( #132989 ) ( #133057 )
...
Cherry picks https://github.com/flutter/flutter/pull/132989 which fixes
https://github.com/flutter/flutter/issues/132788
Fixes https://github.com/flutter/flutter/issues/133058
## 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.
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-09-05 09:51:37 -07:00
Kate Lovett
ff5b5b5fa6
[CP] Fix lower bound of children from TwoDimensionalChildBuilderDelegate ( #132764 )
...
Found in https://github.com/flutter/packages/pull/4536
The max x and max y index should allow for a case where there are no children in the viewport. This should be CP'd into stable once it lands.
2023-08-24 13:12:28 +00:00
LongCatIsLooong
95b3a3ed98
[CP] Constrain _RenderScaledInlineWidget child size in computeDryLayout #131765 ( #132096 )
...
CP request: https://github.com/flutter/flutter/issues/132095
2023-08-08 17:57:04 +00:00
LongCatIsLooong
85127f4f94
[Cp] Fix Tooltip crash when selected in a SelectableRegion ( #130181 ) ( #131288 )
...
CP: https://github.com/flutter/flutter/issues/131005
2023-08-07 22:25:45 +00:00
LongCatIsLooong
f4c42610bb
[CP] _RenderScaledInlineWidget constrains child size ( #130648 ) ( #131289 )
...
CP: https://github.com/flutter/flutter/issues/131004
2023-08-07 22:23:17 +00:00
LongCatIsLooong
5c4bfbcc85
[CP] Allow OverlayPortal to be added/removed from the tree in a layout callback ( #130670 ) ( #131290 )
...
CP https://github.com/flutter/flutter/issues/131002
2023-08-07 22:23:16 +00:00
Kate Lovett
945b12da6a
[CP] Minor adjustments on 2D APIs ( #131358 ) ( #131436 )
...
These tweaks came from https://github.com/flutter/packages/pull/4536
- The TwoDimensionalChildBuilderDelegate asserts that maxXIndex and maxYIndex are null or >= 0
- The TwoDimensionalChildDelegate setter in RenderTwoDimensionalViewport has a covariant to allow type safety for subclasses of RenderTwoDimensionalViewport implementing with other subclasses of TwoDimensionalChildDelegate
I'd like to cherry pick this so https://github.com/flutter/packages/pull/4536 will not have to wait for it to reach stable.
2023-08-01 19:34:22 +00:00
Jesús S Guerrero
257a29931c
Revert "[a11y] CupertinoSwitch On/Off labels" ( #130166 ) ( #130172 )
...
Reverts flutter/flutter#127776
Currently breaking google testing
2023-07-07 14:25:30 -06:00
Jesús S Guerrero
761810a0bf
Revert "fix a bug when android uses CupertinoPageTransitionsBuilder..… ( #130155 )
...
…." (#130144 )
Reverts flutter/flutter#114303
The breaking API change in flutter/flutter#114303 broke internal
tests/apps (Google internal link b/290154304) as well as external
dependents: https://github.com/flutter/flutter/issues/130062 .
Co-authored-by: Hans Muller <hans.muller@gmail.com>
2023-07-07 10:06:18 -07:00
Polina Cherkasova
bff6b93683
Next attempt to make inspector weakly referencing the inspected objects. ( #129962 )
2023-07-06 12:19:18 -07:00
Gil Nobrega
4f6c887751
[a11y] CupertinoSwitch On/Off labels ( #127776 )
...
Adds optional visual labels to Cupertino's on/off switch for accessibility.
2023-07-06 11:18:13 -07:00
Henrique Nascimento
eebb1d6ddf
Add option for flexible space on material SearchDelegate ( #128132 )
...
This pull request introduces the `buildFlexibleSpace` method to the `SearchDelegate` class in the material library.
It allows users to add a flexible space widget to the `AppBar` in a `_SearchPage`, providing more customization options.
This PR does not fix any specific issue as there are no open issues related to this feature.
2023-07-06 17:52:58 +00:00
luckysmg
e0ad12969f
[framework] Add textField OCR support for framework side ( #96637 )
...
iOS OCR keyboard input support.
2023-07-06 08:51:06 -07:00
Ian Hickson
bc49cd1bca
Allow long-press gestures to continue even if buttons change. ( #127877 )
...
Previously, if you changed buttons during a long-press gesture, if it was before the gesture was accepted we would discard it, and if it was after the gesture was accepted we would silently end it without firing any of the relevant events.
This silent cancelation behavior is terrible because it means there's no way for consumers to know what state they're in, so you end up with widgets that thing they're still being long-pressed even though nothing is happening.
We could change the behavior in three ways, as far as I can tell:
- we could send a cancel event when you change buttons. This would introduce a new kind of transition (start->cancel) which I don't think we currently require people to support. This would therefore not fix existing code and would make future code more complicated to handle a really obscure user action that it seems unlikely anyone cares about.
- we could send an end event when you change buttons. This would mean the action commits, even though the user is still holding the mouse button down. This seems slightly better than the previous option but still not ideal as it means nudging the mouse button commits you even though you're still holding the button down.
- we could ignore button changes after the long-press has been accepted.
I implemented the last one in this PR.
2023-07-06 00:42:57 +00:00
Michael Goderbauer
55b6f049a6
Enable unreachable_from_main lint - it is stable now!!1 ( #129854 )
...
PLUS: clean-up of all the unreachable stuff.
2023-07-06 00:09:01 +00:00
Snonky
e0a9ad15b9
MergeableMaterial: Fix adding a slice and separating it ( #128804 )
2023-07-05 16:58:28 -07:00
Hans Muller
14f1e13edb
Reland Fix AnimatedList & AnimatedGrid doesn't apply MediaQuery padding #129556 ( #129860 )
...
Reland https://github.com/flutter/flutter/pull/129556/ which had failed
an internal test (see Google internal link b/288993600) and was reverted
in https://github.com/flutter/flutter/pull/129645 .
This PR must be landed with G3 Fix cl/543755631
2023-07-05 15:41:13 -07:00
Myles Moylan
ec72610378
Add simple unit tests for annotations.dart file ( #128902 )
...
This PR is adding a file of two simple unit tests in order to improve code coverage (covering two simple classes within the annotations.dart file).
The issue this is fixing is the lack of complete test coverage for the annotations.dart file.
2023-07-05 17:21:28 +00:00
ipcjs
aaaea51dd2
fix a bug when android uses CupertinoPageTransitionsBuilder... ( #114303 )
...
When android uses iOS style `PageTransitionsBuilder` and iOS uses android style `PageTransitionsBuilder`, on android, swipe from the left edge of the screen doesn't work. This PR solves that problem.
#99919 introduced a breaking change, the pr re-implemented it <del>without introducing a breaking change.**</del>
2023-07-05 16:41:32 +00:00
Pierre-Louis
35085c394d
Improve documentation for ColorSheme.fromImageProvider ( #129952 )
...
Sample code is added, documentation condensed, and links to guidelines updated.
For b/258360306
2023-07-05 15:47:57 +00:00
Polina Cherkasova
5b12b7467f
Cleanup: stop accepting DiagnosticsNode as input from DevTools. ( #129302 )
2023-07-04 10:12:49 -07:00
Parker Lougheed
63a8298d4b
Update links to old linter site to dart.dev ( #129866 )
...
Removes the remaining links to the old linter site, to the guaranteed dart.dev/lints redirect.
Contributes to https://github.com/dart-lang/linter/issues/4460 and https://github.com/dart-lang/site-www/issues/4499
2023-07-01 18:36:10 +00:00
Qun Cheng
9249dcc283
Update SwitchTheme tests for M2/M3 ( #129811 )
2023-06-30 16:29:02 -07:00
Greg Price
1153371a56
Fix NetworkImage causing spurious warning in tests ( #129537 )
...
Fixes #129532 .
This ensures that when a test properly uses `debugNetworkImageHttpClientProvider` to tell `NetworkImage` to use a fake `HttpClient`, we don't go ahead and try to instantiate `HttpClient` anyway and generate a misleading warning.
2023-06-30 22:25:52 +00:00
Hans Muller
26ad4a4a79
Updated some golden image tests for M2/M3 ( #129794 )
...
Updated some of the golden image tests that were temporarily changed in https://github.com/flutter/flutter/pull/128914 to have M2 and M3 versions.
Updated the linear_gradient_0 example to M3 (which will require updating its golden image as well).
More info in https://github.com/flutter/flutter/issues/127064
2023-06-30 18:09:56 +00:00
Qun Cheng
1ed54f8ec0
Update Radio tests for M2/M3 ( #129814 )
...
Updated unit tests for `Radio` to have M2 and M3 versions.
More info in https://github.com/flutter/flutter/issues/127064
2023-06-30 18:06:25 +00:00
Qun Cheng
0bb9409fd0
Update Switch tests for M2/M3 ( #129810 )
...
Updated and reorganized unit tests for `Switch` to have M2 and M3 versions.
More info in https://github.com/flutter/flutter/issues/127064
2023-06-30 18:06:23 +00:00
Qun Cheng
2e4122cc61
Update SwitchListTile tests for M2/M3 ( #129809 )
...
Updated and reorganized unit tests for `SwitchListTile` to have M2 and M3 versions.
More info in https://github.com/flutter/flutter/issues/127064
2023-06-30 09:05:48 +00:00
Taha Tesser
7cef966147
Fix NavigationDrawer selected item has wrong icon color ( #129625 )
...
fixes [NavigationDrawer selected item has wrong icon color [Material3 spec]](https://github.com/flutter/flutter/issues/129572 )
### Description
This PR fixes a mistake in the `NavigationDrawer` defaults, where generated token value returns a `null`.
This issue can be detected when you want to customize the selected icon color for `NavigationDrawerDestination` using a custom color scheme.
### Code sample
<details>
<summary>expanded to view the code sample</summary>
```dart
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
themeMode: ThemeMode.light,
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue).copyWith(
onSecondaryContainer: Colors.red,
),
useMaterial3: true,
),
home: const Example(),
);
}
}
class Example extends StatelessWidget {
const Example({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('NavigationDrawer Sample'),
),
drawer: const NavigationDrawer(
children: <Widget>[
NavigationDrawerDestination(
icon: Icon(Icons.favorite_outline_rounded),
label: Text('Favorite'),
selectedIcon: Icon(Icons.favorite_rounded),
),
NavigationDrawerDestination(
icon: Icon(Icons.favorite_outline_rounded),
label: Text('Favorite'),
),
],
),
);
}
}
```
</details>
### Before
<img width="1053" alt="Screenshot 2023-06-27 at 13 24 38" src="https://github.com/flutter/flutter/assets/48603081/18c13a73-688f-4586-bb60-bddef45d173f ">
### After
<img width="1053" alt="Screenshot 2023-06-27 at 13 24 25" src="https://github.com/flutter/flutter/assets/48603081/8a1427c6-517f-424a-b0bd-24bad7c5fbb0 ">
2023-06-30 08:58:14 +00:00
Bruno Leroux
3a6d661587
Update basic_test.dart for M3 compliance ( #129714 )
...
## Description
This PR fixes two test failures in `basic_test.dart` which surfaced when switching to M3 (see https://github.com/flutter/flutter/pull/127501 )
Those failures are related to M3 typography which sets line height to 1.43.
Forcing line height to 1.0 seems reasonable for these particular tests. With this change these two test are successful for both M2 and M3.
## Related Issue
fixes https://github.com/flutter/flutter/issues/129713
## Tests
Updates 2 tests.
2023-06-30 08:56:16 +00:00
Qun Cheng
91cb2618c3
Make DropdownMenu be able to scroll to the highlighted item when searching. ( #129740 )
...
Fixes #120349
This PR enables `DropdownMenu` to automatically scroll to the first matching item when `enableSearch` is true.
<details><summary>video example</summary>
https://github.com/flutter/flutter/assets/36861262/1a7a956c-c186-44ca-9a52-d94dc21cac8a
</details>
2023-06-30 01:48:05 +00:00
Taha Tesser
f3a7485b2c
Update RadioListTile tests to M3 ( #129718 )
...
This updates the `RadioListTile` test which was modified in https://github.com/flutter/flutter/pull/128839
### Description
- Update the layout to the proper order `MaterialApp` -> `Material` -> `RadioListTile`
- Add M3 overlay test. (fixed problem faced in https://github.com/flutter/flutter/pull/128839 )
- Separate the M2 overlay test.
2023-06-29 15:55:15 +00:00
Justin McCandless
c7511664e2
RTL InputDecoration fix ( #129661 )
...
Fixes InputDecoration (TextField) layout when 1. RTL 2. prefixIcon and 3. left/right contentPadding is asymmetric.
2023-06-28 16:31:51 -07:00
pdblasi-google
af09b57e20
Removes deprecated APIs from AnimationBuilder ( #129657 )
...
Removes deprecated APIs from AnimationBuilder.
Resolves #129653
2023-06-28 20:12:19 +00:00
Hans Muller
0d4b5ae122
Dev, examples/api, etc updated for Material 3 by default ( #129683 )
...
Updated tests in dev, examples/api, and tests/widgets to ensure that
they continue to pass when the default for `ThemeData.useMaterial3` is
changed to true.
This is the final set of changes required for
https://github.com/flutter/flutter/issues/127064 .
2023-06-28 09:41:58 -07:00
Taha Tesser
32fe4d7f0a
Add DatePickerTheme.inputDecorationTheme for the DatePicker with input mode. ( #128950 )
2023-06-28 08:51:53 -07:00
Jonah Williams
9c96357277
[framework] ensure flexible space bar fades when scrolling. ( #129527 )
...
This was missing the actual opacity rendering, oops
2023-06-28 15:33:51 +00:00
Bruno Leroux
8d837062a4
Add InputDecorator.error to allow error message customization ( #129275 )
...
## Description
This PR is a fork of https://github.com/flutter/flutter/pull/118610 with some changes (mainly applying @justinmc comments).
~~This can be used by KishanBusa8 to update https://github.com/flutter/flutter/pull/118610 or can become a non WIP PR if KishanBusa8 does not respond or can not work on the update.~~
## Related Issue
fixes https://github.com/flutter/flutter/issues/11068
## Tests
Adds 3 tests.
2023-06-28 14:57:15 +00:00
Xilai Zhang
f3b0b1726f
[flutter roll] Revert "Fix AnimatedList & AnimatedGrid doesn't apply MediaQuery padding" ( #129645 )
...
Reverts flutter/flutter#129556 .
Context: b/288993600
quoting, "the failure (in internal tests) appears to be due to a
workaround for the issue fixed by this pr".
2023-06-28 07:23:49 -05:00
Loïc Sharma
5a5b58a993
Automatically migrate ClipboardData.text to non-null ( #129567 )
...
https://github.com/flutter/flutter/pull/122446 was a breaking change in Flutter 3.10 that made the `ClipboardData` constructor's `text` argument a required non-nullable argument. This leverages `dart fix`'s new automatic migration to, well, automatically migrate affected users.
Manual migration docs: https://docs.flutter.dev/release/breaking-changes/clipboard-data-required
Follow-up to https://github.com/flutter/flutter/pull/122446
Part of https://github.com/flutter/flutter/issues/121976
2023-06-27 21:07:14 +00:00
Tomasz Gucio
ca6f23e8af
Remove Editable.onCaretChanged callback ( #109114 )
2023-06-27 22:20:15 +02:00
Luccas Clezar
a90c33fd61
iOS TextSelectionToolbar fidelity ( #127757 )
...
CupertinoTextSelectionToolbar is different from the native one, with some UI and UX issues. More details on the linked issue.
https://github.com/flutter/flutter/issues/127756
Currently the only problem that I listed on the linked issue that I couldn't fix was the horizontal scrolling, but to workaround this I added a GestureDetector to change pages when swiping the toolbar. It's not exactly the same as native as there is no scroll animation, but it works.
I'm creating this PR a little early to have some feedback as these changes were more complex than the ones in my last PR. Probably best if @justinmc is involved ð
|Version|Video|
|-|-|
|Flutter Old|<video src="https://github.com/flutter/flutter/assets/12024080/7cf81075-46ec-4970-b118-cc27b60ddac0 "></video>|
|Flutter New|<video src="https://github.com/flutter/flutter/assets/12024080/c9e27a53-f94c-4cb0-9b76-e47b73841dcb "></video>|
|Native|<video src="https://github.com/flutter/flutter/assets/12024080/468c7d5b-ba93-4bd4-8f6e-8ec2644b9866 "></video>|
2023-06-27 17:50:07 +00:00
Jason Simmons
3e66c86ae4
Make a paragraph test involving Chinese characters work with inconsistent host system fonts ( #129628 )
...
Text tests are run using the Ahem font, and test host environments such
as LUCI may not provide a fallback font for Chinese glyphs.
2023-06-27 09:56:13 -07:00
hangyu
9459f1c517
Fix chinese text is not selected by long press ( #129320 )
...
issue:#126652
in Chinese text, word length is 1 and (position.offset == word.end) happens a lot.
Update if (position.offset >= word.end) to if (position.offset > word.end) to resolve the issue that Chinese characters are not selected.
2023-06-27 01:15:38 +00:00
Hans Muller
b703f75f0f
Updated chip_test.dart tests for M3 ( #129570 )
...
Updated the chip tests per the changes from https://github.com/flutter/flutter/pull/128584 so that Chip tests that depend on Material2 will continue to pass when Material3 becomes the default.
Part of: https://github.com/flutter/flutter/issues/127064
2023-06-26 21:02:58 +00:00
Taha Tesser
c8e42b47f5
Fix AnimatedList & AnimatedGrid doesn't apply MediaQuery padding ( #129556 )
...
fixes [AnimatedList does not take SafeArea into account when building the list ](https://github.com/flutter/flutter/issues/129539 )
### Description
This PR fixes an issue for `AnimatedList` & `AnimatedGrid` where `MediaQuery` padding isn't applied. See the [source](a20db068dd/packages/flutter/lib/src/widgets/scroll_view.dart (L803-L833) ).
While the `ListView` or `GridView` applies `MediaQuery` padding to its inner `SliverPadding`. This is missing from `AnimatedList` & `AnimatedGrid`.

The fix applies `MediaQuery` padding to the inner `SliverPadding` in `AnimatedList` & `AnimatedGrid`.

### 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),
home: const Example(),
);
}
}
class Example extends StatelessWidget {
const Example({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Sample'),
),
body: Row(
children: <Widget>[
Expanded(
child: Column(
children: <Widget>[
const Text('ListView'),
Expanded(
child: ListView.builder(
itemCount: 50,
itemBuilder: (_, int index) {
return ColoredBox(
color: Theme.of(context).colorScheme.primaryContainer,
child: Center(
child: Text('$index', textAlign: TextAlign.center),
),
);
},
),
),
],
),
),
const VerticalDivider(width: 4),
Expanded(
child: Column(
children: <Widget>[
const Text('AnimatedList'),
Expanded(
child: AnimatedList(
initialItemCount: 50,
itemBuilder: (_, int index, __) {
return ColoredBox(
color: Theme.of(context).colorScheme.primaryContainer,
child: Center(
child: Text('$index', textAlign: TextAlign.center),
),
);
},
),
),
],
),
),
const VerticalDivider(width: 4),
Expanded(
child: Column(
children: <Widget>[
const Text('AnimatedGrid'),
Expanded(
child: AnimatedGrid(
initialItemCount: 50,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
),
itemBuilder: (_, int index, __) {
return ColoredBox(
color: Theme.of(context).colorScheme.primaryContainer,
child: Center(
child: Text('$index', textAlign: TextAlign.center),
),
);
},
),
),
],
))
],
),
);
}
}
```
</details>
### Before

### After

2023-06-26 16:19:02 +00:00
Loïc Sharma
e1e2ebd176
Add CallbackShortcuts widget of the week video ( #129296 )
2023-06-23 20:16:28 +00:00
Paurakh Sharma Humagain
a9164a4d76
fix: Inconsistency of SelectionArea when scrolling ( #128765 )
...
This PR fixes inconsistency of SelectionArea when scrolling by removing the `_clearSelection` on `longPressUpdate` gesture. This in turn makes the selection UX much better.
*List which issues are fixed by this PR. You must list at least one issue.*
Fixes: https://github.com/flutter/flutter/issues/120892
*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-06-23 16:47:47 +00:00
Xilai Zhang
363e2f7e0b
Revert "[web] Migrate framework to fully use package:web" ( #129400 )
...
Reverts flutter/flutter#128901
context: ([cl/542712088](https://critique.corp.google.com/542712088 ) , [b/288495136](https://b.corp.google.com/288495136 ))
2023-06-23 04:11:55 +00:00