Commit Graph

23387 Commits

Author SHA1 Message Date
Michael Goderbauer
8bed1cbe42
Switch to FilterQuality.medium for images (#148799)
https://github.com/flutter/flutter/issues/148253
2024-05-31 03:50:30 +00:00
Benji Farquhar
51168862fb
Add support for ExpansionPanel custom splash color (#147126)
Relates to https://github.com/flutter/flutter/pull/147098 and https://github.com/flutter/flutter/issues/147097

Aside from fixing the expland/collapse icon color in the other PR, I noticed the splash color on both the icon button and the full expansion panel (if ExpansionPanel.canTapOnHeader is set to true) is just `Theme.of(context).splashColor` on the `InkWell` and `Theme.of(context).highlightColor` on the `IconButton` which may not suit the color scheme of the `ExpansionPanel`, so I have added a custom field `splashColor`, which will effect both the `IconButton` and the full panel `Inkwell`.
2024-05-31 01:44:32 +00:00
Gray Mackall
d89ae48520
Manual pub roll w/ gradle lockfile regeneration (#149342)
Manual recreation of https://github.com/flutter/flutter/pull/148911

Entire PR is just the output of 
```
flutter update-packages --force-upgrade
```
followed by (run from the root of the flutter repo)
```
find . -type d -name 'android' | dart dev/tools/bin/generate_gradle_lockfiles.dart --no-gradle-generation --no-exclusion
```
2024-05-30 23:04:08 +00:00
Victor Sanni
3496b1d397
Add feedback for long press on iOS (#148922)
Adds the click system sound and heavy-impact haptic feedback to iOS on long presses.

Fixes #148391
2024-05-30 23:00:21 +00:00
Lau Ching Jun
557a959547
Adding a default case to unblock engine roll. (#149353)
Similar to https://github.com/flutter/flutter/pull/149274
2024-05-30 15:01:56 -07:00
Ian Hickson
5933e99c6c
Remove hidden dependency on ABI. (#148987)
This is part 17 of a broken down version of the #140101 refactor (though this particular dependency didn't actually exist back then).

This only makes one dependency explicit. Further PRs will do the same for other dependencies, until these APIs have no hidden dependencies.

I also snuck in a minor stylistic change, using interpolation instead of explicit `toString`, to make the code more idiomatic. (I'm actually surprised that that didn't trigger a lint, I thought we had a lint to catch that. I must be thinking of something else though.)

This PR makes no effort to keep the order of parameters reasonable. There is an existing TODO to do a refactor sweep later that does nothing but reorder arguments/parameters/fields to be consistent.
2024-05-30 19:12:22 +00:00
Mitchell Goodwin
54573bc875
Have Material widgets in a Cupertino App partially use Cupertino theme (#139253)
Fixes #138621

Fixes and issue where if a Material widget is used in a Cupertino App, then some parts of it's default Material 3 theming would show up as purplish. This could be fixed by wrapping your app with a Material theme, but that's a little awkward.

Material and Cupertino themes interact with each other a little oddly. If a theme of either is searched for but does not exist, then a default one is generated. So if a Material widget is in a Cupertino app that does not already have a Material theme, then a fallback Material theme will be created. This PR makes it so that, in this case when that Material theme is created, it's default colors will be based on the Cupertino theme.

Another oddity is that a Material theme always wraps itself with a Cupertino theme that's values are based on the Material theme. So before this change, a Material widget would theoretically add a new Material based Cupertino theme to the tree. So I added logic that would have the Material theme check to see if a Cupertino theme exists, before it overwrites it.

Before:
![image](https://github.com/flutter/flutter/assets/58190796/95874076-e943-48fa-ba9d-1d7b0f5a2f38)

After:
<img width="386" alt="Screenshot 2023-11-29 at 10 37 09 AM" src="https://github.com/flutter/flutter/assets/58190796/959ccfd9-3439-438e-ad36-20597334837a">

Update:
I changed it to not rely on the Material 3 flag. Instead, if a Material theme is searched for and there is already a Cupertino theme in the tree, then it will use that Cupertino theme instead of generating a new. Also, if a Material theme is searched for, and it does not find one already in the tree, but does find a Cupertino theme, then it will generate one with a color palette based off of that Cupertino theme's colors.

After with this change:
<img width="390" alt="Screenshot 2024-05-09 at 10 16 22 AM" src="https://github.com/flutter/flutter/assets/58190796/79765d04-a7a3-4eb5-9477-11668ed138e5">

We should still probably suggest for developers to include a Material theme in their Cupertino app if they wish to use widgets from both packages.
2024-05-30 17:54:53 +00:00
Nate
ee3557afe0
Refactor Material build method (#147430)
Only a code quality change, improves readability using `switch`.
2024-05-30 10:54:17 -07:00
MajdSallora
df95cb2984
Add locale in DatePickerThemeData (#148292)
*This PR changes the date picker were add locale in DatePickerThemeData*

*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.*
Fixes #148202 

*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-05-30 17:53:03 +00:00
auto-submit[bot]
3d4fd550c2
Reverts "Enable explicitChildNodes for the AlertDialog content (#149130)" (#149333)
Reverts: flutter/flutter#149130
Initiated by: Piinks
Reason for reverting: Google testing did not run on this PR and multiple semantics screen shots from internal testing look incorrect. 
Original PR Author: TahaTesser

Reviewed By: {goderbauer}

This change reverts the following previous change:
fixes [AlertDialog content semantics merged](https://github.com/flutter/flutter/issues/147574)

### 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,
      // showSemanticsDebugger: true,
      home: Scaffold(
        body: SafeArea(
          child: Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              children: <Widget>[
                const Column(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: <Widget>[
                    Text('Some text'),
                    Text('More text'),
                  ],
                ),
                Builder(builder: (BuildContext context) {
                  return ElevatedButton(
                    onPressed: () {
                      showDialog<void>(
                        context: context,
                        builder: (BuildContext context) {
                          return AlertDialog(
                            title: const Text('Dialog Title'),
                            content: const Column(
                              children: <Widget>[
                                Text('Some text'),
                                Text('More text'),
                              ],
                            ),
                            actions: <Widget>[
                              TextButton(
                                onPressed: () {
                                  Navigator.of(context).pop();
                                },
                                child: const Text('Close'),
                              ),
                            ],
                          );
                        },
                      );
                    },
                    child: const Text('Open Dialog'),
                  );
                }),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
```

</details>

### Before vs After

![Screenshot 2024-05-27 at 14 59 57](https://github.com/flutter/flutter/assets/48603081/3b231a7a-db71-4dbf-bd4a-dd44a537cae8)

![Screenshot 2024-05-27 at 14 56 04](https://github.com/flutter/flutter/assets/48603081/219c1de5-ad35-49b3-a80f-4f036184e22b)
2024-05-30 17:43:26 +00:00
John Angelo Cordero
11cbe41555
allow changing textAlign of TextField in DropdownMenu (#148074)
PR for #147991
2024-05-30 16:57:00 +00:00
flyboy
db5c1434e6
Fix Slider throws an error when _labelPainter text is null (#148462)
*Fix #148159*
2024-05-30 14:49:13 +00:00
Taha Tesser
6a0e0bfdc5
Enable explicitChildNodes for the AlertDialog content (#149130)
fixes [AlertDialog content semantics merged](https://github.com/flutter/flutter/issues/147574)

### 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,
      // showSemanticsDebugger: true,
      home: Scaffold(
        body: SafeArea(
          child: Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              children: <Widget>[
                const Column(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: <Widget>[
                    Text('Some text'),
                    Text('More text'),
                  ],
                ),
                Builder(builder: (BuildContext context) {
                  return ElevatedButton(
                    onPressed: () {
                      showDialog<void>(
                        context: context,
                        builder: (BuildContext context) {
                          return AlertDialog(
                            title: const Text('Dialog Title'),
                            content: const Column(
                              children: <Widget>[
                                Text('Some text'),
                                Text('More text'),
                              ],
                            ),
                            actions: <Widget>[
                              TextButton(
                                onPressed: () {
                                  Navigator.of(context).pop();
                                },
                                child: const Text('Close'),
                              ),
                            ],
                          );
                        },
                      );
                    },
                    child: const Text('Open Dialog'),
                  );
                }),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
```

</details>

### Before vs After

![Screenshot 2024-05-27 at 14 59 57](https://github.com/flutter/flutter/assets/48603081/3b231a7a-db71-4dbf-bd4a-dd44a537cae8)

![Screenshot 2024-05-27 at 14 56 04](https://github.com/flutter/flutter/assets/48603081/219c1de5-ad35-49b3-a80f-4f036184e22b)
2024-05-30 09:59:22 +00:00
engine-flutter-autoroll
697d99fae8
Manual roll Flutter Engine from 60968ee3bde7 to 8d5d14a1db95 (1 revision) (#149263)
Manual roll requested by jacksongardner@google.com

60968ee3bd...8d5d14a1db

2024-05-29 skia-flutter-autoroll@skia.org Manual roll Dart SDK from 641d61332238 to ef405fbe3917 (12 revisions) (flutter/engine#53089)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC jacksongardner@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-05-30 00:53:23 +00:00
auto-submit[bot]
ebc414337d
Reverts "Prevent LayoutBuilder from rebuilding more than once (#147856)" (#149279)
Reverts: flutter/flutter#147856
Initiated by: loic-sharma
Reason for reverting: tree is closed with errors like: 

```
test/integration.shard/break_on_framework_exceptions_test.dart: breaks when rebuilding dirty elements throws [E]
  Expected: <45>
    Actual: <2756>
  
  package:matcher                                                       expect
  test\integration.shard\break_on_framework_exceptions_test.dart 56:5   main.expectException
  ===== asynchronous gap ===
Original PR Author: LongCatIsLooong

Reviewed By: {goderbauer}

This change reverts the following previous change:
Fixes https://github.com/flutter/flutter/issues/146379: introduces `Element.buildScope` which `BuildOwner.buildScope` uses to identify subtrees that need skipping (those with different `BuildScope`s). If `Element.update` calls `updateChild` then dirty children will still be rebuilt regardless of their build scopes. 

This also introduces `LayoutBuilder.applyDoubleRebuildFix` migration flag which should only live for a week or less. 

Caveats: 

`LayoutBuilder`'s render object calls `markNeedsLayout` if a descendant Element is dirty. Since `markNeedsLayout` also implies `markNeedsPaint`, the render object is going to be very repaint/relayout-happy.

Tests: 

Presubmits with the migration flag set to true: https://github.com/flutter/flutter/pull/147856/checks?check_run_id=24629865893
2024-05-29 23:29:19 +00:00
Danny Tuppeny
182c1e6a36
Unskip expression evaluation test (#149253)
This test was skipped in https://github.com/flutter/flutter/pull/148737
because it had became flaky because instances created in expression
evaluation were being collected quickly. The change in
ffbbdb5a10
prevents things in the VM Service's ring buffer from being GC'd which
should resolve the issue.

I am unable to reproduce this test flaking locally on latest code.

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



## 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 `///`).
- [ ] 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-05-29 23:24:36 +01:00
Yegor
35543e9117
temporarily disable SemanticsAction tests to unblock engine change (#149274)
These tests essentially count the number of values in the engine enums. https://github.com/flutter/engine/pull/53094 is adding a new value, which causes these tests to fail. Temporarily disabling these tests so that the engine change can proceed.
2024-05-29 22:22:25 +00:00
LongCatIsLooong
bafdb124c7
Prevent LayoutBuilder from rebuilding more than once (#147856)
Fixes https://github.com/flutter/flutter/issues/146379: introduces `Element.buildScope` which `BuildOwner.buildScope` uses to identify subtrees that need skipping (those with different `BuildScope`s). If `Element.update` calls `updateChild` then dirty children will still be rebuilt regardless of their build scopes. 

This also introduces `LayoutBuilder.applyDoubleRebuildFix` migration flag which should only live for a week or less. 

Caveats: 

`LayoutBuilder`'s render object calls `markNeedsLayout` if a descendant Element is dirty. Since `markNeedsLayout` also implies `markNeedsPaint`, the render object is going to be very repaint/relayout-happy.

Tests: 

Presubmits with the migration flag set to true: https://github.com/flutter/flutter/pull/147856/checks?check_run_id=24629865893
2024-05-29 22:03:20 +00:00
Ellet
e553bbc2ba
Update progress_indicator.dart to indicate the adaptive option is for both macOS and iOS (#145246)
Since we are using The `CupertinoScrollBar` for both macOS and iOS, it's a good idea to update the description of the `adaptive` function to indicate it will be used for macOS and iOS

*Update progress_indicator.dart to indicate the adaptive option is for both macOS and iOS.*

![image](https://github.com/flutter/flutter/assets/73608287/51c21a43-ce64-4253-aff7-1854a7366eea)
2024-05-29 19:06:07 +00:00
LinXunFeng
d424b64229
_ModalScopeStatus as InheritedModel (#149022)
According to previous discussion at https://github.com/flutter/flutter/pull/145389#discussion_r1561564845, this change makes `_ModalScopeStatus` an `InheritedModel` rather than an `InheritedWidget`, and provides the following methods.

- `isCurrentOf`
- `canPopOf`
- `settingsOf`

For example, `ModalRoute.of(context)!.settings` could become `ModalRoute.settingsOf(context)` as a performance optimization.
2024-05-29 18:46:04 +00:00
LongCatIsLooong
557fca4582
Add a sentinel value for TextStyle.height (#149049)
Fixes: https://github.com/flutter/flutter/issues/58765

The rationale for the choice of the sentinel value: https://github.com/flutter/engine/pull/52940
The exact value of `kTextHeightNone` should be kept as an implementation detail. It's unfortunate that the current value `0` is dangerously close to `TextStyle.height`'s valid domain. If we ever allow `TextStyle.height == 0` (which totally makes sense) then it shouldn't be difficult to change the const.
2024-05-29 18:24:16 +00:00
Polina Cherkasova
c85fa6abf4
Clean leak in editable_text_test.dart. (#149223)
Introduced by https://github.com/flutter/flutter/pull/149042

<img width="145" alt="Screenshot 2024-05-28 at 6 25 22 PM" src="https://github.com/flutter/flutter/assets/12115586/5eb32012-b1c4-4188-8e9b-a6631483960c">
2024-05-29 15:41:18 +00:00
Hany Mohamed
9ea9726b21
Change snack bar default hitTestBehavior to deferToChild when SnackBarThemeData.insetPadding is not null (#148568)
The PR changes the default value of hitTestBehavior in snack bars to `HitTestBehavior.deferToChild` when snackBarTheme.insetPadding is not null, so that widgets behind snack bars affected by the value set to insetPadding, remain interactive even while a snack bar is visible. This PR can be considered as an extension to what have been done in PR #127959 which fixes the same problem but for individual snack bars with margin not being null. This PR works on the theme level.

*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.*
#148566
2024-05-29 04:31:32 +00:00
auto-submit[bot]
886de22182
Reverts "sliverGridDelegate mainAxisExtent add assert (#148470)" (#149224)
Reverts: flutter/flutter#148470
Initiated by: eyebrowsoffire
Reason for reverting: Unit test failures closing the tree.
Original PR Author: hello-coder-xu

Reviewed By: {QuncCccccc, Piinks}

This change reverts the following previous change:
* sliverGridDelegate mainAxisExtent add assert,Avoid incorrect use *

Fixes https://github.com/flutter/flutter/issues/138871
2024-05-29 02:33:16 +00:00
flyboy
af5a1a9e11
sliverGridDelegate mainAxisExtent add assert (#148470)
* sliverGridDelegate mainAxisExtent add assert,Avoid incorrect use *

Fixes https://github.com/flutter/flutter/issues/138871
2024-05-29 00:26:08 +00:00
Luis
b1540324e5
Fix SearchAnchor suggestions not refreshing after long API call (#148767)
Fixes https://github.com/flutter/flutter/issues/148765.

## Fix Demo
https://github.com/flutter/flutter/assets/28322469/ad76ac8b-5e84-4fee-b04c-fbc9fa919450
2024-05-29 00:20:18 +00:00
Loïc Sharma
1f4e378de1
Add link to golden file test docs in the framework gardener guide (#149207)
This also adds a link from the Framework gardener guide.
2024-05-28 23:55:58 +00:00
Polina Cherkasova
65e3007687
Remove opt out for CurvedAnimation. (#147594) 2024-05-28 16:35:29 -07:00
LongCatIsLooong
0214afb40b
Fix the RenderFlex.computeDryBaseline implementation to match computeDistanceToActualBaseline (#149062)
Per Hixie's comment [here](https://github.com/flutter/flutter/issues/145739#issuecomment-2128006146), keep the current behavior
2024-05-28 23:21:08 +00:00
Polina Cherkasova
c109b3cb02
Clean leaky test. (#149199)
Introduced by https://github.com/flutter/flutter/pull/149006

To repro run:

`flutter test /Users/polinach/_/flutter_dev/packages/flutter/test/material/text_button_test.dart --dart-define LEAK_TR`

<img width="268" alt="Screenshot 2024-05-28 at 11 50 33 AM" src="https://github.com/flutter/flutter/assets/12115586/c1a1bf5e-4df4-4819-b897-b09021d3a07a">
2024-05-28 23:06:10 +00:00
Gray Mackall
df64ca0b11
Change android_plugin_new_output_dir_test.dart test description (#149198)
Changes the test description to what I understand it is testing. 

Context at https://discord.com/channels/608014603317936148/846507907876257822/1245077048599515157.

cc @chunfengyao as the original author, as I see you are still active on Github 🙂
2024-05-28 23:04:10 +00:00
Bruno Leroux
fdca33c5b1
fix M2 InputDecorator suffix icon doesn't turn red on error (#149161)
The suffixIcon of a TextField with an error now turns red like it should (on Material 2).
2024-05-28 11:27:55 -07:00
Varun Kamani
e2e68c047c
Add selectionOverlayBuilder in CupertinoDatePicker and CupertinoTimer… (#143079)
It's now possible to override the default selection overlay with CupertinoDatePicker.selectionOverlayBuilder and CupertinoTimerPicker.selectionOverlayBuilder.
2024-05-28 11:24:57 -07:00
Justin McCandless
980b5a1976
Mouse onEnter and onExit now support hovering stylus (#149006)
Hovering with a stylus will now behave similarly to hovering with a mouse. For example, hovering a button will show the button's hovered styling.
2024-05-28 10:39:30 -07:00
LongCatIsLooong
b1221a92dc
Remove TextEditingController private member access (#149042)
Fixes https://github.com/flutter/flutter/issues/148692

I intend to CP this.
2024-05-28 17:37:25 +00:00
Kevin Moore
891432c30f
[tool] Use kebabCase directly (#149150)
Drop silly snakeCase(..., '-') bits
2024-05-28 15:33:15 +00:00
Martin Kustermann
9938ab1c60
[web] Remove --dart-sdk flag to dart2wasm compiler (#149129)
Dart2wasm only needs a platform file, which contains the compiled
`dart:*` libraries. There's no need to specify a seperate `--dart-sdk`
option (anymore).

(See also https://dart-review.googlesource.com/c/sdk/+/366821)
2024-05-28 09:48:44 +02:00
Bruno Leroux
0f3882e050
Fix Linux numpad shortcuts on web (#148988)
## Description

This PRs fixes a Web issue on Linux related to numpad keys.
In https://github.com/flutter/flutter/pull/145464, I introduced numpad shortcuts for Linux. These shortcuts work well on a desktop Linux application but they broke the Linux+Web numpad logic.

When I added these shortcuts, I expected them to not be active on Web (because I knew that on Web, those shortcuts are handled by the browser). But there is a trick: text editing shortcuts are still defined on Web but they are disabled at the editable text level so one can use them in components that are not `EditableText` (see https://github.com/flutter/flutter/pull/103377).
In this PR, I used the same approach than for other text editing shortcuts: when on web associate those shortcuts to the `DoNothingAndStopPropagationTextIntent` intent.

## Related Issue

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

## Tests

Updates 2 tests.
Adds 2 tests.
2024-05-25 19:59:19 +00:00
Joodo
734d243bc8
fix popup menu offset when using useRootNavigator in PopupMenu (#144670)
fix issue #144669
2024-05-24 21:38:08 +00:00
hangyu
8ff57091bc
[a11y] Slider should respect bold text setting (#149053)
Fix https://github.com/flutter/flutter/issues/147600

internal GAR issue: b/316933135

reopen from #148435
2024-05-24 19:48:14 +00:00
Łukasz Gawron
a53b78ddfb
Fix TwoDimensionalViewport's keep alive child not always removed (when no longer should be kept alive) (#148298)
- Fixes a child not removed from `_keepAliveBucket` when widget is no longer kept alive offscreen. Bug was triggering assert in performLayout.
- Adds test to cover the case from bug report

Fixes #138977
2024-05-24 16:26:07 +00:00
Nate
f419177057
Reland "Update FocusManager platform check to include iOS" (#148984)
It looks like removing `kIsWeb` from the `FocusManager._appLifecycleListener` platform check is causing [memory leaks](https://github.com/flutter/flutter/issues/148985) and test failures.

This pull request fixes #148475 and prevents the test failures shown in #148978.
2024-05-23 23:13:18 +00:00
Taha Tesser
ec69f001fc
Fix SnackBar action text button overlay color (#148961)
fixes [`SnackBar` action hover state background too hard to see](https://github.com/flutter/flutter/issues/141343)

### 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 const MaterialApp(
      home: Scaffold(
        body: Center(
          child: ScaffoldButton(),
        ),
      ),
    );
  }
}

class ScaffoldButton extends StatelessWidget {
  const ScaffoldButton({super.key});

  @override
  Widget build(BuildContext context) {
    return TextButton(
      onPressed: () {
        ScaffoldMessenger.of(context).showSnackBar(
          SnackBar(
            behavior: SnackBarBehavior.floating,
            width: 320,
            content: const Text('This is a snackbar!'),
            action: SnackBarAction(
              label: 'Close',
              onPressed: () {},
            ),
          ),
        );
      },
      child: const Text('Launch snackbar'),
    );
  }
}

```

</details>

### Before
<img src="https://github.com/flutter/flutter/assets/48603081/88b53c92-6184-4faf-88e1-ac70f78993b3"/> 

### After
 <img src="https://github.com/flutter/flutter/assets/48603081/3e03c903-90c0-4da4-b49a-0070208d56d1"  />
2024-05-23 22:42:52 +00:00
wangyognqi
881e29f94a
Fix the second TextFormField to trigger onTapOutside (#148930)
This PR attempts to fix https://github.com/flutter/flutter/issues/127597
2024-05-23 22:25:51 +00:00
Ian Hickson
2025ebe767
Remove hidden dependencies on HttpClient (#148773)
This is part 16 of a broken down version of the #140101 refactor.

This only makes one dependency explicit. Further PRs will do the same for other dependencies, until these APIs have no hidden dependencies.

This PR makes no effort to keep the order of parameters reasonable. There is an existing TODO to do a refactor sweep later that does nothing but reorder arguments/parameters/fields to be consistent.
2024-05-23 18:20:50 +00:00
Renzo Olivares
84fe3b6e53
Revert "Update FocusManager platform check to include iOS" (#148978) 2024-05-23 10:46:10 -07:00
Nate
8d955cdd64
Update FocusManager platform check to include iOS (#148612)
Both iOS and Android run into issues when the FocusManager starts responding to app lifecycle changes.

Fortunately, this feature is primarily meant for desktop platforms, so the problem can be resolved with a platform check.

fixes https://github.com/flutter/flutter/issues/148475
2024-05-23 16:40:45 +00:00
Matej Knopp
02d5286e02
[iOS] fix hot restart with native assets (#148752)
Fixes https://github.com/flutter/flutter/issues/148687

Adds support for running the hot restart and reload integration test on
iOS simulator.

## 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 `///`).
- [ ] 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-05-23 18:30:55 +02:00
LongCatIsLooong
a766945bdd
Allow RenderObject.getTransformTo to take an arbitrary RenderObject in the same tree (#148897)
This is https://github.com/flutter/flutter/pull/130192 but without the additional parameter.

Fixes https://github.com/flutter/flutter/issues/146764, https://github.com/flutter/flutter/issues/148410
2024-05-22 23:32:24 +00:00
Helin Shiah
edf312d506
Add frame number and widget location map service extension (#148702)
This helps us add widget rebuild counts to the DevTools performance page: https://github.com/flutter/devtools/issues/4564
2024-05-22 21:29:27 +00:00
LongCatIsLooong
d57ea48ca1
Remove an assert with false positives (#148795)
Fixes https://github.com/flutter/flutter/issues/110343.

This is not an important piece of guardrail and the iOS embedder only expects best-effort results anyways.
2024-05-22 21:25:31 +00:00
Renzo Olivares
b2eda0624a
Revert "Fix the second TextFormField to trigger onTapOutside" (#148909) 2024-05-22 13:40:59 -07:00
wangyognqi
9acbc1d4a2
Fix the second TextFormField to trigger onTapOutside (#148206)
This PR attempts to fix https://github.com/flutter/flutter/issues/127597
2024-05-22 18:33:14 +00:00
Gray Mackall
eba7b97bb9
Try removing robolectric from integration_test tests (#148803)
May fix https://github.com/flutter/flutter/issues/148393.

There are reports on the robolectric issue tracker of >`4.10.3` causing the error we are seeing
https://github.com/robolectric/robolectric/issues/8158
The test doesn't actually need robolectric (and didn't originally use it, or flake before using it), but it was added in https://github.com/flutter/flutter/pull/144348. We can safely remove it by mocking the call to `View.generateViewId()`, so try removing it and see if flakes go away.
2024-05-22 18:29:19 +00:00
Victor Eronmosele
4c929f0f44
Prevent test folder deletion on running flutter create --empty on an existing app project (#147160)
This PR modifies the `flutter create --empty` command to not delete the `test/` folder when run on an existing app project. 

Before:
```bash
flutter create my_app --empty
mkdir my_app/test
if test -d my_app/test; then echo "test exists"; else echo "test does not exist"; fi # test exists
flutter create my_app --empty  
if test -d my_app/test; then echo "test exists"; else echo "test does not exist"; fi # test does not exist
```

After:
```bash
flutter create my_app --empty
mkdir my_app/test
if test -d my_app/test; then echo "test exists"; else echo "test does not exist"; fi # test exists
flutter create my_app --empty  
if test -d my_app/test; then echo "test exists"; else echo "test does not exist"; fi # test exists
```
Fixes https://github.com/flutter/flutter/issues/134928
2024-05-22 17:37:05 +00:00
Daco Harkes
1f16d9121c
[native_assets] Add support for link hooks (#148474)
This PR adds support invoking `link.dart` hooks.

Link hooks can add new assets. Link hooks can transform assets sent to link hook from build hooks.

This PR does not yet add support for getting tree-shake information in the link hooks. This is pending on defining the `resources.json` format (https://github.com/dart-lang/sdk/issues/55494).

Issue:

* https://github.com/flutter/flutter/issues/146263

## Implementation considerations

The build hooks could be run before Dart compilation and the link hooks after Dart compilation. (This is how it's done in Dart standalone.) However, due to the way the `Target`s are set up, this would require two targets and serializing and deserializing the `BuildResult` in between these. This would lead to more code but no benefits. Currently there is nothing that mandates running build hooks before Dart compilation.

## Testing

* The unit tests verify that the native_assets_builder `link` and `linkDryRun` would be invoked with help of the existing fake.
* The native assets integration test now also invokes an FFI call of a package that adds the asset during the link hook instead of the build hook.
  * In order to keep coverage of the `flutter create --template=package_ffi`, `flutter create` is still run and the extra dependency is added and an extra ffi call is added. (Open to alternative suggestions.)
2024-05-22 16:02:00 +00:00
Dimil Kalathiya
73bf206f35
CupertinoDialogRoute leak fix (#148774) 2024-05-22 07:43:33 -07:00
Taha Tesser
ea7cf54b42
Introduce WidgetStateBorderSide.lerp (#148122)
fixes [Consolidate `_LerpSides` classes with `WigetStateProperty<BorderSide?>` type  into a new `WidgetStateBorderSide.lerp`](https://github.com/flutter/flutter/issues/148057)
2024-05-22 07:11:07 +00:00
holzgeist
43548359c9
add default-flavor field to flutter pubspec, which will be used as the flavor in flutter build/run if --flavor is not provided (#147968)
This PR adds a new flag `default-flavor` in the `flutter` section of `pubspec.yaml`. It allows developers of multi-flavor android apps to specify a default flavor to be used for `flutter run`, `flutter build` etc.
Using `flutter run` on flavored apps already works without specifying `--flavor` already works on iOS (it defaults to the `runner` schema), so I (and others in #22856) figured this would be nice to have.

fixes #22856
2024-05-22 05:11:24 +00:00
Victor Sanni
81f962de40
Make hover tests functional and cleanup mouse pointers in Material toggleables (#148808)
Tests in Material toggleables (`Radio`, `Switch`, `Checkbox`) which require hovering using a mouse pointer do not include `addTearDown(gesture.removePointer)` to remove the mouse pointer once the test concludes.

Also, hovering tests in Material `Checkbox` currently have no functionality (i.e what is painted before hovering = what is painted while hovering). For example:

357bd65749/packages/flutter/test/material/checkbox_test.dart (L880-L896)

This PR adds `addTearDown(gesture.removePointer)` to `Radio`, `Switch`, and `Checkbox` tests, and functionality for `Checkbox` hover tests.

Fixes #148809.
2024-05-22 04:58:01 +00:00
Amir Panahandeh
7d529a7521
Fix two dimensional viewport unexpected null exception when no child is laid out (#148256)
- Fixes #148255
2024-05-21 22:54:34 +00:00
Polina Cherkasova
87aa8423a2
Fix test that leaks images. (#148494)
Contributes to https://github.com/flutter/flutter/issues/145599

Repro:
`flutter test test/cupertino/tab_scaffold_test.dart  --dart-define LEAK_TRACKING=true --plain-name "Adding new tabs does not crash the app"`

What is going on: 
1. ImageCache.putIfAbsent, in case the image already existed in the cache, invokes ImageCache._trackLiveImage, that creates _LiveImage and passes the image's completer as parameter `completer`
3. _LiveImage constructor invokes super constructor (of _CachedImageBase) that initializes the member `handle`
4. `handle` is disposed [using scheduler](c698e694c8/packages/flutter/lib/src/painting/image_cache.dart (L633)), and disposal does not happen in time of test completion.

Adding delay to the test increases number of not disposed objects from 30 to 120.
Should we force schedule at the end of the widget tests somehow to make scheduler switched to right state?

Creation call stack:

```
#9______new_ImageStreamCompleterHandle.__(package:flutter/src/painting/image_stream.dart:465:41)
#10_____ImageStreamCompleter.keepAlive_(package:flutter/src/painting/image_stream.dart:655:39)
#11_____new__CachedImageBase_(package:flutter/src/painting/image_cache.dart:609:27)
#12_____new__LiveImage_(package:flutter/src/painting/image_cache.dart:647:9)
#13_____ImageCache._trackLiveImage.<anonymous_closure>_(package:flutter/src/painting/image_cache.dart:302:14)
#14______LinkedHashMapMixin.putIfAbsent_(dart:collection-patch/compact_hash.dart:543:23)
#15_____ImageCache._trackLiveImage_(package:flutter/src/painting/image_cache.dart:296:17)
#16_____ImageCache.putIfAbsent_(package:flutter/src/painting/image_cache.dart:378:7)
#17_____ImageProvider.resolveStreamForKey_(package:flutter/src/painting/image_provider.dart:517:81)
                      #18_____ScrollAwareImageProvider.resolveStreamForKey_(package:flutter/src/widgets/scroll_aware_image_provider.dart:104:19)
#19_____ImageProvider.resolve.<anonymous_closure>_(package:flutter/src/painting/image_provider.dart:366:9)
#20_____ImageProvider._createErrorHandlerAndKey.<anonymous_closure>_(package:flutter/src/painting/image_provider.dart:479:24)
#21_____SynchronousFuture.then_(package:flutter/src/foundation/synchronous_future.dart:43:39)
                      #22_____ImageProvider._createErrorHandlerAndKey_(package:flutter/src/painting/image_provider.dart:476:9)
#23_____ImageProvider.resolve_(package:flutter/src/painting/image_provider.dart:363:5)
#24______ImageState._resolveImage_(package:flutter/src/widgets/image.dart:1111:16)
#25______ImageState.didChangeDependencies_(package:flutter/src/widgets/image.dart:1061:5)
#26_____StatefulElement._firstBuild_(package:flutter/src/widgets/framework.dart:5630:11)
#27_____ComponentElement.mount_(package:flutter/src/widgets/framework.dart:5457:5)
#28_____Element.inflateWidget_(package:flutter/src/widgets/framework.dart:4334:16)
#29_____Element.updateChild_(package:flutter/src/widgets/framework.dart:3843:18)
#30_____SingleChildRenderObjectElement.mount_(package:flutter/src/widgets/framework.dart:6763:14)
```
2024-05-21 21:33:20 +00:00
Gray Mackall
24979ab2c5
Fix warnings in dependency_version_checker.gradle.kts (#148699)
Newer Gradle/AGP versions include the following warnings:
```
w: file:///Users/goderbauer/dev/flutter/packages/flutter_tools/gradle/src/main/kotlin/dependency_version_checker.gradle.kts:107:40: Variable 'agpVersion' initializer is redundant
w: file:///Users/goderbauer/dev/flutter/packages/flutter_tools/gradle/src/main/kotlin/dependency_version_checker.gradle.kts:108:40: Variable 'kgpVersion' initializer is redundant
w: file:///Users/goderbauer/dev/flutter/packages/flutter_tools/gradle/src/main/kotlin/dependency_version_checker.gradle.kts:143:28: Parameter 'project' is never used
w: file:///Users/goderbauer/dev/flutter/packages/flutter_tools/gradle/src/main/kotlin/dependency_version_checker.gradle.kts:152:40: Variable 'agpVersion' initializer is redundant
w: file:///Users/goderbauer/dev/flutter/packages/flutter_tools/gradle/src/main/kotlin/dependency_version_checker.gradle.kts:167:55: 'Version' is deprecated. Deprecated in Java
w: file:///Users/goderbauer/dev/flutter/packages/flutter_tools/gradle/src/main/kotlin/dependency_version_checker.gradle.kts:195:56: Unnecessary non-null assertion (!!) on a non-null receiver of type Any
w: file:///Users/goderbauer/dev/flutter/packages/flutter_tools/gradle/src/main/kotlin/dependency_version_checker.gradle.kts:344:28: The corresponding parameter in the supertype 'Comparable' is named 'other'. This may cause problems when calling this function with named arguments.
```

These also get printed out to the CLI, so they are somewhat annoying.

Fixes all of the warnings, except for `'Version' is deprecated. Deprecated in Java`, which gets suppressed (we are intentionally using the deprecated `Version`, to help support older versions of AGP that use that deprecated class).
2024-05-21 20:56:50 +00:00
Polina Cherkasova
654a5b3773
Fix leaky test. (#148788) 2024-05-21 12:17:26 -07:00
Bruno Leroux
7727ff46cc
Add DropdownButton.menuWidth (#148125)
## Description

This PRs add a new parameter to `DropdownButton` which allows to set the menu width.
This can be useful when `DropdownButton.selectedItemBuilder` is provided and builds small items, see https://github.com/flutter/flutter/issues/133267.

I’m not fond of adding new property, especially for a widget which is supposed to be replaced on M3, but in this case it might makes sense because it is a way to not break existing code while addressing a legitimate issue.

## Related Issue

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

## Tests

Adds 1 test.
2024-05-21 19:15:21 +00:00
Gray Mackall
7a3baded76
Add a migrator to remove FlutterMultiDexApplication.java (#148515)
Fixes https://github.com/flutter/flutter/issues/148368.

See [my comment](https://github.com/flutter/flutter/issues/148368#issuecomment-2116133180) for the specific context.
2024-05-21 18:53:53 +00:00
Ian Hickson
450b072a21
Remove hidden dependencies on LocalProcessManager (#148096)
This is part 15 of a broken down version of the #140101 refactor.

This only makes one dependency explicit. Further PRs will do the same for other dependencies, until these APIs have no hidden dependencies.

This PR makes no effort to keep the order of parameters reasonable. There is an existing TODO to do a refactor sweep later that does nothing but reorder arguments/parameters/fields to be consistent.
2024-05-21 16:59:16 +00:00
Tirth
059189e756
Adds Missing onHover & onFocusChange for OutlinedButton.icon (#144374)
Adds Missing `onHover` & `onFocusChange` for `OutlinedButton.icon`.

I've copy-pasted the tests of OutlinedButton for OutlinedButton.icon.

Also, `onHover` & `onFocusChange` are already there in ElevatedButton.icon, FilledButton.icon & TextButton.icon, but tests files for these 3 doesn't test for icon variants.

Fixes #144256
2024-05-21 16:44:05 +00:00
Nate
870c5541c3
switch expressions: finale (#148711)
### fixes #136139

<br>

<details open> <summary><b>getting sentimental in the PR description</b> (click to collapse)<br><br></summary>

The past 7 months have been quite the journey—I made some huge blunders and some huge accomplishments—a very fun time overall.

I really appreciate the people who took the time to perform code review for my refactoring shenanigans: **christopherfujino**, **andrewkolos**, **LongCatIsLooong**, **gspencergoog**, **loic-sharma**, **Piinks**, **bernaferrari**, **bartekpacia**, **bleroux**, **kevmoo**, **rakudrama**, **XilaiZhang**, **QuncCccccc**, **MominRaza**, and **victorsanni**.

And a huge shoutout to 2 individuals:
- @justinmc, for offering to sponsor me for commit access (words could not describe my excitement)
- @goderbauer, for being super duper proactive and consistent with code review

<br>

</details>

This pull request makes 13 "switch statements → switch expressions" PRs in total, reducing the LOC in this repo by **1,974**!

From now on, I'll make sure to request a test exemption for each refactoring PR 🙂
2024-05-21 16:18:05 +00:00
Matej Knopp
454dd7e29c
[iOS] specify minimum os version for native asset frameworks (#148504)
Fixes https://github.com/flutter/flutter/issues/148501
2024-05-21 16:16:08 +00:00
davidhicks980
e6fa865581
Removed brand references from MenuAnchor.dart (#148760)
Rephrases identifier from _isApple to _isCupertino.

@gspencergoog and @victorsanni
2024-05-21 16:12:05 +00:00
Zachary Anderson
b6bed5aaf2
Skip flaky test in expression_evaluation_test.dart (#148737)
Skipping for https://github.com/flutter/flutter/issues/148704
2024-05-21 08:35:40 -07:00
Ian Hickson
d02292dbc4
Make FileSystem dependency explicit througout (more). (#148095)
This is part 14 of a broken down version of the #140101 refactor.

This is an extension of part 8 (#146008), which had omitted removing the filesystem dependency in the SkiaGoldClient class.

This only makes one dependency explicit. Further PRs will do the same for other dependencies, until these APIs have no hidden dependencies.

This particular change attempts to be minimal. I made no effort to keep the order of parameters reasonable here. I have a TODO to do a refactor sweep later that does nothing but reorder arguments/parameters/fields to be consistent.
2024-05-21 04:25:37 +00:00
Jenn Magder
165e535474
Remove add-to-app bitcode warning (#148587)
Flutter deprecated bitcode in 2022 https://github.com/flutter/flutter/pull/112828, and introduced a warning in #112900 to let add-to-app devs know.

Apps should be migrated by now, remove the outdated warning.
2024-05-20 23:52:15 +00:00
Renzo Olivares
5890a2fc73
SelectionArea's selection should not be cleared on loss of window focus (#148067)
This change fixes an issue where SelectionArea would clear its selection when the application window lost focus by first checking if the application is running. This is needed because `FocusManager` is aware of the application lifecycle as of https://github.com/flutter/flutter/pull/142930 , and triggers a focus lost if the application is not active.

Also fixes an issue where the `FocusManager` was not being reset on tests at the right time, causing it always to build with `TargetPlatform.android` as its context.
2024-05-20 23:45:08 +00:00
LouiseHsu
185f526ddf
Fixes incorrect read/write permissions on Flutter.framework and FlutterMacOS.framework (#148580)
Fixes https://github.com/flutter/flutter/issues/148354

Fixes https://github.com/flutter/flutter/issues/147142
Closes https://github.com/flutter/flutter/pull/147144

## 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.
2024-05-20 14:41:52 -07:00
Jason Simmons
a45cde5998
Remove the no-shuffle tag on the flutter_tools create_test suite (#148688)
The issue was fixed by https://github.com/flutter/flutter/pull/148616
2024-05-20 18:58:59 +00:00
Andrew Kolos
04cd1619a3
log incoming vm service messages in FlutterVMService::runInView (#148596)
In service of https://github.com/flutter/flutter/issues/146879. Please see https://github.com/flutter/flutter/issues/146879#issuecomment-2118629953.

In summary, when the test flakes, `onRunnable` is not completing despite the VmService object receiving an `IsolateRunnable` event. 

This PR adds some logging code to print all events received inside of `FlutterVmService::runInView`.
2024-05-20 18:55:24 +00:00
Dimil Kalathiya
e2de8d80f6
fixes CupertinoModalPopupRoute (#147823) 2024-05-20 10:43:18 -07:00
Nate
76a07a1646
Implement new AnimationStatus getters (#148570)
PR #147801 introduced some convenient `AnimationStatus` getters, but I just realized that `AnimationController` now has 2 getters for the same thing: `isAnimating` and `isRunning`.

The intent of this pull request is to correct that mistake, and implement the getters in the appropriate places.
2024-05-20 17:43:03 +00:00
Nate
73ecc8a9b2
Reland "if chains → switch expressions" (#148634)
I did a goof a while back:

![late initialization error](https://github.com/flutter/flutter/assets/10457200/47dc423f-0dd0-4869-9a11-59cb7d1ea46e)

Now that [the bug is fixed](e9d403541f), I think we're good to re-implement the if-chains cleanup!

Related:

- https://github.com/flutter/flutter/pull/147793
- https://github.com/flutter/flutter/pull/148556
- https://github.com/flutter/flutter/issues/148548
2024-05-20 17:43:00 +00:00
Greg Spencer
333c076e53
Factor out RawView, make View listen to engine generated view focus events (#143259)
## Description

This factors out a separate `RawView` that doesn't add a `MediaQuery` or a `FocusScope`. This PR also adds a new method `WidgetsBindingObserver.didChangeViewFocus` which allows the observer to know when the `FlutterView` that has focus has changed.

It also makes the `View` widget a stateful widget that contains a `FocusScope` and ` FocusTraversalGroup` so that it can respond to changes in the focus of the view.

I've also added a new function to `FocusScopeNode` that will allow the scope node itself to be focused, without looking for descendants that could take the focus. This lets the focus be "parked" at the `FocusManager.instance.rootScope` so that nothing else appears to have focus.

## Tests
 - Added tests for the new functionality.
2024-05-20 17:17:55 +00:00
Nate
adf279f308
Fix template manifest test (#148616)
`'flutter create should tool exit if the template manifest cannot be read'` fails consistently, as shown by #148614.

The test expects a `ToolExit` with the message "Unable to read the template manifest", but depending on how the test is being run, a different exception ("Cannot create a project within the Flutter SDK") is sometimes thrown first.

This pull request relocates the test project to `dev/` to prevent the extraneous error.
2024-05-18 23:42:22 +00:00
Jason Simmons
791a782a8f
Disable shuffling in the flutter_tools create_test suite (#148619)
This suite is failing when run with --test-randomize-ordering-seed=20240518

This is currently blocking the engine->framework roller
2024-05-18 23:02:23 +00:00
Victor Sanni
f7012db828
Move Feedback to widgets layer (#148523)
Currently, `Feedback` exists in the Material layer. However, not only is
`Feedback` not material-opinionated, but it is an abstract class that
defines its functionality depending on the user's platform.

It makes sense that `Feedback` should exist in the widgets layer
instead. This makes it easier to incorporate platform specific
`Feedback` updates as they arrive, fixing issues like #148391.

## 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].
- [ ] 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-05-18 10:41:56 -07:00
Andrew Kolos
ac6409b311
Swap crash reporting with unified analytics (#148525)
Fixes: https://github.com/flutter/flutter/issues/147260

(this is a remake of https://github.com/flutter/flutter/pull/147296; in hindsight I could have force-pushed there instead but 🤷)
2024-05-18 01:30:13 +00:00
Zachary Anderson
597462a3c4
Revert "if chains → switch expressions" (#148556)
Reverts flutter/flutter#147793

Introduced https://github.com/flutter/flutter/issues/148548.
2024-05-17 10:27:02 -07:00
Nate
fa9992eff6
switch statement cleanup (#148382)
This PR is step 12 in the journey to solve issue #136139 and make the
entire Flutter repo more readable.

Most of it involves implementing switch expressions, and there's also a
few other random things that I wanted to clean up a bit.
2024-05-16 17:16:06 -07:00
stuartmorgan
b98ffdc467
Add PrivacyInfo.xcprivacy to plugin template (#148485)
Adds an empty privacy manifest, and commented out code to include it in the build, to the plugin template. This will make it much easier to explain how to add a privacy manifest in plugin docs, since instead of explaining the format of the file from scratch and providing example code to inculde it, we can just instruct people to add entries to an exisitng file and then uncomment a line or two. This will also make it much easier to figure out from the template output itself how to add support for people who don't find the documentation.

Part of https://github.com/flutter/flutter/issues/131940

Fixes https://github.com/flutter/flutter/issues/140013
2024-05-16 19:58:11 +00:00
stuartmorgan
3a27301013
Fix iOS reference in macOS Cocoapods error (#148506)
Fixes a Cocoapods error message that was hard-coded to reference iOS to instead reference iOS or macOS as appropriate.

Fixes https://github.com/flutter/flutter/issues/146744
2024-05-16 19:58:08 +00:00
Nate
6b383615c6
Enhanced enum features for AnimationStatus (#147801)
Based on issue #147799, this pull request adds two `AnimationStatus` getters.

```dart
bool get isRunning => switch (this) {
  forward   || reverse   => true,
  completed || dismissed => false,
};

bool get aimedForward => switch (this) {
  forward || completed => true,
  reverse || dismissed => false,
};
```

I also added a `.toggle()` method for animation controllers that makes use of `aimedForward`.
2024-05-16 17:57:53 +00:00
Matej Knopp
c719f03ded
[macOS] codesign native assets during embed (#148310)
Fixes https://github.com/flutter/flutter/issues/148051

Currently only the "embed" phase, which is run during the Runner target
build have access to code-signing identity. The flutter assemble target,
which does the main build (and also builds native assets) does not have
access to the code-signing identity.

## 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-05-16 18:12:33 +02:00
Dimil Kalathiya
0d22d9101a
fixes DialogRoute memory leak (#147816) 2024-05-16 08:10:51 -07:00
Pierre-Louis
92a46ae71e
ThemeData minor spring cleaning (#148408)
Do a bit of sprucing up of `ThemeData` in anticipation of future work

Related: https://github.com/flutter/flutter/issues/91772
2024-05-16 07:32:19 +00:00
Daco Harkes
8a4179e8d0
plugin_ffi template comment fix (#148378)
3fe4c5c076 (diff-545d7efb62d2c3d98a0f7e585bdb1e5d377cd3cf83db012b487bf29be5c8ac92)
2024-05-16 06:19:13 +00:00
Bruno Leroux
b1677f6c0f
Reland fix TextField helper top padding on M3 (#146754)
This is a reland of https://github.com/flutter/flutter/pull/145087 which was reverted in https://github.com/flutter/flutter/pull/145168.

https://github.com/flutter/flutter/pull/146637 was merged and might help here.

## 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 |
|--------|--------|--------|
| ![image](https://github.com/flutter/flutter/assets/840911/9947f334-d98f-4f7e-9da7-ca6d5c0770ac) | ![image](https://github.com/flutter/flutter/assets/840911/081dec4b-eb9f-4eee-a7dc-2538e7110ff0)| ![image](https://github.com/flutter/flutter/assets/840911/c8c8f045-3b79-43a5-a1a3-cc6d5460644f) |

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-05-16 05:40:30 +00:00
FMorschel
cae2079ad2
Removing duplicate assert on VisualDensity constructor (#148281)
This PR only removes a duplicate assertion for `vertical <= maximumDensity` on `VisualDensity` constructor.

This is my first PR, do I need to do any of the non-checked items above, or anything else for this to be accepted?
2024-05-16 05:29:06 +00:00
Polina Cherkasova
86eecd3b04
Fix leaky tests. (#148434) 2024-05-15 16:52:17 -07:00
hangyu
6826fc08fa
Update _handlePushRouteInformation to Future<bool> to indicate whether any of the observer has handled the route or not (#147901)
follow up on comments on https://github.com/flutter/engine/pull/52350
2024-05-15 20:57:18 +00:00
Valentin Vignal
8b129b9b89
Fix memory leaks in _PopupMenuRoute (#148373) 2024-05-15 13:50:03 -07:00