7561 Commits

Author SHA1 Message Date
Polina Cherkasova
2dc811135c
Turn off leak tracker in master to make found leaks not blocking. (#138567) 2023-11-16 14:45:33 -08:00
Jason Simmons
d859865e34
Enable the silent flag for invalid string exceptions when building a TextSpan (#138564)
This error can occur in a release app (for example, if the text comes from user input that is not valid UTF-16).  In that case, TextSpan will replace the invalid text with a placeholder character.
2023-11-16 21:55:26 +00:00
Fedor Blagodyr
27394f6052
Fix sliver persistent header expand animation (#137913)
Added animation status check at showOnScreen method to prevent broken animation of expanding SliverAppBar when focusing EditableText

close #137901
2023-11-16 21:13:14 +00:00
Taha Tesser
19e284f88f
Introduce AnimationStyle (#137945)
This PR introduces `AnimationStyle`, it is used to override default animation curves and durations in several widgets.

fixes  [Add the ability to customize MaterialApp theme animation duration](https://github.com/flutter/flutter/issues/78372)
fixes [Allow customization of showMenu transition animation curves and duration](https://github.com/flutter/flutter/issues/135638)

Here is an example where popup menu curve and transition duration is overriden:

```dart
          popUpAnimationStyle: AnimationStyle(
            curve: Easing.emphasizedAccelerate,
            duration: Durations.medium4,
          ),
```

Set `AnimationStyle.noAnimation` to disable animation.
```dart
    return MaterialApp(
      themeAnimationStyle: AnimationStyle.noAnimation,
```
2023-11-16 18:33:20 +00:00
Bernardo Ferrari
2afec776c9
Make UnderlineInputBorder consistent (#124153)
This was easy to implement. I like the result, I think `borderRadius.zero` -> `borderRadius.circular` makes a nice transition, and many places (like macOS) use an effect similar to this PR, while Google doesn't use anywhere (yet). I'm curious if it is going to break goldens or google testing.

<img width="954" alt="ttt" src="https://user-images.githubusercontent.com/351125/229918871-9f2ab851-6b41-44f5-80b9-c7928a8c0014.png">

What do you think? cc @HansMuller @gspencergoog. Is this something you want, should I ask the community, or do you prefer the current one?

Side effects:
- This makes strokeAlign work with `UnderlineInputBorder` (TODO: fix `drawLine` when borderRadius is zero).
- This is faster than the current implementation (clip is slow on Skia). 🚀 
- We could just call `BoxBorder._paintNonUniformBorder` (if it weren't private). Single LOC implementation.
- Web does this by default:
![image](https://user-images.githubusercontent.com/351125/233448671-90ce62ff-be91-40ca-8007-e82b57f3272e.png)
- Apparently no tests fail and most usages around (via code search) seem to be without a borderRadius.
2023-11-15 23:06:57 +00:00
Greg Spencer
f796e62cee
Prepare ShortcutActivator and ShortcutManager to migrate to KeyEvent from RawKeyEvent. (#136854) 2023-11-15 15:05:58 -08:00
Srujan Gaddam
d8ffc7390c
Pin package:web 0.4.0 (#138428)
This version is needed so that dart:js_interop can move to extension
types. Also adds some code to handle some breaking changes:

- Body -> Response. Body was an IDL interface mixin type we exposed in
dart:html. Going forward, users should either use Request or Response.
- Casts to JSAny. These are temporary until we move package:web types to
extension types. Currently, package:web types can't implement JSObject
as JSObject will move to be an extension type itself.

Co-authored-by: Kevin Moore <kevmoo@users.noreply.github.com>
2023-11-15 15:03:21 -08:00
auto-submit[bot]
82a7a62b45
Reverts "Reland VelocityTracker update (#132291)" (#138512)
Reverts flutter/flutter#137381
Initiated by: Piinks
This change reverts the following previous change:
Original Description:
This updates the implementation to use the stopwatch from the Clock object and piping it through to the TestWidgetsFlutterBinding so it will be kept in sync with FakeAsync.

Relands #132291
Fixes https://github.com/flutter/flutter/issues/97761

The change was reverted due to flakiness it introduced in tests that use fling gestures.
* https://github.com/flutter/flutter/issues/135728
2023-11-15 21:22:19 +00:00
Yegor
465288588f
[web] skip flaky overflow_clipbehavior_none.cupertino.0.png golden check (#138498)
Skipping the test due to
https://github.com/flutter/flutter/issues/137669. It's not clear which
PR started it, so we can't revert anything, and the fix is not yet clear
either. However, the flakiness is very high and is disruptive to the
Flutter team.
2023-11-15 12:58:53 -08:00
Kate Lovett
1ac73332bc
Reland VelocityTracker update (#132291) (#137381)
This updates the implementation to use the stopwatch from the Clock object and piping it through to the TestWidgetsFlutterBinding so it will be kept in sync with FakeAsync.

Relands #132291
Fixes https://github.com/flutter/flutter/issues/97761

The change was reverted due to flakiness it introduced in tests that use fling gestures.
* https://github.com/flutter/flutter/issues/135728
2023-11-15 19:31:48 +00:00
Kate Lovett
cf18d250ad
Fix 2D tap to stop scrolling (#138442)
Adopted from https://github.com/flutter/flutter/pull/133750
That PR was abandoned. This finishes it up so we can land it.
Fixes https://github.com/flutter/flutter/issues/133529

Moves the `PanGestureRecognizer` used to drag the content along both axis to the outer vertical `Scrollable` subclass instead of the inner horizontal `Scrollable` subclass.

- This solves the issue of the inner `Scrollable` gestures being disabled while the outer `Scrollable` is scrolling
- Enables the user to stop the scroll movement by dragging the content again
2023-11-15 18:29:40 +00:00
Binni Goel
684980e97d
SemanticOwner should dispatch creation and disposal events (#138388) 2023-11-15 09:27:55 -08:00
xubaolin
c3f4524061
Reland [SingleChildScrollView] Correct the offset pixels if it is out of range during layout (#136871)
Reland https://github.com/flutter/flutter/pull/136239 which was reverted by https://github.com/flutter/flutter/pull/136744
Fixes https://github.com/flutter/flutter/issues/105733
FIxes https://github.com/flutter/flutter/issues/135865

Do not merge before the customer finish the migration. @Piinks
2023-11-15 01:06:23 +00:00
Taha Tesser
e8c2bb1356
Reland "Update framework_test.dart to remove ButtonBar usage and remove references from other clases (#137550) (#137753)
This PR removes `ButtonBar` usage from `framework_test.dart` class and update other references in preparation for `ButtonBar` deprecation

related to https://github.com/flutter/flutter/issues/127955

reland https://github.com/flutter/flutter/pull/137550
2023-11-14 17:55:05 +00:00
Kostia Sokolovskyi
a6aaad3487
GestureRecognizer should dispatch creation and disposal events. (#138223) 2023-11-10 13:14:14 -08:00
Tirth
983b2f6bc8
Adds useRootNavigator property to PopupMenuButton widget. (#137453)
Adds `useRootNavigator` property to `PopupMenuButton` widget.

Fixes #95425
2023-11-10 16:14:16 +00:00
Renzo Olivares
3225aa5815
Fix text selection in SearchAnchor/SearchBar (#137636)
This changes fixes text selection gestures on the search field when using `SearchAnchor`.

Before this change text selection gestures did not work due to an `IgnorePointer` in the widget tree.

This change:
* Removes the `IgnorePointer` so the underlying `TextField` can receive pointer events.
* Introduces `TextField.onTapAlwaysCalled` and `TextSelectionGestureDetector.onUserTapAlwaysCalled`, so a user provided on tap callback can be called on consecutive taps. This is so that the user provided on tap callback for `SearchAnchor/SearchBar` that was previously only handled by `InkWell` will still work if a tap occurs in the `TextField`s hit box. The `TextField`s default behavior is maintained outside of the context of `SearchAnchor/SearchBar`.

Fixes https://github.com/flutter/flutter/issues/128332 and #134965
2023-11-09 22:12:01 +00:00
hangyu
c4b11d801a
Make it possible to disable tapping to dismiss a tooltip. (#137375)
issue: https://github.com/flutter/flutter/issues/137438

Use case: I want to add action button is tooltip and thus want to disable tap to dismiss a tooltip.

![image](https://github.com/flutter/flutter/assets/108393416/39c606fd-d301-4ed4-a411-4916823e5757)
2023-11-09 20:10:04 +00:00
Qun Cheng
6673fe5cb1
Add onSubmitted and onChanged for SearchAnchor and SearchAnchor.bar (#136840)
Fixes #130687 and #132915

This PR is to add two properties: `viewOnChanged` and `viewOnSubmitted` to `SearchAnchor` and `SearchAnchor.bar` so we can control the search bar on the search view.
2023-11-09 19:08:52 +00:00
sanni prasad
7faa6261c2
Add support for color and color blendmode in FadeInImage (#137681)
Added "color" and "colorBlendMode" props in [FadeInImage](https://api.flutter.dev/flutter/widgets/FadeInImage-class.html) and applied it to both placeholder and the target image.

Added test to check weather both properties are applied to placeholder and the target image.

Fixes  https://github.com/flutter/flutter/issues/128229

Migration is not required because I have added two optional props and have not updated any existing code. Devs may choose to use them if they have a usecase. Existing projects should not get affected.(no errors or warning)
2023-11-08 18:34:47 +00:00
Kostia Sokolovskyi
ca384b84e5
Ticker should dispatch creation and disposal events. (#137844) 2023-11-07 21:14:09 -08:00
Dan Field
e7246898b0
Revert "Add no-shuffle to reorderable_list_test.dart" (#137715)
Reverts flutter/flutter#137698

Not needed after https://github.com/flutter/flutter/pull/137697

Must not land until after that one
2023-11-07 15:17:00 -08:00
Qun Cheng
ed70f4e248
Adaptive Switch (#130425)
Currently, `Switch.factory` delegates to `CupertinoSwitch` when platform
is iOS or macOS. This PR is to:
* have the factory configure the Material `Switch` for the expected look
and feel.
* introduce `Adaptation` class to customize themes for the adaptive
components.
2023-11-07 10:26:23 -08:00
Kostia Sokolovskyi
c0b21b16ef
SemanticsHandle should dispatch creation and disposal events. (#137960) 2023-11-06 14:14:42 -08:00
Kostia Sokolovskyi
4880aab113
ScrollActivity should dispatch creation and disposal events. (#137961) 2023-11-06 14:14:08 -08:00
Kostia Sokolovskyi
2d9a075dfc
Cover text_selection tests with leak tracking. (#137009) 2023-11-06 14:10:50 -08:00
auto-submit[bot]
3649deb3f6
Reverts "Update BottomNavigationBar tests for M3" (#137948)
Reverts flutter/flutter#136624
Initiated by: HansMuller
This change reverts the following previous change:
Original Description:
This PR updates `BottomNavigationBar` unit tests for M3 migration.

More info in https://github.com/flutter/flutter/issues/127064

It was somewhat complex because existing tests relied on a lot of magic numbers.
2023-11-06 16:43:19 +00:00
Bruno Leroux
59d4d76705
Update BottomNavigationBar tests for M3 (#136624)
This PR updates `BottomNavigationBar` unit tests for M3 migration.

More info in https://github.com/flutter/flutter/issues/127064

It was somewhat complex because existing tests relied on a lot of magic numbers.
2023-11-06 15:15:07 +00:00
Taha Tesser
826bb0a809
Provide a helpful error message when ColorScheme.brightness doesn't match ThemeData.brightness (#137611)
fixes [Unexpected behaviour with ColorScheme.fromSeed and Brightness.dark](https://github.com/flutter/flutter/issues/127523)
2023-11-06 13:34:10 +00:00
Kostia Sokolovskyi
e8d9d9bfd5
HeroController should dispatch creation and disposal events. (#137835) 2023-11-03 20:42:47 -07:00
Alex Isaienko
b5fb6652d6
InheritedElement.removeDependent() (#129210)
Call the `dependency.removeDependent(this)` instead of `dependency._dependents.remove(this)` inside the `Element.deactivate()`. This allows `InheritedElements` to know when they can release resources associated with a given dependent `Element`.

Fixes #129207
2023-11-03 23:27:21 +00:00
Michael Goderbauer
8a0f9118ea
Remove unused generic type from BottomSheet (#137791)
Fixes https://github.com/flutter/flutter/issues/137424.

The generic type argument was unused.
2023-11-03 22:25:37 +00:00
Chris Bracken
4455e86d90
Send caret rect to embedder on selection update (#137863)
Background: In the framework, the position of the caret rect is updated on each cursor position change such that if the user initiates composing input, the current cursor position can be used for the first character until the composing rect can be sent.

Previously, no update was sent on selection changes, on the assumption that the most recent cursor position will remain the correct position for the duration of the selection. While this is the case for forward selections, it is an incorrect assumption for reversed selections, where selection.base > selection.extent.

We now update the cursor position during selection changes such that the cursor position sent to the embedder is always the position at which next text input would occur. This is the start position of the selection or min(selection.baseOffset, selection.extentOffset).

Issue: https://github.com/flutter/flutter/issues/137677
2023-11-03 22:09:09 +00:00
Kostia Sokolovskyi
a52f030cda
InkFeature should dispatch creation and disposal events. (#137793) 2023-11-03 12:34:16 -07:00
Kostia Sokolovskyi
2369897f09
AppLifecycleListener should dispatch creation and disposal events. (#137840) 2023-11-03 12:31:46 -07:00
Binni Goel
8e7fce9813
[leak-tracking] Add more leak tracking in test/painting #3 (#136170) 2023-11-03 06:24:38 -07:00
Valentin Vignal
f15f2313b9
Fixes DragTarget crash if Draggable.data is null (#133136)
Makes the `data` parameter of `Draggable` non-nullable.

Fixes https://github.com/flutter/flutter/issues/84816

*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-11-02 17:59:16 +00:00
derdilla
7646430c25
Cupertino date picker should dispose scroll controllers it created. (#135355) 2023-11-02 10:36:57 -07:00
Jasper van Riet
55eb5e11db
Remove duplicate padding on CupertinoFormSection (#137039)
Fixes #128419, removes the duplicate padding that exists around the header and footer on `CupertinoFormSection`. This PR takes the implementation in #129065 and adds tests. I added the ones suggested in the PR review, as well as one more to test that `margin` is passed correctly from `CupertinoFormSection` to `CupertinoListSection`.

Note: I can't quite figure out if this is also a fix to #121543.

Potential review questions:

- Is the use of `offsetMoreOrLessEquals` here correct? I used it because of the vertical positioning. The horizontal positioning is always exact.

### Screenshots
<details>
  <summary>Before</summary>
  
![image](https://github.com/flutter/flutter/assets/5138348/1bce10c9-706a-40c8-a581-2dcb574ed937)
</details>
<details>
  <summary>After</summary>
  
![image](https://github.com/flutter/flutter/assets/5138348/cd1d529b-7be5-45df-af31-0f7760dc3fe9)
</details>
2023-11-02 16:40:59 +00:00
Binni Goel
39f2974192
Instrument ImageStreamCompleterHandle for LeakTracking (#137482) 2023-11-02 07:49:21 -07:00
Binni Goel
e2d5e8fdce
Instrumented PipelineOwner for leak tracking (#137494) 2023-11-02 07:48:22 -07:00
Qun Cheng
4a0f261b4e
Add Card.filled and Card.outlined factory methods (#136229)
Fixes #119401

This PR is to:
* add `Card.filled` and `Card.outlined` factory methods so that we can use tokens for these two types of cards to generate default theme instead of providing hard-corded values in example.
* update card.2.dart example.
* add test file for card.2.dart example.
* fix some mismatch caused by editing the auto-generated defaults by hand in navigation_bar.dart and navigation_drawer.dart.
2023-11-01 23:29:49 +00:00
auto-submit[bot]
b47e4c4acb
Reverts "Update framework_test.dart to remove ButtonBar usage and remove references from other clases" (#137731)
Reverts flutter/flutter#137550
Initiated by: Piinks
This change reverts the following previous change:
Original Description:
This PR removes `ButtonBar` usage from `framework_test.dart` class and update other references in preparation for `ButtonBar` deprecation

related to https://github.com/flutter/flutter/issues/127955
2023-11-01 22:58:19 +00:00
Tirth
43dc3fcfcc
Added EdgeInsetsDirectional.copyWith (#137559)
Added `EdgeInsetsDirectional.copyWith` named constructor.

Fixes #137475
2023-11-01 22:30:15 +00:00
Taha Tesser
b1f5d96a82
Update framework_test.dart to remove ButtonBar usage and remove references from other clases (#137550)
This PR removes `ButtonBar` usage from `framework_test.dart` class and update other references in preparation for `ButtonBar` deprecation

related to https://github.com/flutter/flutter/issues/127955
2023-11-01 22:03:54 +00:00
Binni Goel
01b8854011
Fix. typos (#137479)
## Description

This PR fixes typos in 
- `editable_text_show_on_screen_test.dart`
- `form_test.dart`
- `framework.dart`
2023-11-01 19:56:47 +00:00
Zachary Anderson
2630047680
Add no-shuffle to reorderable_list_test.dart (#137698)
For https://github.com/flutter/flutter/issues/137696
2023-11-01 08:47:52 -07:00
Polina Cherkasova
d50f1fa9c9
Add dependency on leak_tracker and leak_tracker_testing to flutter_test. (#137646) 2023-10-31 19:19:12 -07:00
Kostia Sokolovskyi
cdcacd06e4
PerformanceModeRequestHandle should dispatch creation and disposal events. (#137642) 2023-10-31 16:53:53 -07:00
Binni Goel
e7726ea6f2
fix. typos (#137178)
## Description

This PR fixes typos in 
- `checkbox.dart`
- `chip_test.dart`
- `color_scheme.dart`
- `color_scheme_test.dart`
- `curves.dart`
2023-10-31 23:27:03 +00:00