21414 Commits

Author SHA1 Message Date
Tae Hyung Kim
c6b93b2db7
Relax syntax for gen-l10n (#130736)
To preserve backward compatibility with the old parser which would
ignore syntax errors, this PR introduces a way to treat the special
characters `{` and `}` in the following way:
1. If we encounter a `{` which searching for a string token and this `{`
is not followed by a valid placeholder, then we treat the `{` as a
string and continue lexing for strings.
2. If we encounter a `}` while not within some expression (i.e.
placeholders, arguments, plurals, or selects), then we treat the `}` as
a string and continue lexing for strings.

This makes it so that
```
"helloWorld": "{ } { placeholder }",
"@@helloWorld": {
  "placeholders": {
    "placeholder" {}
  }
}
```
treats the `{ }` as a string while `{ placeholder } ` is treated as a
placeholder.

Fixes https://github.com/flutter/flutter/issues/122404.
2023-07-18 13:59:48 -07:00
Camille Simon
b42879a94e
[Android] Deletes deprecated splash screen meta-data element (#130744)
Deletes deprecated splash screen meta-data element.

This is no longer needed to present a splash screen in a Flutter application, but will be removed soon. See [go/flutter-splash-screen-migration](http://go/flutter-splash-screen-migration) for more information.

Part of https://github.com/flutter/flutter/issues/105173.
2023-07-18 18:38:12 +00:00
Hans Muller
433f93560a
Updated ThemeData.useMaterial3 API doc, default is true (#130764)
Fixes https://github.com/flutter/flutter/issues/130761
2023-07-18 11:22:02 -07:00
Taha Tesser
b460d49199
Update AppBar and AppBarTheme tests for M2/M3 (#130790)
Updated unit tests for `AppBar` and `AppBarTheme` to have M2 and M3 versions.

More info in https://github.com/flutter/flutter/issues/127064
2023-07-18 16:24:11 +00:00
Bruno Leroux
86385dce68
Update app tests for M3 (#130792)
This PR updates unit tests from `app_test.dart` for M3 migration.

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

The diff is somewhat misleading because third test in the original code is now the fourth in the updated one, but because they were very similar git diff does not reflect this swap.

And also, first test is M2 only and last one M3 only.
2023-07-18 16:13:48 +00:00
Greg Spencer
8b768de18f
Add lint check to make sure samples are linked and have tests (#130523)
## Description

This adds a checker that will check all of the API docs examples to make sure that they are linked from at least one source file in the packages.

It also checks to make sure that all of the examples have an associated test. Since there are a large number that don't have tests at the moment, there is also a large exception list that can be burned down (burn down list is in https://github.com/flutter/flutter/issues/130459).

Because there are missing links currently, this PR will only pass after https://github.com/flutter/flutter/pull/130521 is merged.

## Related Issues

- https://github.com/flutter/flutter/issues/129956
- https://github.com/flutter/flutter/issues/130459

## Tests

- Added test for the checker.
2023-07-18 15:26:09 +00:00
yaakovschectman
203ef6f7a3
Extract common functionality of iOS platformviews into superclasses (#128716)
Move most functionality of `UiKitView` and its supporting classes into
superclasses named `DarwinPlatformView`, etc., and create trivial or
near-trivial subclasses with the same names as the old classes.

I am currently awaiting approval for a macOS workstation that would
allow me to run the iOS/macOS tests and make sure all existing
functionality is preserved by this refactor. I can ensure that tests
will pass, but doing so may need to wait for a while.

Addresses [Add
AppKitView](https://github.com/flutter/flutter/issues/128519)

## 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].
- [ ] 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.

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

---------

Co-authored-by: Loïc Sharma <737941+loic-sharma@users.noreply.github.com>
Co-authored-by: Michael Goderbauer <goderbauer@google.com>
Co-authored-by: Chris Bracken <chris@bracken.jp>
2023-07-18 10:06:52 -04:00
Taha Tesser
fa6754d362
Fix iconTheme in AppBar doesn't apply custom Colors.white in the dark mode for M3 (#130574)
fixes [[Material3] AppBar does not respect `foregroundColor` or `iconTheme` for leading and actions in some cases](https://github.com/flutter/flutter/issues/130485)

### Description

- Fix `Colors.white` not applied in dark mode
- Add regression tests
- make `iconStyle` private for consistency

### Before
![Screenshot 2023-07-14 at 18 40 58](https://github.com/flutter/flutter/assets/48603081/a6caffd6-d9a1-407a-aea7-c30047bfe7c7)

### After
![Screenshot 2023-07-14 at 18 41 04](https://github.com/flutter/flutter/assets/48603081/f864da7a-2ff8-46a4-8927-591e50050502)
2023-07-18 08:26:09 +00:00
Ian Hickson
e12d31ad75
Document stack's clipping behaviour better (#130749)
Fixes https://github.com/flutter/flutter/issues/40216
2023-07-18 03:36:18 +00:00
LongCatIsLooong
fe7d01ffab
Prevent InputDecorator from supplying its descendants with non-normalized constraints (#130460)
Fixes https://github.com/flutter/flutter/issues/129611
2023-07-17 23:35:20 +00:00
hellohuanlin
1b07c3d798
[tools/ios_build_ipa] fallback to CFBundleName if CFBundleDisplayName is absent (#130752)
The display name will fallback to CFBundleName if CFBundleDisplayName is absent. 

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

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

*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-17 22:21:07 +00:00
Polina Cherkasova
e337343ab7
Mark some leaks. (#130470) 2023-07-17 12:48:58 -07:00
Greg Price
1937ae6539
Make AbstractNode-derived docs more specific on RenderObject et al. (#130689)
These methods and/or their docs were recently copied (in #128467 and #128973) from their classes' former shared base class AbstractNode. Their wording was fittingly abstract there, but that abstraction is a bit puzzling for a reader finding them on these more concrete classes and not aware of the AbstractNode history.  So make them more concrete, in similar terms to the other methods around them.

Also copy some useful points between corresponding methods on different classes (like that the parent of the root is null), and try to clean up the prose on [RenderObject.depth].

We focus on the more outward-facing parts of the API, letting methods like `redepthChildren` continue to talk generically about "nodes".
2023-07-17 18:20:27 +00:00
LongCatIsLooong
b2e22d3558
Replaces textScaleFactor with TextScaler (#128522)
Deprecate `textScaleFactor` in favor of `textScaler`, in preparation for Android 14 [Non-linear font scaling to 200%](https://developer.android.com/about/versions/14/features#non-linear-font-scaling). The `TextScaler` class can be moved to `dart:ui` in the future, if we decide to use the Android platform API or AndroidX to get the scaling curve instead of hard coding the curve in the framework.

I haven't put the Flutter version in the deprecation message so the analyzer checks are failing. Will do so after I finish the migration guide.

**Why `TextScaler.textScaleFactor`**
The author of a `TextScaler` subclass should provide a fallback `textScaleFactor`. By making `TextScaler` also contain the `textScaleFactor` information it also makes it easier to migrate: if a widget overrides `MediaQueryData.textScaler` in the tree, for unmigrated widgets in the subtree it would also have to override `MediaQueryData.textScaleFactor`, and that makes it difficult to remove `MediaQueryData.textScaleFactor` in the future.

## A full list of affected APIs in this PR

Deprecated: The method/getter/setter/argument is annotated with a `@Deprecated()` annotation in this PR, and the caller should replace it with `textScaler` instead. Unless otherwise specified there will be a Flutter fix available to help with migration but it's still recommended to migrate case-by-case.
**Replaced**:  The method this `textScaleFactor` argument belongs to is rarely called directly by user code and is not overridden by any of the registered custom tests, so the argument is directly replaced by `TextScaler`.
**To Be Deprecated**:  The method/getter/setter/argument can't be deprecated in this PR because a registered customer test depends on it and a Flutter fix isn't available (or the test was run without applying flutter fixes first). This method/getter/setter/argument will be deprecated in a followup PR once the registered test is migrated.

### `Painting` Library

| Affected API | State of `textScaleFactor` | Comment | 
| --- | --- | --- |
| `InlineSpan.build({ double textScaleFactor = 1.0 })` argument | **Replaced** | | 
| `TextStyle.getParagraphStyle({ double TextScaleFactor = 1.0 })` argument | **Replaced** | |
| `TextStyle.getTextStyle({ double TextScaleFactor = 1.0 })`  argument| Deprecated | Can't replace: c47fd38dca/super_editor/lib/src/infrastructure/super_textfield/desktop/desktop_textfield.dart (L1903-L1905)|
| `TextPainter({ double TextScaleFactor = 1.0 })` constructor argument | Deprecated | |
| `TextPainter.textScaleFactor` getter and setter | Deprecated | No Flutter Fix, not expressible yet |
| `TextPainter.computeWidth({ double TextScaleFactor = 1.0 })` argument | Deprecated | |
| `TextPainter.computeMaxIntrinsicWidth({ double TextScaleFactor = 1.0 })` argument | Deprecated | |

### `Rendering` Library

| Affected API | State of `textScaleFactor` | Comment | 
| --- | --- | --- |
| `RenderEditable({ double TextScaleFactor = 1.0 })` constructor argument | Deprecated | |
| `RenderEditable.textScaleFactor` getter and setter | Deprecated | No Flutter Fix, not expressible yet |
| `RenderParagraph({ double TextScaleFactor = 1.0 })` constructor argument | Deprecated | |
| `RenderParagraph.textScaleFactor` getter and setter | Deprecated | No Flutter Fix, not expressible yet |

### `Widgets` Library

| Affected API | State of `textScaleFactor` | Comment | 
| --- | --- | --- |
| `MediaQueryData({ double TextScaleFactor = 1.0 })` constructor argument | **To Be Deprecated** | cd7b93532e/packages/flutter_markdown/test/text_scale_factor_test.dart (LL39C21-L39C35) |
| `MediaQueryData.textScaleFactor` getter | Deprecated | |
| `MediaQueryData.copyWith({ double? TextScaleFactor })` argument | Deprecated | |
| `MediaQuery.maybeTextScaleFactorOf(BuildContext context)` static method | Deprecated | No Flutter Fix, not expressible yet  |
| `MediaQuery.textScaleFactorOf(BuildContext context)` static method | **To Be Deprecated** | cd7b93532e/packages/flutter_markdown/lib/src/_functions_io.dart (L68-L70), No Flutter Fix, not expressible yet |
| `RichText({ double TextScaleFactor = 1.0 })` constructor argument | **To Be Deprecated** | cd7b93532e/packages/flutter_markdown/lib/src/builder.dart (L829-L843) |
| `RichText.textScaleFactor` getter | **To Be Deprecated** | A constructor argument can't be deprecated right away|
| `Text({ double? TextScaleFactor = 1.0 })` constructor argument | **To Be Deprecated** | 914d120da1/packages/rfw/lib/src/flutter/core_widgets.dart (L647) , No Flutter Fix because of https://github.com/dart-lang/sdk/issues/52664 |
| `Text.rich({ double? TextScaleFactor = 1.0 })` constructor argument | **To Be Deprecated** | The default constructor has an argument that can't be deprecated right away. No Flutter Fix because of https://github.com/dart-lang/sdk/issues/52664 |
| `Text.textScaleFactor` getter | **To Be Deprecated** | A constructor argument can't be deprecated right away |
| `EditableText({ double? TextScaleFactor = 1.0 })` constructor argument | Deprecated | No Flutter Fix because of https://github.com/dart-lang/sdk/issues/52664 |
| `EditableText.textScaleFactor` getter | Deprecated | |

### `Material` Library

| Affected API | State of `textScaleFactor` | Comment | 
| --- | --- | --- |
| `SelectableText({ double? TextScaleFactor = 1.0 })` constructor argument | **To Be Deprecated** | cd7b93532e/packages/flutter_markdown/lib/src/builder.dart (L829-L843), No Flutter Fix because of https://github.com/dart-lang/sdk/issues/52664 |
| `SelectableText.rich({ double? TextScaleFactor = 1.0 })` constructor argument | **To Be Deprecated** | The default constructor has an argument that can't be deprecated right away. No Flutter Fix because of https://github.com/dart-lang/sdk/issues/52664 |
| `SelectableText.textScaleFactor` getter | **To Be Deprecated** | A constructor argument can't be deprecated right away |

A lot of material widgets (`Slider`, `RangeSlider`, `TimePicker`, and different types of buttons) also change their layout based on `textScaleFactor`. These need to be handled in a case-by-case fashion and will be migrated in follow-up PRs.
2023-07-17 17:56:07 +00:00
LongCatIsLooong
0d1cc33b65
_RenderScaledInlineWidget constrains child size (#130648)
Fixes https://github.com/flutter/flutter/issues/130588
2023-07-17 17:46:03 +00:00
LongCatIsLooong
bf4d659726
Allow OverlayPortal to be added/removed from the tree in a layout callback (#130670)
Fixes https://github.com/flutter/flutter/issues/130668
2023-07-17 17:46:00 +00:00
Lau Ching Jun
d64cc47920
Make ProxiedDevices a subclass of PollingDeviceDiscovery. (#130640)
The daemon ignores all device discovery that is not a PollingDeviceDiscovery. Make ProxiedDevices a PollingDeviceDiscovery so that it can be used in flutter daemon.

Note that there is a TODO item added in the test, which I intend to attempt fixing in a subsequent PR.
2023-07-17 17:40:12 +00:00
Michael Goderbauer
e06650bdbe
Guard access to dart:developer with !kReleaseMode (#130627) 2023-07-17 17:40:07 +00:00
Jason Simmons
7937b1d51f
Skip the iteration in Layer._fireCompositionCallbacks if the callbacks map is empty (#130438)
This was showing up as a hot spot in some benchmarks and profiles. This
function is called frequently during frame builds and often has an empty
map. There may be significant overhead from obtaining the values
iterator and cloning it into a list.

See https://github.com/flutter/flutter/issues/130339
2023-07-17 10:34:35 -07:00
Michael Goderbauer
6f09064e78
Stand-alone widget tree with multiple render trees to enable multi-view rendering (#125003)
This change enables Flutter to generate multiple Scenes to be rendered into separate FlutterViews from a single widget tree. Each Scene is described by a separate render tree, which are all associated with the single widget tree.

This PR implements the framework-side mechanisms to describe the content to be rendered into multiple views. Separate engine-side changes are necessary to provide these views to the framework and to draw the framework-generated Scene into them.

## Summary of changes

The details of this change are described in [flutter.dev/go/multiple-views](https://flutter.dev/go/multiple-views). Below is a high-level summary organized by layers.

### Rendering layer changes

* The `RendererBinding` no longer owns a single `renderView`. In fact, it doesn't OWN any `RenderView`s at all anymore. Instead, it offers an API (`addRenderView`/`removeRenderView`) to add and remove `RenderView`s that then will be MANAGED by the binding. The `RenderView` itself is now owned by a higher-level abstraction (e.g. the `RawView` Element of the widgets layer, see below), who is also in charge of adding it to the binding. When added, the binding will interact with the `RenderView` to produce a frame (e.g. by calling `compositeFrame` on it) and to perform hit tests for incoming pointer events. Multiple `RenderView`s can be added to the binding (typically one per `FlutterView`) to produce multiple Scenes.
* Instead of owning a single `pipelineOwner`, the `RendererBinding` now owns the root of the `PipelineOwner` tree (exposed as `rootPipelineOwner` on the binding). Each `PipelineOwner` in that tree (except for the root) typically manages its own render tree typically rooted in one of the `RenderView`s mentioned in the previous bullet. During frame production, the binding will instruct each `PipelineOwner` of that tree to flush layout, paint, semantics etc. A higher-level abstraction (e.g. the widgets layer, see below) is in charge of adding `PipelineOwner`s to this tree.
* Backwards compatibility: The old `renderView` and `pipelineOwner` properties of the `RendererBinding` are retained, but marked as deprecated. Care has been taken to keep their original behavior for the deprecation period, i.e. if you just call `runApp`, the render tree bootstrapped by this call is rooted in the deprecated `RendererBinding.renderView` and managed by the deprecated `RendererBinding.pipelineOwner`.

### Widgets layer changes

* The `WidgetsBinding` no longer attaches the widget tree to an existing render tree. Instead, it bootstraps a stand-alone widget tree that is not backed by a render tree. For this, `RenderObjectToWidgetAdapter` has been replaced by `RootWidget`.
* Multiple render trees can be bootstrapped and attached to the widget tree with the help of the `View` widget, which internally is backed by a `RawView` widget. Configured with a `FlutterView` to render into, the `RawView` creates a new `PipelineOwner` and a new `RenderView` for the new render tree. It adds the new `RenderView` to the `RendererBinding` and its `PipelineOwner` to the pipeline owner tree.
* The `View` widget can only appear in certain well-defined locations in the widget tree since it bootstraps a new render tree and does not insert a `RenderObject` into an ancestor. However, almost all Elements expect that their children insert `RenderObject`s, otherwise they will not function properly. To produce a good error message when the `View` widget is used in an illegal location, the `debugMustInsertRenderObjectIntoSlot` method has been added to Element, where a child can ask whether a given slot must insert a RenderObject into its ancestor or not. In practice, the `View` widget can be used as a child of the `RootWidget`, inside the `view` slot of the `ViewAnchor` (see below) and inside a `ViewCollection` (see below). In those locations, the `View` widget may be wrapped in other non-RenderObjectWidgets (e.g. InheritedWidgets).
* The new `ViewAnchor` can be used to create a side-view inside a parent `View`. The `child` of the `ViewAnchor` widget renders into the parent `View` as usual, but the `view` slot can take on another `View` widget, which has access to all inherited widgets above the `ViewAnchor`. Metaphorically speaking, the view is anchored to the location of the `ViewAnchor` in the widget tree.
* The new `ViewCollection` widget allows for multiple sibling views as it takes a list of `View`s as children. It can be used in all the places that accept a `View` widget.

## Google3

As of July 5, 2023 this change passed a TAP global presubmit (TGP) in google3: tap/OCL:544707016:BASE:545809771:1688597935864:e43dd651

## Note to reviewers

This change is big (sorry). I suggest focusing the initial review on the changes inside of `packages/flutter` first. The majority of the changes describe above are implemented in (listed in suggested review order):

* `rendering/binding.dart`
* `widgets/binding.dart`
* `widgets/view.dart`
* `widgets/framework.dart`

All other changes included in the PR are basically the fallout of what's implemented in those files. Also note that a lot of the lines added in this PR are documentation and tests.

I am also very happy to walk reviewers through the code in person or via video call, if that is helpful.

I appreciate any feedback.

## Feedback to address before submitting ("TODO")
2023-07-17 16:14:08 +00:00
Taha Tesser
526522d9e5
[Reland] - Update DialogTheme tests for M2/M3 (#130711)
This relands https://github.com/flutter/flutter/pull/130414 (which was reverted in https://github.com/flutter/flutter/pull/130578)
2023-07-17 15:16:58 +00:00
Pavel Mazhnik
3a1190a5a8
[flutter_tools] Support coverage collection for dependencies (#129513)
PR provides a new option to the `test` command to include coverage info of specified packages.  
It helps collecting coverage info in test setups where test code lives in separate packages or for multi-package projects.
At present, only current package is included to the final report.

Usage:

Consider an app with two packages: `app`, `common`.
Some of the tests in `app` use (indirectly) code that is located in `common`. When running with `--coverage` flag, that code is not included in the coverage report by default. To include `common` package in report, we can run:

```sh
flutter test --coverage --coverage-package app --coverage-package common
```

Note that `--coverage-package` accepts regular expression. 

Fixes https://github.com/flutter/flutter/issues/79661
Fixes https://github.com/flutter/flutter/issues/101486
Fixes https://github.com/flutter/flutter/issues/93619
2023-07-17 08:42:13 +00:00
Taha Tesser
a6187d9a92
Fix DatePicker uses incorrect overlay color from DatePickerTheme and add missing tests (#130584)
fixes [YearPickerState in calendar_date_picker is using dayOverlayColor instead of yearOverlayColor](https://github.com/flutter/flutter/issues/130051)

### Description

- Fix year selection uses incorrect overlay color from `DatePickerTheme`
- Update defaults tests to check for overlay color for different modes
- Add tests to check overlay color is resolved.

### 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(
      theme: ThemeData(
        datePickerTheme: const DatePickerThemeData(
          yearOverlayColor: MaterialStatePropertyAll<Color>(Colors.green),
          dayOverlayColor: MaterialStatePropertyAll<Color>(Colors.amber),
        ),
        useMaterial3: true,
      ),
      home: Directionality(
        textDirection: TextDirection.ltr,
        child: Material(
          child: Center(
            child: DatePickerDialog(
              initialDate: DateTime(2023, DateTime.january, 25),
              firstDate: DateTime(2022),
              lastDate: DateTime(2024, DateTime.december, 31),
              currentDate: DateTime(2023, DateTime.january, 24),
            ),
          ),
        ),
      ),
    );
  }
}

``` 
	
</details>

```dart
          yearOverlayColor: MaterialStatePropertyAll<Color>(Colors.green),
          dayOverlayColor: MaterialStatePropertyAll<Color>(Colors.red),
```

### Before
![Screenshot 2023-07-14 at 18 39 51](https://github.com/flutter/flutter/assets/48603081/52ec5096-bad6-4753-9e9a-15b6d5ce767e)

### After
![Screenshot 2023-07-14 at 18 38 32](https://github.com/flutter/flutter/assets/48603081/a51aeca8-a5c2-42b4-8c05-b55f9955e860)
2023-07-17 08:08:51 +00:00
Qun Cheng
f4da09626e
Update DropdownMenu, SnackBarTheme and Stepper tests for M2/M3 (#130464)
Updated unit tests for `DropdownMenu`, `SnackBarTheme` and `Stepper` to have M2 and M3 versions.

More info in #127064
2023-07-17 08:07:10 +00:00
Ian Hickson
5a866a031f
Clarify the whole "CustomPainters default to Size.zero" thing. (#130624)
Fixes https://github.com/flutter/flutter/issues/52707
2023-07-17 00:36:30 +00:00
Polina Cherkasova
127b7c8b05
Upgrade leak_tacker and other packages. (#130585) 2023-07-14 19:04:05 -07:00
Ian Hickson
a47c0803cf
Consistency in dependOnInheritedWidgetOfExactType guidance (#130632)
Fixes https://github.com/flutter/flutter/issues/47067
2023-07-14 23:37:10 +00:00
Ian Hickson
fa5869a462
Clarify docs on WidgetsBindingObserver (#130621)
Fixes https://github.com/flutter/flutter/issues/56102
2023-07-14 23:01:50 +00:00
Michael Goderbauer
5654bfe89a
Remove duplicated dart:ui imports (#130606)
Small clean up. A file probably doesn't need multiple way to refer to dart:ui concepts.
2023-07-14 22:47:12 +00:00
LongCatIsLooong
f2574ba1de
Use the new rounding hack migration flag in TextPainter (#130548) 2023-07-14 21:12:24 +00:00
Michael Goderbauer
d5c724eb07
Remove unused imports (#130603) 2023-07-14 13:36:02 -07:00
Pavel Mazhnik
1c1c273bca
[web] remove unnecessary awaits from flutter.js (#130204)
Fixed types for `_getNewServiceWorker` and `_waitForServiceWorkerActivation` functions.  
These functions currently expect a Promise as an argument, but we're actually passing in an already resolved value:
```js
.then(this._getNewServiceWorker)
.then(this._waitForServiceWorkerActivation);
```
2023-07-14 19:10:55 +00:00
Polina Cherkasova
d5e7f407e1
Test cover some leak-free code. (#130543) 2023-07-14 10:14:04 -07:00
gmackall
9391923276
Add an android migrator to upgrade minSdkVersions 16,17,18 to flutter.minSdkVersion (#129729)
This migrator will upgrade the minSdkVersion used in the [module-level build.gradle](https://developer.android.com/build#module-level) file to flutter.minSdkVersion. 

The PR also makes a small refactor to `AndroidProject` to add a getter for the module level build.gradle file, and uses that getter in places where we were getting that file (previously it was being gotten directly via `hostAppGradleRoot.childDirectory('app').childFile('build.gradle')`.

Part of the work for deprecating support for the Jelly Bean android apis.
2023-07-14 16:57:06 +00:00
Christopher Fujino
b91aedb175
Fix StateError during hot reload when no Dart isolates found (#130537)
Fixes https://github.com/flutter/flutter/issues/116262
2023-07-14 16:13:57 +00:00
Bruno Leroux
ef312048e5
Fix finish translation for tab labels (#130333)
## Description

This PR update the finnish translations for tab label.

## Related Issue

fixes https://github.com/flutter/flutter/issues/110451

## Tests

Adds 2 tests.
2023-07-14 15:04:40 +00:00
Zachary Anderson
b8fa923386
Revert "Update DialogTheme tests for M2/M3" (#130578)
Reverts flutter/flutter#130414

Skia gold failures https://ci.chromium.org/ui/p/flutter/builders/prod/Mac%20framework_tests_libraries/11972/overview
2023-07-14 14:15:45 +00:00
Taha Tesser
feab854516
Update DialogTheme tests for M2/M3 (#130414)
Updated unit tests for `DialogTheme` to have M2 and M3 versions.

More info in https://github.com/flutter/flutter/pull/128725
2023-07-14 07:36:36 +00:00
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