Polina Cherkasova
96a491ceef
Dispose FocusNode in tests. ( #146161 )
2024-04-02 16:51:16 -07:00
Renzo Olivares
2a37c6f307
Implement SelectionArea triple click gestures ( #144563 )
...
This change adds support for triple click to select a paragraph at the clicked position and triple click + drag to extend the selection paragraph-by-paragraph when using the SelectionArea widget.
This PR also:
* Makes `Text` widgets a `SelectionContainer` if a parent `SelectionRegistrar` exists.
* Fixes issues with selectable ordering involving `WidgetSpan`s.
Fixes: https://github.com/flutter/flutter/issues/104552
2024-04-02 21:10:52 +00:00
Bruno Leroux
0ed26dc81d
Fix border color is wrong for a focused and hovered TextField ( #146127 )
...
## Description
This PRs fixes the active indicator color for a filled text field and the border color for an outlined text field.
Previously, when a text field was focused and hovered, the hover color was used. With this PR the focus color is used.
Screenshots for a focused and hovered text field:
| Before | After |
|--------|--------|
|  | |
</details>
## Related Issue
Fixes https://github.com/flutter/flutter/issues/145897
## Tests
Adds 4 tests.
2024-04-02 20:08:11 +00:00
Taha Tesser
8d9dcc48ec
Fix MenuItemButton overflow ( #143932 )
...
fixes [MenuItemButton does not constrain its child](https://github.com/flutter/flutter/issues/129439 )
fixes [DropdownMenuEntry Text Overflow when width of DropdownMenu is not specified](https://github.com/flutter/flutter/issues/140596 )
### Description
- This PR continues the fix from https://github.com/flutter/flutter/pull/141314#issuecomment-1945804640 and adds controlled widths for the `MenuBar` children to fix the unbounded width issue which blocked the PR earlier. (Widgets with non-zero flex value cannot be laid out in a horizontal scroll view which is created by `MenuBar` widget)
- Added tests coverage.
- Added documentation.
### 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 StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
MenuController menuController = MenuController();
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
DropdownMenu<int>(
expandedInsets: EdgeInsets.zero,
dropdownMenuEntries: <DropdownMenuEntry<int>>[
DropdownMenuEntry<int>(
value: 0,
label:
'This is a long text that is multiplied by 10. ' * 10,
style: const ButtonStyle(
textStyle: MaterialStatePropertyAll(
TextStyle(overflow: TextOverflow.ellipsis),
),
),
),
],
),
SizedBox(
width: 200,
child: MenuItemButton(
onPressed: () {},
leadingIcon: const Icon(Icons.menu),
trailingIcon: const Icon(Icons.arrow_forward_ios),
child: const Text(
'This is a very long text that will wrap to the multiple lines.',
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
),
// MenuBar(
// children: [
// MenuItemButton(
// onPressed: () {
// },
// child: Text('Short Text Menu'),
// ),
// MenuItemButton(
// onPressed: () {},
// child: Text('Very very very very very long text menu'),
// ),
// ],
// ),
],
),
),
),
);
}
}
```
</details>
### Before

### After

2024-04-02 17:27:26 +00:00
Kate Lovett
6d7922f3f5
Fix SliverMainAxisGroup layout in reverse ( #145572 )
...
Fixes https://github.com/flutter/flutter/issues/145068
The original tests for SliverMainAxisGroup did not actually check where the child was painted (#126596 ).
Followed the same pattern in RenderSliverMultiBoxAdaptor:
11c034f037/packages/flutter/lib/src/rendering/sliver_multi_box_adaptor.dart (L666)
2024-04-01 19:06:07 +00:00
Dimil Kalathiya
a187cc7255
Fixes some gesture recognizers are not disposed. ( #146072 )
2024-04-01 09:50:59 -07:00
Taha Tesser
40dda2b4bb
Add DataColumn.headingRowAlignment for DataTable ( #144006 )
...
fixes [[`DataTable`] Unable to center the label of a DataColumn without side effects](https://github.com/flutter/flutter/issues/143340 )
### 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,
home: MaterialApp(
home: Material(
child: DataTable(
columns: <DataColumn>[
DataColumn(
headingRowAlignment: MainAxisAlignment.center,
onSort: (int columnIndex, bool ascending) {},
label: const Text('Header'),
),
],
sortColumnIndex: 0,
rows: const <DataRow>[
DataRow(
cells: <DataCell>[
DataCell(Center(child: Text('Data'))),
],
),
],
),
),
),
);
}
}
```
</details>
### Center `DataColumn.mainAxisAlignment` without sort arrow

### Center `DataColumn.mainAxisAlignment` with sort arrow

2024-04-01 09:42:51 +00:00
LongCatIsLooong
ff284c51bd
Implement computeDryBaseline for cupertino RenderBoxes ( #145951 )
...
The `_debugVerifyDryBaselines` method verifies that dry baseline implementation is consistent with the wet baseline method at the current constraints.
2024-03-30 21:38:24 +00:00
Bruno Leroux
49183c256c
InputDecorator M3 tests migration - Step7 - container ( #145583 )
...
## Description
This PRs adds a test group for the input decorator container, this group is organised similarly to the M3 spec, see https://m3.material.io/components/text-fields/specs .
It is step 7 for the M3 test migration for `InputDecorator`.
Step 1: https://github.com/flutter/flutter/pull/142981
Step 2: https://github.com/flutter/flutter/pull/143369
Step 3: https://github.com/flutter/flutter/pull/143520
Step 4: https://github.com/flutter/flutter/pull/144169
Step 5: https://github.com/flutter/flutter/pull/144932
Step 6: https://github.com/flutter/flutter/pull/145213
## Related Issue
Related to https://github.com/flutter/flutter/issues/139076
@justinmc The diff is not very readable. The tests added by this PR are from line 298 to line 975. Other changes are due to moving some existing tests to this new 'container' group.
2024-03-29 20:48:49 +00:00
LongCatIsLooong
460a5e22bd
RenderFlex baseline intrinsics (#145483 )
...
Implements `RenderFlex` intrinsics calculation when children are baseline aligned in the cross axis.
2024-03-28 23:07:06 +00:00
Qun Cheng
ea1268a78d
Update tokens to v2.3.5 ( #145356 )
...
* Updated the Material Design tokens to v2.3.5
* Linear and circular progress indicator token sets are deprecated in v0.207. The `md.com.progress-indicator` token set was created and should be used instead.
* tokens is now using [semantic versioning](https://semver.org/ ) ï¼Thanks @guidezpl for reminding:) )
* ~Fixes #128877 . The default text style is updated to `bodyLarge` now:)~ Added TODOs for the label text style of `PopupMenuButton`. Will create a separate PR because this change breaks Google testing.
2024-03-28 22:22:20 +00:00
Taha Tesser
0bcd228e67
Update TabBar and TabBar.secondary to use indicator height/color M3 tokens ( #145753 )
...
fixes [Secondary `TabBar` indicator height token is missing ](https://github.com/flutter/flutter/issues/124965 )
### 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,
home: DefaultTabController(
length: 2,
child: Scaffold(
appBar: AppBar(
title: const Text('Sample'),
bottom: const TabBar.secondary(
tabs: <Widget>[
Tab(icon: Icon(Icons.directions_car)),
Tab(icon: Icon(Icons.directions_transit)),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: () {},
child: const Icon(Icons.add),
),
),
),
);
}
}
```
</details>
2024-03-28 17:56:09 +00:00
Mouad Debbar
42988d1b0d
Add viewId to TextInputConfiguration ( #145708 )
...
In order for text fields to work correctly in multi-view on the web, we need to have the `viewId` information sent to the engine (`TextInput.setClient`). And while the text field is active, if it somehow moves to a new `View`, we need to inform the engine about such change (`TextInput.updateConfig`).
Engine PR: https://github.com/flutter/engine/pull/51099
Fixes https://github.com/flutter/flutter/issues/137344
2024-03-28 17:09:53 +00:00
Renzo Olivares
f5b65bad0f
Remove deprecated TextTheme members ( #139255 )
...
Part of: https://github.com/flutter/flutter/issues/143956
2024-03-28 01:20:55 +00:00
maRci002
2079f34962
[WIP] Predictive back support for routes ( #141373 )
...
A new page transition, PredictiveBackPageTransitionsBuilder, which handles predictive back gestures on Android (where supported).
2024-03-27 16:43:10 -07:00
Taha Tesser
d2c8552944
Fix disabled DropdownMenu doesn't defer the mouse cursor ( #145686 )
...
fixes [DropdownMenu cursor in disabled state](https://github.com/flutter/flutter/issues/144611 )
This was added in https://github.com/flutter/flutter/pull/121353
### 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,
home: Scaffold(
body: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const Spacer(),
const Text('enabled: true,\nrequestFocusOnTap: true,'),
const SizedBox(height: 16),
DropdownMenu<String>(
enabled: true,
initialSelection: 'First',
requestFocusOnTap: true,
width: 200,
dropdownMenuEntries: ['First', 'Second', 'Third']
.map((e) => DropdownMenuEntry(value: e, label: e))
.toList(),
),
const Text('Expected: text cursor'),
const Spacer(),
const Text('enabled: true,\nrequestFocusOnTap: false,'),
const SizedBox(height: 16),
DropdownMenu<String>(
enabled: true,
initialSelection: 'First',
requestFocusOnTap: false,
width: 200,
dropdownMenuEntries: ['First', 'Second', 'Third']
.map((e) => DropdownMenuEntry(value: e, label: e))
.toList(),
// label: const Text('requestFocusOnTap: false'),
),
const Text('Expected: clickable cursor'),
const Spacer(),
const Text('enabled: false,\nrequestFocusOnTap: true,'),
const SizedBox(height: 16),
DropdownMenu<String>(
enabled: false,
initialSelection: 'First',
requestFocusOnTap: true,
width: 200,
dropdownMenuEntries: ['First', 'Second', 'Third']
.map((e) => DropdownMenuEntry(value: e, label: e))
.toList(),
),
const Text('Expected: deferred cursor'),
const Spacer(),
const Text('enabled: false,\nrequestFocusOnTap: false,'),
const SizedBox(height: 16),
DropdownMenu<String>(
enabled: false,
initialSelection: 'First',
requestFocusOnTap: false,
width: 200,
dropdownMenuEntries: ['First', 'Second', 'Third']
.map((e) => DropdownMenuEntry(value: e, label: e))
.toList(),
),
const Text('Expected: deferred cursor'),
const Spacer(),
],
),
),
),
);
}
}
```
</details>
### Preview

2024-03-26 20:15:48 +00:00
Kostia Sokolovskyi
94c63f825f
Memory leaks clean up 2 ( #145757 )
2024-03-26 12:22:57 -07:00
Kostia Sokolovskyi
8953ba658f
Fix memory leak in Overlay.wrap. ( #145744 )
2024-03-26 12:21:21 -07:00
Taha Tesser
81f969e807
Fix ExpansionTile Expanded/Collapsed announcement is interrupted by VoiceOver ( #143936 )
...
fixes [`ExpansionTile` accessibility information doesn't read Expanded/Collapsed (iOS)](https://github.com/flutter/flutter/issues/132264 )
### 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,
home: Scaffold(
appBar: AppBar(
title: const Text('ExpansionTile'),
),
body: const ExpansionTile(
title: Text("Title"),
children: <Widget>[
Placeholder(),
],
),
floatingActionButton: FloatingActionButton(
onPressed: () {},
child: const Icon(Icons.add),
),
),
);
}
}
```
</details>
### Before
https://github.com/flutter/flutter/assets/48603081/542d8392-52dc-4319-92ba-215a7164db49
### After
https://github.com/flutter/flutter/assets/48603081/c9225144-4c12-4e92-bc41-4ff82b370ad7
2024-03-26 18:36:09 +00:00
Taha Tesser
8363e78280
Fix SearchAnchor triggers unnecessary suggestions builder calls ( #143443 )
...
fixes [`SearchAnchor` triggers extra search operations](https://github.com/flutter/flutter/issues/139880 )
### Code sample
<details>
<summary>expand to view the code sample</summary>
```dart
import 'package:flutter/material.dart';
Future<List<String>> createFuture() async {
return List.generate(1000, (index) => "Hello World!");
}
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
title: 'Flutter Demo',
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
final SearchController controller = SearchController();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SearchAnchor(
searchController: controller,
suggestionsBuilder: (suggestionsContext, controller) {
final resultFuture = createFuture();
return [
FutureBuilder(
future: resultFuture,
builder: ((context, snapshot) {
if (snapshot.connectionState != ConnectionState.done) {
return const LinearProgressIndicator();
}
final result = snapshot.data;
if (result == null) {
return const LinearProgressIndicator();
}
return ListView.builder(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemCount: result.length,
itemBuilder: (BuildContext context, int index) {
final root = result[index];
return ListTile(
leading: const Icon(Icons.article),
title: Text(root),
subtitle: Text(
root,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Theme.of(suggestionsContext)
.colorScheme
.onSurfaceVariant,
),
),
onTap: () {},
);
},
);
}),
),
];
},
builder: (BuildContext context, SearchController controller) {
return IconButton(
onPressed: () {
controller.openView();
},
icon: const Icon(Icons.search),
);
},
),
],
),
),
);
}
}
```
</details>
### Before
https://github.com/flutter/flutter/assets/48603081/69f6dfdc-9f92-4d2e-8a3e-984fce25f9e4
### After
https://github.com/flutter/flutter/assets/48603081/be105e2c-51d8-4cb0-a75b-f5f41d948e5e
2024-03-25 22:58:11 +00:00
Taha Tesser
5e19b33534
Fix vertical Stepper draws connector on the last step ( #145703 )
...
fixes [Vertical stepper shows line after last step](https://github.com/flutter/flutter/issues/144376 )
### 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,
home: Scaffold(
body: Center(
child: Stepper(
currentStep: 1,
steps: const <Step>[
Step(
title: Text("Step 1"),
content: Text("Content 1"),
),
Step(
title: Text("Step 2"),
content: Text("Content 2"),
),
],
),
),
),
);
}
}
```
</details>
### Before

### After

2024-03-25 21:47:05 +00:00
Kostia Sokolovskyi
453a04d9f3
TwoDimensionalChildDelegate should dispatch creation and disposal events ( #145684 )
2024-03-25 10:45:02 -07:00
Kostia Sokolovskyi
47bfa827ba
Memory leaks clean up 1 ( #145691 )
2024-03-25 10:36:42 -07:00
Sahil Kachhap
a9f18b803b
[Fix]: Searchbar doesn't lose focus when tapped outside ( #145232 )
...
Added a Fix to search bar that allows it be unfocused when tapped anywhere outside the search bar.
I have attached below the app flow after implementing the fix.
https://github.com/flutter/flutter/assets/54017876/70915c47-9b77-4a43-a128-8706107f921f
Issue that gets resolved by this fix : #145096
*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
2024-03-25 17:02:07 +00:00
Taha Tesser
23687c5260
Add AnimationStyle to showBottomSheet and showModalBottomSheet ( #145536 )
...
fixes [Introduce animation customizable with `AnimationStyle` to `BottomSheet`](https://github.com/flutter/flutter/issues/145532 )
### Default bottom sheet animation

### Custom bottom sheet animation

### No bottom sheet animation

2024-03-25 08:39:05 +00:00
Polina Cherkasova
9fee27b244
Leak clean up. ( #144803 )
...
Fix some leaks and mark others.
[Known leaks](https://github.com/issues?q=is%3Aopen+is%3Aissue+label%3A%22a%3A+leak+tracking%22+-label%3A%22c%3A+new+feature%22+ )
2024-03-24 18:01:17 +00:00
Kate Lovett
c5047e0ada
2DScrollView - Fix drag when one axis does not have enough content ( #145566 )
...
Fixes https://github.com/flutter/flutter/issues/144982
For reference, may have to do with #138442 when we reworked the gesture handling. The adjustments to the comments here were certainly from #138442 not updating them. Confused myself for a minute or two. ð
2024-03-22 16:42:19 +00:00
Bruno Leroux
859eb2eda9
Adds numpad navigation shortcuts for Linux ( #145464 )
...
## Description
This PR adds shortcuts related to numpad keys on Linux.
## Related Issue
Linux side for https://github.com/flutter/flutter/issues/144936
## Tests
Adds 2 tests.
2024-03-22 06:22:09 +00:00
Bernardo Ferrari
784f19c49c
Fix BorderSide.none requiring explicit transparent color for UnderlineInputBorder ( #145329 )
...
Fix could have been "paint transparent when Border none" but, following other Borders, we will just not paint anything.
Fix https://github.com/flutter/flutter/issues/143746
2024-03-22 02:31:16 +00:00
Michael Goderbauer
11c034f037
Fix nullability of getFullHeightForCaret ( #145554 )
...
Fixes https://github.com/flutter/flutter/issues/145507 .
Looks like this was accidentally migrated to nullable all the way back when we switched to NNBD.
2024-03-21 23:38:16 +00:00
Jackson Gardner
31209d04ff
flutter test --wasm support (#145347 )
...
* Adds support for `flutter test --wasm`.
* The test compilation flow is a bit different now, so that it supports compilers other than DDC. Specifically, when we run a set of unit tests, we generate a "switchboard" main function that imports each unit test and runs the main function for a specific one based off of a value set by the JS bootstrapping code. This way, there is one compile step and the same compile output is invoked for each unit test file.
* Also, removes all references to `dart:html` from flutter/flutter.
* Adds CI steps for running the framework unit tests with dart2wasm+skwasm
* These steps are marked as `bringup: true`, so we don't know what kind of failures they will result in. Any failures they have will not block the tree at all yet while we're still in `bringup: true`. Once this PR is merged, I plan on looking at any failures and either fixing them or disabling them so we can get these CI steps running on presubmit.
This fixes https://github.com/flutter/flutter/issues/126692
2024-03-21 20:08:07 +00:00
Pascal Welsch
4bbe6d594d
Add WidgetsApp.debugShowWidgetInspectorOverride again (deprecated) ( #145334 )
...
`WidgetsApp.debugShowWidgetInspectorOverride` was replaced with ` WidgetsBinding.instance.debugShowWidgetInspectorOverrideNotifier` in https://github.com/flutter/flutter/pull/144029 .
The old API was removed, not deprecated.
It is used by some [open-source projects](https://github.com/search?q=WidgetsApp.debugShowWidgetInspectorOverride&type=code ), thus I'm making the effort of bringing the API back as deprecated.
Fixes https://github.com/flutter/flutter/issues/145333
2024-03-21 17:43:05 +00:00
Vatsal Bhesaniya
01fc13d9f9
Add helper widget parameter to InputDecoration ( #145157 )
...
This pull request introduces a new field named `helper` to the InputDecoration class. This field allows for specifying a widget containing contextual information about the InputDecorator.child's value. Unlike `helperText`, which accepts a plain string, `helper` supports widgets, enabling functionalities like tappable links for further explanation. This change aligns with the established pattern of `error`, `label`, `prefix`, and `suffix`.
fixes [#145163 ](https://github.com/flutter/flutter/issues/145163 )
2024-03-20 20:48:05 +00:00
hangyu
2b317d584f
Add a minTileHeight to ListTile widget so its height can be customized to less than the default height. ( #145244 )
...
fixes: https://github.com/flutter/flutter/issues/145369
2024-03-19 17:58:16 +00:00
Mitchell Goodwin
6190c5eea1
Widget state properties ( #142151 )
...
Fixes #138270 .
Moves the majority of the logic of MaterialStateProperties down to the widgets layer, then has the existing Material classes pull from the widgets versions.
2024-03-19 17:58:13 +00:00
goodmost
3236957f02
chore: fix some comments ( #145397 )
...
fix some comments
2024-03-19 17:00:24 +00:00
Bruno Leroux
6f61f6135f
Activate shortcuts based on NumLock state ( #145146 )
...
## Description
The PR updates `SingleActivator` in order to add a parameter for specifying that a shortcut depends on <kbd>NumLock</kbd> key state.
Somewhat similarly to what is possible with common modifiers expect that a boolean is not enough in this case because: by default, a shortcut should ignore the <kbd>NumLock</kbd> state and it should be possible to define shortcuts that require <kbd>NumLock</kbd> to be locked and other that require it to be unlocked.
@gspencergoog I considered defining a new `ShortcutActivator` implementation for this, but I thinks that adding the feature directly to `SingleActivator` results in a cleaner API.
## Related Issue
Fixes https://github.com/flutter/flutter/issues/145144
Preparation for https://github.com/flutter/flutter/issues/144936
## Tests
Adds 3 tests.
2024-03-19 08:27:50 +00:00
sanni prasad
993f554e4c
Fix for issue 140372 ( #144947 )
...
*Continuing work from the PR https://github.com/flutter/flutter/pull/140373 *
Add the ability to set route settings on PopupMenuButton
Fixes https://github.com/flutter/flutter/issues/140372
Added UTs as requested
2024-03-18 21:35:37 +00:00
LongCatIsLooong
98369bdd50
Introduce methods for computing the baseline location of a RenderBox without affecting the current layout ( #144655 )
...
Extracted from https://github.com/flutter/flutter/pull/138369
Introduces `RenderBox.{compute,get}DryBaseline` for computing the baseline location in `RenderBox.computeDryLayout`.
2024-03-18 21:32:22 +00:00
Bruno Leroux
50e7f2b84b
InputDecorator M3 tests migration - Step6 - constraints ( #145213 )
...
## Description
This PR migrates `InputDecorator.constraints` related tests to M3 and also various regression tests.
It is the fifth step for the M3 test migration for `InputDecorator`.
Step 1: https://github.com/flutter/flutter/pull/142981
Step 2: https://github.com/flutter/flutter/pull/143369
Step 3: https://github.com/flutter/flutter/pull/143520
Step 4: https://github.com/flutter/flutter/pull/144169
Step 5: https://github.com/flutter/flutter/pull/144932
## Related Issue
Related to https://github.com/flutter/flutter/issues/139076
@justinmc A somewhat small PR, I wanted to migrate the small group related to 'InputDecoration.constraints' (starting at line 2801), it adds a test checking min interactive height and two others that shows one way to bypass the standard min interactive height.
2024-03-18 12:53:14 +00:00
Taha Tesser
06ed849cbc
Update inherited_theme_test.dart, ink_paint_test.dart, ink_splash_test.dart, opacity_test.dart for Material 3 ( #144013 )
...
Updated unit tests for `Tooltip` to have M2 and M3 versions.
More info in #139076
2024-03-18 12:45:22 +00:00
Pierre-Louis
3109b1118e
Introduce Split curve ( #143130 )
...
`Split` is a curve that progresses according to `beginCurve` until
`split`, then according to `endCurve`.
This curve is used with bottom sheets to allow linear finger dragging
and non-linear enter/exit animations. This PR cleans up a previously
private class I introduced and replaces it with the more customisable
`Split`.
Fixes https://github.com/flutter/flutter/issues/51627
Diagram to be added with
https://github.com/flutter/assets-for-api-docs/pull/239
## 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
2024-03-16 09:08:00 +01:00
LongCatIsLooong
cc01701781
Use a separate TextPainter for intrinsics calculation in RenderEditable and RenderParagraph ( #144577 )
...
Use a dedicated `TextPainter` for intrinsic size calculation in `RenderEditable` and `RenderParagraph`.
This is an implementation detail so the change should be covered by existing tests. Performance wise this shouldn't be significantly slower since SkParagraph [caches the result of slower operations across different paragraphs](9c62e7b382/modules/skparagraph/src/ParagraphCache.cpp (L254-L272) ). Existing benchmarks should be able to catch potential regressions (??).
The reason for making this change is to make sure that intrinsic size computations don't destroy text layout artifacts, so I can expose the text layout as a stream of immutable `TextLayout` objects, to signify other render objects that text-layout-dependent-cache (such as caches for `getBoxesForRange` which can be relatively slow to compute) should be invalidated and `markNeedsPaint` needs to be called if the painting logic depended on text layout.
Without this change, the intrinsics/dry layout calculations will add additional events to the text layout stream, which violates the "dry"/non-destructive contract.
2024-03-16 01:15:19 +00:00
hangyu
58eb0e8ae6
Update a11y for SliverAppBar ( #144437 )
...
1. Set cacheExtent for sliverAppBar so it's not dropped from the
semantics tree.
2. Update its toolbarOpacity in a11y mode to 1.0. When scrolling in a11y
mode and the focus is back to the sliverAppBar, the content should be
visible.
fixes: https://github.com/flutter/flutter/issues/143437
## 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].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] 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
[Data Driven Fixes]:
https://github.com/flutter/flutter/wiki/Data-driven-Fixes
2024-03-15 10:42:02 -07:00
Nate
17a27358a6
Implementing switch expressions in flutter/test/ ( #144580 )
...
Migrates test code to new `switch` syntax.
2024-03-14 14:20:44 -07:00
auto-submit[bot]
bc611f565b
Reverts "Fix TextField helper top padding on M3 ( #145087 )" ( #145168 )
...
Reverts: flutter/flutter#145087
Initiated by: Jasguerrero
Reason for reverting: failing on accessibility checks b/329548765
Original PR Author: bleroux
Reviewed By: {justinmc}
This change reverts the following previous change:
## Description
`InputDecorator` adds a 8.0 gap beetween the container and the helper text.
From the Material 3 specification, this gap should be 4.0.
See https://m3.material.io/components/text-fields/specs#0c5c8d6d-2169-4d42-960c-51f6ee42eb57 .
This PR sets the correct values for M3 without changing the value for M2.
| Before | After | M3 Spec |
|--------|--------|--------|
|  | |  |
If this change is accepted, a future step will be to make this value configurable, probably by `InputDecorationTheme`.
## Related Issue
Fixes https://github.com/flutter/flutter/issues/144984
## Tests
Updates a value used by several existing tests.
2024-03-14 18:00:26 +00:00
LongCatIsLooong
a69567a36f
Asserts if a TextPainter gets disposed more than once ( #145124 )
...
The overflow indicator was sharing the same `TextPainter`.
2024-03-14 16:43:00 +00:00
Matej Knopp
19087442ce
RenderViewport max layout cycles should depend on number of slivers ( #144104 )
...
Fixes https://github.com/flutter/flutter/issues/144102
## 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] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [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
[Data Driven Fixes]:
https://github.com/flutter/flutter/wiki/Data-driven-Fixes
2024-03-13 22:28:43 +01:00
LongCatIsLooong
4f786841f9
Revert "Add FocusNode.focusabilityListenable ( #144280 )" since the feature is no longer needed ( #145102 )
...
This reverts commit 726e5d28c088260b507067a6890a69b6ccb0f103.
*Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.*
*List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.*
*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
2024-03-13 20:17:07 +00:00
Bruno Leroux
33fbb75a95
Fix TextField helper top padding on M3 ( #145087 )
...
## Description
`InputDecorator` adds a 8.0 gap beetween the container and the helper text.
From the Material 3 specification, this gap should be 4.0.
See https://m3.material.io/components/text-fields/specs#0c5c8d6d-2169-4d42-960c-51f6ee42eb57 .
This PR sets the correct values for M3 without changing the value for M2.
| Before | After | M3 Spec |
|--------|--------|--------|
|  | |  |
If this change is accepted, a future step will be to make this value configurable, probably by `InputDecorationTheme`.
## Related Issue
Fixes https://github.com/flutter/flutter/issues/144984
## Tests
Updates a value used by several existing tests.
2024-03-13 19:56:49 +00:00