Commit Graph

21376 Commits

Author SHA1 Message Date
lsaudon
c3cd01661c Tap on button behind snack bar defined by margin (#127959)
If the margin is used, set the `HitTestBehavior` to `deferToChild`. 

*List which issues are fixed by this PR. You must list at least one issue.*
#78537 
#114810 

*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-07-14 06:58:00 +00:00
Ian Hickson
46125d07db Mention saveLayer in the CustomPainter docs. (#130520)
Fixes https://github.com/flutter/flutter/issues/11002
2023-07-14 01:43:47 +00:00
Tae Hyung Kim
bd18e78c9c Fix timeOfDayFormat for Danish (#130437)
See title. According to
[CLDR](https://icu4c-demos.unicode.org/icu-bin/locexp?_=da_DK&d_=en&_l=da),
proper time of day format should be `HH.mm`.

Fixes https://github.com/flutter/flutter/issues/130234.
2023-07-13 16:46:49 -07:00
Polina Cherkasova
26a17a4cba Upgrade leak_tracker. (#130528) 2023-07-13 16:24:21 -07:00
Matan Lurey
03749051e8 Always escape when writing pubspec.yaml's 'description' field. (#130096)
Closes https://github.com/flutter/flutter/issues/80013.

**Before**:

```
$ flutter create test1 --description "a: b"
Creating project test1...
Error detected in pubspec.yaml:
Error on line 2, column 15: Mapping values are not allowed here. Did you miss a colon earlier?
  ╷
2 │ description: a: b
  │               ^
  ╵
Please correct the pubspec.yaml file at /Users/matan/Developer/scratch/test1/pubspec.yaml
```

**After**:

```
$ flutter create test1 --description "a: b"
Creating project test1...
Resolving dependencies in test1... 
Got dependencies in test1.
Wrote 129 files.

All done!
You can find general documentation for Flutter at: https://docs.flutter.dev/
Detailed API documentation is available at: https://api.flutter.dev/
If you prefer video documentation, consider: https://www.youtube.com/c/flutterdev

In order to run your application, type:

  $ cd test1
  $ flutter run

Your application code is in test1/lib/main.dart.
```

---

It's worth noting that this _always_ escapes a non-empty project description, which means that descriptions that were not previously wrapped in `"`s' will be. I'm not sure how worth it is to do a _conditional_ escape (i.e. only escape if not escaping would cause a problem), but willing to change.

Side-note: I had no idea where to list this test in the (very large) `create_test.dart`, so I did my best :)
2023-07-13 22:53:51 +00:00
Qun Cheng
7fc49906b1 Update CardTheme, DrawerTheme, NavigationBar, and NavigationRailTheme tests for M2/M3 (#130047)
Updated unit tests for `CardTheme`, `DrawerTheme`, `NavigationBar`, and `NavigationRailTheme` to have M2 and M3 versions.

More info in https://github.com/flutter/flutter/issues/127064
2023-07-13 22:41:57 +00:00
Piotr FLEURY
99efd1b585 Fix .env regex constants (#130072)
Set `.env` regex list as constants.

This pull request fixes the nit related in this comment: https://github.com/flutter/flutter/pull/128668#discussion_r1253377454
2023-07-13 22:00:55 +00:00
Polina Cherkasova
3c2cd015cc Inspector should not hold callback from garbage collection. (#130436) 2023-07-13 14:54:28 -07:00
Mouad Debbar
87d5214da6 [web] Migrate web-only initialization APIs (#129856)
- `ui_web.warmupEngine`
- `ui_web.setPluginHandler`
- `ui_web.debugEmulateFlutterTesterEnvironment`
2023-07-13 20:12:10 +00:00
Hans Muller
157660afc1 Change the default forThemeData.useMaterial3 to true (#129724)
Changes the default for `ThemeData.useMaterial3` to true.

See https://github.com/flutter/flutter/issues/127064
2023-07-13 13:06:03 -07:00
Victoria Ashworth
2892b57558 Reland "Print pretty error when xcodebuild fails due to missing simulator #130286" (#130506)
Reland https://github.com/flutter/flutter/pull/130286 with fix.

It failed the first time because of a discrepancy between the master branch and my branch (see https://github.com/flutter/flutter/pull/130504#issue-1803449182 for more info).
2023-07-13 19:36:10 +00:00
chunhtai
315ebafea3 PlatformRouteInformationProvider does not push new entry if query par… (#130457)
…ameter is semanticsally the same

The URI compare does not taking into account that query parameter may or may not be encoded, or the parameters' order can be different. However, they are all semantically the same. 

This pr makes PlatformRouteInformationProvider to take those into account when deciding whether it should push/replace the browser history entry.
2023-07-13 18:41:56 +00:00
Polina Cherkasova
5870159ed7 Upgrade leak_tracker. (#130507) 2023-07-13 18:40:50 +00:00
Polina Cherkasova
8e80663640 Mark leak in text_form_field_test.dart. (#130468) 2023-07-13 10:50:24 -07:00
chunhtai
2e8af2c35e Unifies text field focus management in desktops (#129652)
related https://github.com/flutter/flutter/issues/128709

engine PR: https://github.com/flutter/engine/pull/43279

The web engine requires a way to unfocus textfield, It comes to nature
to me that we should leverage didGain/didLose a11y focus action. I also
unifies the action handler of all desktop platforms

## Pre-launch Checklist

- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] 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-07-13 10:41:16 -07:00
Victoria Ashworth
ab86c79c3a Revert "Print pretty error when xcodebuild fails due to missing simulator" (#130504)
Reverts flutter/flutter#130286
2023-07-13 17:19:56 +00:00
Victoria Ashworth
604010e9e2 Print pretty error when xcodebuild fails due to missing simulator (#130286)
Starting in Xcode 15, the simulator is no longer included in Xcode and must be downloaded and installed separately.

If you try to run flutter and the simulator is missing, you'll get an error like
```
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
               		{ id:B1234A5C-67B8-901D-B2CB-FE34F56BDE78 }

               	Ineligible destinations for the "Runner" scheme:
               		{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device, error:iOS 17.0 is not installed. To use with Xcode, first download and install the platform }
```

Print a pretty error to make it easier for developers to know what to do.

Part 2 of https://github.com/flutter/flutter/issues/129558.
2023-07-13 16:51:13 +00:00
Jonah Williams
60c1f37609 [flutter_tools] remove desktop device restrictions on Impeller. (#130430)
All current desktop backends will support Impeller after https://github.com/flutter/engine/pull/43388 lands.
2023-07-13 16:26:02 +00:00
LongCatIsLooong
2da353a59a Exclude Tooltip's overlay child from SelectableRegion (#130181)
Fixes https://github.com/flutter/flutter/issues/129969 by making tooltip text unselectable (for now). 
Also fixes some other issues uncovered when I was writing the tests.

Currently `getTransformTo` only works on ancestors. I'll try to add a new method that computes the transform from 2 arbitrary render objects in the same render tree in a follow-up PR and make `Selectable` use that method instead.
2023-07-13 00:35:57 +00:00
Qun Cheng
dd0b6e35f3 Update Checkbox tests for M2/M3 (#130351)
Updated unit tests for `Checkbox` to have M2 and M3 versions.

More info in #127064
2023-07-12 22:27:37 +00:00
Srujan Gaddam
ab39bff282 Refactor JSNumber.toDart and Object.toJS (#129436)
JSNumber.toDart will now be two functions: toDartDouble and toDartInt.

There was code that did an Object.toJS. This has been changed to
use Function.toJS as well to make it consistent with the code
in flutter/packages:
0ef393811d/packages/web_benchmarks/lib/src/recorder.dart (L1223)

This is to help land this CL:
https://dart-review.googlesource.com/c/sdk/+/309082

https://dart-review.googlesource.com/c/sdk/+/309081 is the CL that added
the new methods.

## 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] All existing and new tests are passing.
2023-07-12 13:54:15 -07:00
Gil Nobrega
a189d95ac2 Reland [a11y] CupertinoSwitch On/Off labels (#130173)
This original PR (https://github.com/flutter/flutter/pull/127776) was reverted (https://github.com/flutter/flutter/pull/130166) due to a Google test failure.

This reopens the PR as per the discussion in https://github.com/flutter/flutter/pull/130166#issuecomment-1626105218.

Fixes issue #4830.
2023-07-12 20:50:18 +00:00
Greg Spencer
3d67ca4311 Add missing links to examples that aren't linked anywhere (#130422)
## Description

This adds links to examples that were not linked anywhere.

## Related Issues
 - Fixes #129956

## Tests
 - Documentation only change
2023-07-12 20:08:05 +00:00
Tae Hyung Kim
d75735eea6 Use platform specific line separator in gen-l10n (#130090)
Currently files are not generated with `\r\n` in windows. This PR should
fix the issue.

Fixes https://github.com/flutter/flutter/issues/109761.
2023-07-12 12:50:53 -07:00
Taha Tesser
42924e275b Update Divider/VerticalDivider and theme tests for M2/M3 (#130415)
Updated unit tests for `Divider`/ `VerticalDivider`  and theme to have M2 and M3 versions.

More info in https://github.com/flutter/flutter/pull/128725
2023-07-12 17:25:20 +00:00
Taha Tesser
21e3bb8967 Update RadioListTile tests format for M2/M3 (#130391)
Update tests format 

context: https://github.com/flutter/flutter/pull/129718#issuecomment-1615124857
2023-07-12 15:47:51 +00:00
Polina Cherkasova
4e8014bf76 Enable not GCed leak tracking. (#130159) 2023-07-11 17:41:14 -07:00
Chris Bobbe
233a1bb316 autocomplete: Remove mistaken paragraph in onSelected doc (#130190)
Fixes #130187.

Fixes #130187 by removing the mistaken paragraph; see there for details.
2023-07-11 22:37:31 +00:00
Tsukuru Tanimichi
cc180e214e Links in material library docs are outdated (#129891)
https://api.flutter.dev/flutter/material/material-library.html

Links in `material` library docs are outdated
2023-07-11 19:57:35 +00:00
Polina Cherkasova
e608a697c6 Upgrade leak_tracker to 7.0.6. (#130346) 2023-07-11 11:19:19 -07:00
Qun Cheng
12acff81c7 DropdownMenu can be expanded to its parent size (#129753)
Fixes #125199

This PR is to add a new property `expandedInsets` so that the `DropdownMenu` can be expandable and has some margins around.

<details><summary>Example: Setting `expandedInsets` to `EdgeInsets.zero`</summary>

```dart
import 'package:flutter/material.dart';

void main() => runApp(const DropdownMenuExample());

class DropdownMenuExample extends StatefulWidget {
  const DropdownMenuExample({super.key});

  @override
  State<DropdownMenuExample> createState() => _DropdownMenuExampleState();
}

class _DropdownMenuExampleState extends State<DropdownMenuExample> {
  final TextEditingController colorController = TextEditingController();
  ColorLabel? selectedColor;

  @override
  Widget build(BuildContext context) {
    final List<DropdownMenuEntry<ColorLabel>> colorEntries = <DropdownMenuEntry<ColorLabel>>[];
    for (final ColorLabel color in ColorLabel.values) {
      colorEntries.add(
        DropdownMenuEntry<ColorLabel>(value: color, label: color.label, enabled: color.label != 'Grey'),
      );
    }

    return MaterialApp(
      theme: ThemeData(
        useMaterial3: true,
        colorSchemeSeed: Colors.green,
      ),
      home: Scaffold(
        body: Center(
          child: Container(
            width: 500,
            height: 500,
            color: Colors.orange,
            child: DropdownMenu<ColorLabel>(
              expandedInsets: EdgeInsets.zero,
              inputDecorationTheme: const InputDecorationTheme(
                filled: true,
                fillColor: Colors.white,
                border: OutlineInputBorder(),
              ),
              controller: colorController,
              dropdownMenuEntries: colorEntries,
              onSelected: (ColorLabel? color) {
                setState(() {
                  selectedColor = color;
                });
              },
              // expandedInsets: EdgeInsets.only(left: 35.0, right: 20.0, top: 80),
            ),
          ),
        ),
      ),
    );
  }
}

enum ColorLabel {
  blue('Blue', Colors.blue),
  pink('Pink', Colors.pink),
  green('Green', Colors.green),
  yellow('Yellow', Colors.yellow),
  grey('Grey', Colors.grey);

  const ColorLabel(this.label, this.color);
  final String label;
  final Color color;
}
```

<img width="500" alt="Screenshot 2023-06-28 at 11 33 20 PM" src="https://github.com/flutter/flutter/assets/36861262/e703f8a2-6e7c-45a0-86cf-d96da6dc157a">

</details>
2023-07-11 17:08:07 +00:00
Darshan Rander
af2e28230f fix: ExpansionTileTheme.shape assignment in ExpansionTile (#127749)
The ExpansionTile was not following `shape` from ExpansionTileTheme as it was assigning wrong parameter to the tween.

fixes #129785
2023-07-11 08:47:11 +00:00
Ian Hickson
d71bbfb490 Implement preferPaintInterior correctly for _CompoundBorder (#129851) 2023-07-11 06:44:33 +00:00
Tae Hyung Kim
dabd7b3bb5 Throw error on unexpected positional arguments (#130274)
This PR fixes ignoring when random positional arguments added to the
`flutter gen-l10n`.

So we are no longer able to call `flutter gen-l10n hello world` or
`flutter gen-l10n --format false`.

Fixes https://github.com/flutter/flutter/issues/118203
2023-07-10 12:12:23 -07:00
Victoria Ashworth
6c2023162f Change resultBundlePath representation from File to Directory (#130156)
`resultBundlePath` is meant to be a directory. In the `xcodebuild --help`, it describes it as a directory: 
```
-resultBundlePath PATH     specifies the directory where a result bundle describing what occurred will be placed
```

This PR changes our usage of it from a file to a directory so that it gets deleted correctly between reruns.

Fixes https://github.com/flutter/flutter/issues/129954.
2023-07-10 17:47:51 +00:00
Rydmike
b828846fb9 Fix default icon color constants reversed brightness documentation (#130231)
Fixes the reversed default icon color constants brightness documentation for `kDefaultIconLightColor` and `kDefaultIconDarkColor`.

FIX: https://github.com/flutter/flutter/issues/130230
2023-07-10 15:43:00 +00:00
Chuan-Yen Chiang
0cb6a03d92 fix: duplicated Intellij IDE message when running flutter doctor (#129030)
This PR fixes the duplicated message from `flutter doctor` when install `Intellij IDE` from `JetBrains Toolbox`. 

The solution is based on the #98276. Add a function to skip the creation of the validator for `Mac` when the key word `JetBrainsToolboxApp` is in the `info.plist`.

Before: 
<img width="918" alt="Screenshot 2023-06-16 at 21 04 43" src="https://github.com/flutter/flutter/assets/3291319/2f5ef0c6-0d29-4d02-97ed-257f29965a1a">

After: 
<img width="924" alt="Screenshot 2023-06-16 at 21 13 15" src="https://github.com/flutter/flutter/assets/3291319/dcdca845-41a1-4896-a5ac-5bca724af676">

fix #98276
2023-07-08 00:35:53 +00:00
hangyu
b80bbd5500 Add a threshold when comparing screen order for selectables. (#130043)
Add a threshold when comparing screen order for selectables. So when the vertical position diff is within the threshold, will compare the horizontal position.

This fixes https://github.com/flutter/flutter/issues/111021 and https://github.com/flutter/flutter/issues/127942
2023-07-07 22:19:09 +00:00
Alexander Aprelev
3b8f6c4020 Upgrade framework pub dependencies, roll engine with rolled dart sdk (#130163)
Manual roll is needed because incoming dart sdk requires updated version
vm_snapshot_analysis (>=0.7.4).


5ae09b8b4f...7c83ea3e85

```
7c83ea3e85 Reland "Manual roll Dart SDK from 2d98d9e27dae to 0b07debd5862 (21 revisions) (#43457)" (#43472)
9ef3e8d533 Roll Skia from 5eba922297bb to 93c92f97f5ab (2 revisions) (#43471)
```

Remove implementation of SuitePlatform from the test as well. Remove use
of fake cwd from SuitePlatform as it can't be properly faked.
2023-07-07 13:55:35 -07:00
Jesús S Guerrero
acb0855432 Revert "[a11y] CupertinoSwitch On/Off labels" (#130166)
Reverts flutter/flutter#127776
Currently breaking google testing
2023-07-07 20:04:00 +00:00
Polina Cherkasova
ce50828669 Test that inspector does not hold objects. (#130102) 2023-07-07 12:33:08 -07:00
Caique Ribeiro de Oliveira
3f2d798bd6 Fix XCode download link (#129795)
<img width="919" alt="image" src="https://github.com/flutter/flutter/assets/42003129/4bc8c3b8-29af-4b98-9232-47a583523e3c">
I was installing Flutter and noticed that the download link for Xcode is incorrect. They might have changed it, but the current link doesn't exist.
2023-07-07 18:09:57 +00:00
Chris Bobbe
8ab46bbce4 (Raw)Autocomplete: Add optional [optionsViewOpenDirection] param (#129802)
Allows positioning Autocomplete options above the field (previously hardcoded to under the field).
2023-07-07 10:25:35 -07:00
fzyzcjy
61ebf755d7 Tiny one space formatting fix (#130053)
You know, I like to see beautiful code, so really hope we have auto formatter, such that all these (at least such formatting error) can be done automatically!
2023-07-07 17:11:49 +00:00
Victoria Ashworth
6683468f0b Add debugging for iOS startup test flakes (#130099)
Adding debugging for https://github.com/flutter/flutter/issues/129836.

Takes a screenshot when startup test takes too long (10 minutes).

Also, removes some old debugging and add new debugging message.
2023-07-07 16:49:00 +00:00
Hans Muller
d55a7d89e0 Revert "fix a bug when android uses CupertinoPageTransitionsBuilder..." (#130144)
Reverts flutter/flutter#114303

The breaking API change in flutter/flutter#114303 broke internal tests/apps (Google internal link b/290154304) as well as external dependents: https://github.com/flutter/flutter/issues/130062. 

Fixes https://github.com/flutter/flutter/issues/130062
2023-07-07 16:39:08 +00:00
fzyzcjy
bf72b63536 Super tiny code optimization: No need to redundantly check whether value has changed (#130050)
Removed two unnecessary `if` conditions.
2023-07-06 16:30:01 -07:00
Polina Cherkasova
bff6b93683 Next attempt to make inspector weakly referencing the inspected objects. (#129962) 2023-07-06 12:19:18 -07:00
Gil Nobrega
4f6c887751 [a11y] CupertinoSwitch On/Off labels (#127776)
Adds optional visual labels to Cupertino's on/off switch for accessibility.
2023-07-06 11:18:13 -07:00
Henrique Nascimento
eebb1d6ddf Add option for flexible space on material SearchDelegate (#128132)
This pull request introduces the `buildFlexibleSpace` method to the `SearchDelegate` class in the material library. 
It allows users to add a flexible space widget to the `AppBar` in a `_SearchPage`, providing more customization options.

This PR does not fix any specific issue as there are no open issues related to this feature.
2023-07-06 17:52:58 +00:00