Renzo Olivares
83f19be250
Fix bottom sheet rebuilding when tapping ( #127526 )
...
This fixes an issue where the bottom sheet would rebuild when `enableDrag` is set to true on every tap. This is because `DragGestureRecognizer` would win the arena by default and dispatch the `drag` callbacks (in `acceptGesture`) even though it had not met the drag threshold. This changes keep the default behavior of `DragGestureRecognizer` the same, but adds a parameter `onlyAcceptDragOnThreshold` that a user can use to stop drag callbacks from being fired when the drag threshold has not been met.
Fixes #126833
2023-05-31 20:21:55 +00:00
chunhtai
2f521a2143
Increases the eyeballed value of auto scroll velocity scalar ( #127410 )
...
A previous pr fixed an bug in the autoscalar's speed calculation. The calculation would produce much lower speed after the fix. This pr raised the default scalar value for reorderable list.
fixes https://github.com/flutter/flutter/issues/121603
2023-05-30 17:28:19 +00:00
Matheus Kirchesch
f1c8723a10
Added option to disable [NavigationRailDestination]s ( #127113 )
2023-05-30 08:38:05 -07:00
Taha Tesser
918aa9e485
Update Material 2 tests group comment ( #127796 )
...
fixes https://github.com/flutter/flutter/issues/127795
2023-05-30 06:15:28 +00:00
Greg Spencer
0da6f04f07
Remove references to deprecated ThemeData.primaryColorBrightness ( #127238 )
...
## Description
Removes references to `ThemeData.primaryColorBrightness`, deprecated in https://github.com/flutter/flutter/pull/93396 and subject to remove now because of our [deprecation policy](https://github.com/flutter/flutter/wiki/Tree-hygiene#deprecations ).
## Related PRs
- https://github.com/flutter/flutter/pull/93396
## Tests
- Removed unneeded tests, removed references.
2023-05-26 22:33:58 +00:00
Qun Cheng
a4de77a239
Remove button announcement for MenuItemButton and SubmenuButton ( #127620 )
2023-05-26 13:23:45 -07:00
Taha Tesser
5d555eb234
Add M3 date range picker tests and fix header background theme color ( #127662 )
2023-05-26 13:08:45 -07:00
LongCatIsLooong
56808b486d
Remove a bad assert from tooltip implementation ( #127629 )
...
Fixes https://github.com/flutter/flutter/issues/127575
The `_handleMouseEnter` and `_handleMouseExit` calls are balanced, but the tooltip could be dismissed by an external `PointerDown` event interacting with a different UI component so the ` assert(_activeHoveringPointerDevices.isNotEmpty);` does not really make sense.
2023-05-26 00:29:27 +00:00
LongCatIsLooong
43de3365f5
Remove rounding from TextPainter ( #127099 )
...
To opt-in, run the tests with: `SKPARAGRAPH_REMOVE_ROUNDING_HACK=1 flutter test --dart-define=SKPARAGRAPH_REMOVE_ROUNDING_HACK=1 `
Migration plans:
1. Turn the flags on in CI, migrate customer tests if needed
1. Migrate internal customers
2. Remove the flag from skparagraph. Remove the framework flag with a manual engine roll.
Also fixes https://github.com/flutter/flutter/issues/52038
2023-05-26 00:09:51 +00:00
Qun Cheng
9fa351807f
SearchBar should not be impacted by overall InputDecorationTheme (#127465 )
2023-05-25 12:28:26 -07:00
LongCatIsLooong
1b800fd496
Remove Tooltip mouse tracker listener & update hovering/MouseRegion logic & animation ( #119199 )
...
Fixes https://github.com/flutter/flutter/issues/117627
### Behavior changes:
1. If fade in/fade out animation is already in progress, hiding/showing the tooltip will immediately take effect without waiting for `waitDuration`.
2. A PointerDownEvent that doesn't become a part of a "trigger" gesture dismisses the tooltip, even for hovered ones.
3. The OverlayEntry is now updated only when the previous tooltip was completely dismissed. This can be fixed by OverlayPortal but I'm not sure what the correct behavior is.
2023-05-25 07:24:45 +00:00
lsaudon
7827a24207
Add missing parameters in TextFormField ( #127020 )
...
`TextFormField` does not have all the parameters of `TextField`.
Added:
```dart
UndoHistoryController? undoController,
AppPrivateCommandCallback? onAppPrivateCommand,
bool? cursorOpacityAnimates,
ui.BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight,
ui.BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight,
DragStartBehavior dragStartBehavior = DragStartBehavior.start,
ContentInsertionConfiguration? contentInsertionConfiguration,
Clip clipBehavior = Clip.hardEdge,
bool scribbleEnabled = true,
bool canRequestFocus = true,
```
2023-05-24 23:06:52 +00:00
LongCatIsLooong
62e78bf143
Improve TextPainter.layout caching ( #118128 )
...
Improves `TextPainter.layout` caching when only the input constraints change:
- removes the double layout calls in `TextPainter._layoutParagraph`: now double layout is only needed when `TextAlign` is not left, and the input `maxWidth == double.infinity`.
- skip calls to `ui.Paragraph.layout` when it's guaranteed that there's no soft line breaks before/after the layout call.
This doesn't introduce new APIs but may slightly shift text rendered on screen.
This reduces the number of `layout` calls but since shaping results are already cached so it only skips the relatively cheap line-breaking process when possible.
528 scuba failures but all of them seem reasonable.
2023-05-24 22:38:52 +00:00
Devin
5451ea6e8f
Slider.onChangeStart & Slider.onChangeEnd are not called on keyboard shortcuts (#126896 )
...
fixes https://github.com/flutter/flutter/issues/123315
--------
This PR makes changes to the _actionHandler function used on the Slider.Dart Widget for Key Events. It ensures onChangeStart is called at the beginning of a Key Event and onChangeEnd at the end of one. This PR includes a test for the changes made.
I ran all existing tests after my changes were made and they passed.
2023-05-24 22:13:15 +00:00
Sun Jiao
7b67aa587a
make suggestionsBuilder in SearchAnchor asyncable ( #127019 )
2023-05-24 13:12:47 -07:00
NikolajHarderNota
c84b10474c
modal bottom sheet barrier label ( #126431 )
...
Adds barrierLabel as optional param in showModalBottomSheet
Fixes #83180
2023-05-23 18:59:49 +00:00
Taha Tesser
fe32675b54
Add M3 date picker tests and fix divider ( #127197 )
...
partial fix https://github.com/flutter/flutter/issues/126826 (date range picker is another PR)
fixes https://github.com/flutter/flutter/issues/126597
### Description
1. This PR adds a bunch of M3 date picker tests
2. Fixes divider taking more space than it should
3. Added dividerColor theme value to allow users to customise divider color just for the date pickers from date picker theme
<details>
<summary>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(
datePickerTheme: DatePickerThemeData(
headerBackgroundColor: Colors.amber,
),
useMaterial3: true,
),
home: Scaffold(
body: Builder(builder: (BuildContext context) {
return Center(
child: ElevatedButton(
onPressed: () async {
showDatePicker(
context: context,
initialDate: DateTime(2016, DateTime.january, 15),
firstDate: DateTime(2001),
lastDate: DateTime(2031, DateTime.december, 31),
);
},
child: const Text('Show Date Picker'),
),
);
}),
),
);
}
}
```
</details>
### Before

### After

2023-05-23 07:29:20 +00:00
Daniel Iglesia
a6d62ca8de
Support keeping a bottom sheet with a DraggableScrollableSheet from closing on drag/fling to min extent ( #127339 )
2023-05-22 16:14:35 -07:00
Victor Ohashi
7e3f1df36c
fix: Search anchor box location when used on nested navigator ( #127198 )
...
This PR is to fix the position of `SearchAnchor` when used with nested navigator. This solution is based on what `DropdownButton` internally do, looking to the closest `Navigator` to proper calculate the where to render `SearchViewRoute`.
Fixes: https://github.com/flutter/flutter/issues/126435
<details>
<summary>Test case</summary>
```dart
void main() => runApp(const NestedSearchBarApp());
class NestedSearchBarApp extends StatefulWidget {
const NestedSearchBarApp({super.key});
@override
State<NestedSearchBarApp> createState() => _NestedSearchBarAppState();
}
class _NestedSearchBarAppState extends State<NestedSearchBarApp> {
final SearchController controller = SearchController();
@override
Widget build(BuildContext context) {
final ThemeData themeData = ThemeData(useMaterial3: true);
return MaterialApp(
theme: themeData,
builder: (BuildContext context, Widget? child) {
return Scaffold(
body: Row(
children: <Widget>[
NavigationRail(
selectedIndex: 1,
destinations: const <NavigationRailDestination>[
NavigationRailDestination(
icon: Icon(Icons.favorite_border),
selectedIcon: Icon(Icons.favorite),
label: Text('First'),
),
NavigationRailDestination(
icon: Icon(Icons.bookmark_border),
selectedIcon: Icon(Icons.book),
label: Text('Second'),
),
],
),
const VerticalDivider(thickness: 1, width: 1),
Expanded(child: child!)
],
),
);
},
home: Scaffold(
appBar: AppBar(title: const Text('Search Anchor Sample')),
body: Column(
children: <Widget>[
SearchAnchor(
searchController: controller,
builder: (BuildContext context, SearchController controller) {
return IconButton(
icon: const Icon(Icons.search),
onPressed: () {
controller.openView();
},
);
},
suggestionsBuilder:
(BuildContext context, SearchController controller) {
return List<ListTile>.generate(5, (int index) {
final String item = 'item $index';
return ListTile(
title: Text(item),
onTap: () {
setState(() {
controller.closeView(item);
});
},
);
});
}),
Center(
child: controller.text.isEmpty
? const Text('No item selected')
: Text('Selected item: ${controller.value.text}'),
),
],
),
),
);
}
}
```
</details>
<details>
<summary>Before fix:</summary>

</details>
<details>
<summary>After fix:</summary>

</details>
2023-05-22 20:21:26 +00:00
Gil Nobrega
7b16cbcb57
Do not animate TabBarView if controller is invalid ( #123442 )
2023-05-19 16:43:40 -07:00
Phil Quitslund
d0c0439b8d
fixes to anticipate next Dart linter release ( #127211 )
...
The upcoming linter release notices null literals as unnecessary argument values and flags more `type_literal_in_constant_pattern` cases.
See breakages: https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8780744067138629361/+/u/analyze_flutter_flutter/stdout
2023-05-19 21:27:24 +00:00
chunhtai
ea5cfe09fd
Properly cleans up routes ( #126453 )
...
fixes https://github.com/flutter/flutter/issues/126100
2023-05-19 00:32:26 +00:00
Qun Cheng
af83c76723
Remove deprecated primaryVariant and secondaryVariant from ColorScheme ( #127124 )
...
This PR is to remove deprecated `primaryVariant` and `secondaryVariant` from framework. These two apis are made obsolete in #93427
Part of https://github.com/flutter/flutter/issues/127042
2023-05-19 00:26:53 +00:00
Mahdi Bagheri
434b81f1a5
Fixing richMessage gesture recognizer in tooltip widget ( #126207 )
...
Fixing #126206 and #113388 issues
*The IgnorePointer is preventing the richMessage touch events being recognized. Just removing that from*
*Solves #126206 and #113388*
2023-05-18 18:32:22 +00:00
Qun Cheng
f31dae2a80
Clip search view content during animation ( #126975 )
...
Fixes #126590
This PR is to clip the view content when the view size is not big enough, such as during animation.
Also removes some unused properties in `_ViewContent` class: `getRect` and `viewConstraints`
2023-05-18 00:18:51 +00:00
Renzo Olivares
d44d657ade
Remove deprecated fixTextFieldOutlineLabel ( #125893 )
...
The deprecation period has elapsed. The method was made obsolete in https://github.com/flutter/flutter/pull/87281 .
2023-05-17 22:56:14 +00:00
Taha Tesser
160618b103
Add missing Switch.onFocusChange test ( #126685 )
2023-05-17 08:36:24 -07:00
Jason Simmons
e24c64d8ee
Fix DataTableThemeData.copyWith handling of dataRowHeight ( #126943 )
...
Fixes https://github.com/flutter/flutter/issues/126676
2023-05-16 21:44:24 +00:00
Mushaheed Syed
60751ca519
Fix copyWith method of ActionIconThemeData ( #126763 )
...
Fixes copyWith method of ActionIconThemeData, now using blank copyWith on [ActionIconThemeData] object that isn't `const ActionIconThemeData()` returns object with same values.
*List which issues are fixed by this PR.*
Fixes https://github.com/flutter/flutter/issues/126762
2023-05-16 21:38:23 +00:00
Polina Cherkasova
ea5eddb5a9
Upgrade leak_tracker to 5.0.0 ( #126367 )
...
Fixes https://github.com/flutter/flutter/issues/126259
Updated pubspec:
345f0bffbf/packages/flutter/pubspec.yaml
2023-05-16 04:39:26 +00:00
Tomasz Gucio
99c7e9f088
Add spaces after flow control statements ( #126320 )
2023-05-15 11:07:30 +02:00
Taha Tesser
96dae5e1e3
Fix focus behavior and provided thumb and focus color aren't applied to Cupertino variant of Switch.adaptive ( #126688 )
...
fixes https://github.com/flutter/flutter/issues/126637
fixes https://github.com/flutter/flutter/issues/126669
## ~~To be merged after https://github.com/flutter/flutter/pull/126684~~
### Description
1. Fix the Cupertino variant of `Switch.adaptive` requires two tab key presses to focus.
2. Fix `thumbColor` & `focusColor` aren't applied.
### Before
Requires two tab presses to focus. and `thumbColor` & `focusColor` aren't applied.
https://github.com/flutter/flutter/assets/48603081/24635551-0794-443f-8320-32fdaa5de57a
### After
Single tab key to focus (no additional focus node) and `thumbColor` & `focusColor` are applied.
https://github.com/flutter/flutter/assets/48603081/9bf42fd8-c7e0-475a-b933-192a94650b0c
2023-05-12 18:48:10 +00:00
Justin McCandless
6ffcc9e55a
Hide the context menu on tap down ( #126295 )
...
Desktop text selection toolbar no longer flashes before closing.
2023-05-12 10:04:27 -07:00
Taha Tesser
15a7e07395
Fix showDatePicker in input mode throws an ArgumentError ( #126525 )
...
fixes https://github.com/flutter/flutter/issues/126397
The `parseCompactDate` method in `material_localizations.dart` with long text throws an argument error before the date picker could handle it to show a validation error while the date picker is on autovalidate.
This PR adds `try/catch` in the `parseCompactDate` to return null on the argument error.
2023-05-12 16:56:13 +00:00
Qun Cheng
4e7e4512b6
Reorder materialStateProperty defaults ( #125905 )
...
Fixes #122250 . This PR is to make sure all the MaterialStateProperty defaults are able to correctly resolve different states.
* When a widget is pressed, it is also hovered, so we need to put the `MaterialState.pressed` check before `MaterialState.hovered`.
* When a widget is focused, the widget should still be able to be hovered, so we should check `MaterialState.hovered` before `MaterialState.focused`.
* There are also cases like in _InputDecoratorDefaultsM3, the `MaterialState.disabled` should be checked before `MaterialState.error`.
the order should be disabled, (error), pressed, hovered, focused.
2023-05-11 00:03:09 +00:00
Alex Li
d01d8aeed0
✨ Add strokeAlign to CircularProgressIndicator and RefreshProgressIndicator ( #125945 )
2023-05-10 14:57:55 -07:00
Kevin Chisholm
a153d6da84
Revert "Provide default constraints for M3 dialogs" ( #126355 )
...
Reverts flutter/flutter#120082
Causing breakages: b/281181985
2023-05-09 14:21:52 -05:00
Michael Goderbauer
9b230d239a
Fix leaks ( #126144 )
...
Fixes https://github.com/flutter/flutter/issues/126096 .
Fixes https://github.com/flutter/flutter/issues/126097 .
Fixes https://github.com/flutter/flutter/issues/126102 .
Fixes https://github.com/flutter/flutter/issues/126098 .
Fixes https://github.com/flutter/flutter/issues/126147 .
Work towards https://github.com/flutter/flutter/issues/126100 .
Does not fix the OverlyEntry/ModalRoute leak (https://github.com/flutter/flutter/issues/126100 ).
2023-05-08 09:11:23 +00:00
Tirth
835b892d7f
[ExpansionPanelList] add materialGapSize property in ExpansionPanelList Widget ( #123971 )
...
Adds `materialGapSize` property to `ExpansionPanelList` widget.
| `materialGapSize: 0` | `materialGapSize: 16` (default) | `materialGapSize: 30` |
| --- | --- | --- |
|  |  |  |
|  |  |  |
|  |  |  |
|  |  |  |
Fixes : #118167
2023-05-06 20:00:22 +00:00
Viren Khatri
d5df458684
add tests for dominant bottom sheet in scaffold ( #124472 )
...
while debugging https://github.com/flutter/flutter/issues/123882 found out that below lines were untested. although they'll change due to the issue above, but the tests will remain.
e0045d04f7/packages/flutter/lib/src/material/scaffold.dart (L3169-L3180)
2023-05-05 20:51:14 +00:00
Qun Cheng
c1c2513ac9
Add Switch.trackOutlineWidth property ( #125848 )
2023-05-05 13:34:08 -07:00
Taha Tesser
ad009fb7ac
Fix Material 3 tab indicator weight and position ( #125883 )
...
fixes https://github.com/flutter/flutter/issues/123112
### Description
1. Add proper M3 indicator height aka`IndictorWeight` from the M3 specs for the primary tab bar with label indicator size.
db6074ade4/dev/tools/gen_defaults/data/navigation_tab_primary.json (L9)
(this was held due to `indicatorWeight` having a hard-coded value)
and added a secondary tab bar indicator height.
2. Set a minimum value for the rounded indicator to maintain the indicator shape.
3. With proper indicator height, the rounded indicator position is also fixed.
4. Fix round indicator is shown for the primary tab bar with tab indicator size.
5. Above changes fix https://github.com/flutter/flutter/issues/123112 .
6. Fix the `startOffset` const value from https://github.com/flutter/flutter/pull/125036 to match docs and move it to a variable.
2023-05-05 14:09:18 +00:00
Tirth
91a84dedf5
[NavigationDrawer] adds padding property in NavigationDrawer Widget ( #123961 )
...
Adds `tilePadding` property to `NavigationDrawer` Widget.
Fixes : #121662
| Without adding `tilePadding` in NavigationDrawer | With `tilePadding: EdgeInsets.all(16)` in NavigationDrawer |
| --- | --- |
|  |  |
2023-05-05 05:36:30 +00:00
chunhtai
0b657236ca
Cleans up appbar imply leading logic ( #125315 )
...
fixes https://github.com/flutter/flutter/issues/80256
2023-05-04 22:21:11 +00:00
Polina Cherkasova
5a80f8d637
Define testWidgetsWithLeakTracking. ( #125063 )
2023-05-04 12:09:41 -07:00
Pierre-Louis
8ec5001ac2
Provide default constraints for M3 dialogs ( #120082 )
...
This PR constrains M3 dialogs to 560dp max width and height.
This is not a breaking change per the breaking change policy.
Part of https://github.com/flutter/flutter/issues/118619
## 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.
- [ ] 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-05-04 19:27:11 +02:00
Valentin Vignal
00cd3edae3
Align the Popup Menu under its child ( #125534 )
...
Align the `PopupMenu` under its child.
Before:

After:

*List which issues are fixed by this PR. You must list at least one issue.*
Fixes https://github.com/flutter/flutter/issues/125474
*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-05-02 17:02:55 +00:00
Taha Tesser
a732a74888
Introduce TabBar.tabAlignment ( #125036 )
...
fixes https://github.com/flutter/flutter/issues/124195
This introduces `TabBar.tabAlignment` while keeping the default alignment for both M2 and M3.
2023-05-01 16:59:55 +00:00
Viren Khatri
293715a6a4
add support to customize Slider interacivity ( #121483 )
...
design doc: https://docs.flutter.dev/go/permissible-slider-interaction
closes #113370
open questions:
- No, as `SliderInteraction.none` doesn't exist anymore.
- Yes (done)
- Yes.
- SliderInteraction
- SliderAction
- Slider.allowedInteraction
- Slider.permissibleInteraction
- Slider.interaction
- Slider.allowedAction
- Slider.permittedAction
2023-05-01 16:42:05 +00:00
Qun Cheng
a433f88d16
Checkbox.fillColor should be applied to checkbox's background color when it is unchecked. (#125643 )
2023-04-28 12:05:31 -07:00