Commit graph

22773 commits

Author SHA1 Message Date
Qun Cheng 7ff5f81a2e
Fix SegmentedButton default size and default tappable size (#142243)
fix https://github.com/flutter/flutter/issues/121493

`SegmentedButton` uses `TextButton` for each segments. When we have `MaterialTapTargetSize.padded` for `TextButton`, we make sure the minimum tap target size is 48.0( this value can be adjusted by visual density), even tough the actual button size is smaller. When `SegmentedButton` paints segments by using `MultiChildRenderObjectWidget`, it also includes the tap target size so the button that it actually draws always has the same height as the height of the tap target size.

To fix it, this PR firstly calculate the actual height of a text button in `SegmentedButton` class, then we can get the height delta if there is. Then the the value of (Segmented button render box height - the delta) would be the actual button size that we should see.

For now, we are not able to customize the min, max, fixed size in [`SegmentedButton` style](https://api.flutter.dev/flutter/material/SegmentedButton/style.html). So the standard button height is always 40 and can only be customized by `style.visualDensity` and `style.tapTargetSize`; `SegmentedButton` only simulates the `TextButton` behavior when `TextButton`'s height is its default value.

![Screenshot 2024-01-25 at 11 45 42 AM](https://github.com/flutter/flutter/assets/36861262/7451fa96-6d45-4cd3-a894-ca71e776c8ef)

https://github.com/flutter/flutter/assets/36861262/15ca6034-e6e0-4cc6-8fe3-808b4bd6a920
2024-01-26 00:20:21 +00:00
Pierrick Bouvier 37c3978b34
Enable native compilation for windows-arm64 (#141930)
It's now possible to natively compile a flutter app for windows-arm64. Cross-compilation is not yet implemented.

Uses arm64 artifacts now available for Dart/Flutter. Platform detection is based on Abi class, provided by Dart. Depending if Dart is an arm64 or x64 binary, the Abi is set accordingly. Initial bootstrap of dart artifacts (update_dart_sdk.ps1) is checking PROCESSOR_ARCHITECTURE environment variable, which is the way to detect host architecture on Windows.

This is available only for master channel (on other channels, it fallbacks to windows-x64).

On windows-x64, it produces an x64 app. On windows-arm64, it produces an arm64 app.
2024-01-26 00:08:20 +00:00
derdilla e342667954
fix Ink not updating on TextField newline (#140700)
Fixes a layout bug when using an EditableText and something containing an Ink widget.
2024-01-25 14:51:54 -08:00
Nate 497f912d6e
Implementing switch expressions in the cupertino/ directory (#141591)
Refactors code to use the new `switch` expressions.
2024-01-25 13:29:28 -08:00
LouiseHsu caba667ed4
Fix incorrect zh-cn translation for Look Up Label in selection controls (#142158)
Fixes https://github.com/flutter/flutter/issues/141764

Translation suggestion here:

https://tc.corp.google.com/btviewer/edittranslation?project=Flutter&msgId=8222331119728136330&language=zh-CN

## 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] All existing and new tests are passing.
2024-01-25 10:24:42 -08:00
Justin McCandless 204a8848a6
PopScope example improvements (#142163)
Attempting to help users understand how to build a confirmation dialog when exiting a route.
2024-01-25 10:14:49 -08:00
Sigurd Meldgaard a0e43d3053
Don't show legacy welcome message when analytics are disabled (#140956)
The legacy welcome message would be printed even if `CI=true` confusing
parsers of the output.

This fixes: https://github.com/flutter/flutter/issues/139737

---------

Co-authored-by: eliasyishak <42216813+eliasyishak@users.noreply.github.com>
2024-01-25 16:29:42 +01:00
Andrew Kolos 295a9a2031
provide command to FakeCommand::onRun (#142206)
Part of work on [#101077](https://github.com/flutter/flutter/pull/141194). This is done as a separate PR to avoid a massive diff.

## Context
1. The `FakeCommand` class accepts a list of patterns that's used to match a command given to its `FakeProcessManager`. Since `FakeCommand` can match a list of patterns, not just specifically strings, it can be used to match commands where the exact value of some arguments can't (easily) known ahead of time. For example, a part of the tool may invoke a command with an argument that is the path of a temporarily file that has a randomly-generated basename.
2. The `FakeCommand` class provides on `onRun` parameter, which is a callback that is run when the `FakeProcessManager` runs a command that matches the `FakeCommand` in question.

## Issue
In the event that a `FakeCommand` is constructed using patterns, the test code can't know the exact values used for arguments in the command. This PR proposes changing the type of `onRun` from `VoidCallback?` to `void Function(List<String>)?`. When run, the value `List<String>` parameter will be the full command that the `FakeCommand` matched.

Example:
```dart
FakeCommand(
  command: <Pattern>[
    artifacts.getArtifactPath(Artifact.engineDartBinary),
    'run',
    'vector_graphics_compiler',
    RegExp(r'--input=/.*\.temp'),
    RegExp(r'--output=/.*\.temp'),
  ],
  onRun: (List<String> command) {
    final outputPath = (() { 
      // code to parse `--output` from `command`
    })();
    testFileSystem.file(outputPath).createSync(recursive: true);
  },
)
```
2024-01-25 07:51:25 +00:00
David Iglesias 703e12f524
[ci] Adds test for web hot restart with const App. (#141824)
This PR adds a test that reproduces the problem described in the linked issue: hot restart on the web seems to not update if the app being run is `const`.

The new test is expected to fail, until the `const` issue with hot restart in the web is resolved.

Expected failure mode is a 15s timeout in the following test:

```
02:31 +3 ~1 -1: Hot reload (index.html: Default) (with `const MyApp()`)): newly added code executes during hot restart [E]
  TimeoutException after 0:00:15.000000: Future not completed
  dart:async  _startMicrotaskLoop
  ...
```

(And then a bunch of output that I'm not 100% sure is intended :))

## Issues

* #141588
2024-01-25 01:49:08 +00:00
Renzo Olivares eba38c4b77
Fix text selection edge scrolling when inside a horizontal scrollable (#140250)
Fixes #129590

* Consider `AxisDirection` when calculating scroll offset used in determining TextSelection during a drag/long press drag. Previously it seems that we were assuming the direction was always vertical 30cc831985/packages/flutter/lib/src/widgets/text_selection.dart (L2842-L2844) .
* SelectableText now considers RenderEditable offset changes and Scrollable offset changes when calculating the TextSelection during a long press drag.
2024-01-25 00:59:06 +00:00
Polina Cherkasova 47d8252a85
Reland "Remove hack from PageView." (#142172)
Original PR: https://github.com/flutter/flutter/pull/141533
Failure: https://fusion2.corp.google.com/presubmit/601217743/OCL:601217743:BASE:601219708:1706132224874:9a4bcab3/targets
Fix: [b/321743868](https://b.corp.google.com/321743868), http://cl/601219001 (added as g3 fix.
2024-01-24 23:44:11 +00:00
Polina Cherkasova a522b38e96
Upgrade leak_tracker. (#142162) 2024-01-24 15:33:17 -08:00
Jo Jaeyong 23385468a8
Support wireless debugging for iOS 12 or earlier (#141439)
`idevicesyslog` requires the `--network` flag to obtain logs for iOS devices when wirelessly paired. 

When running Flutter on devices with iOS 12 or earlier versions, [the `idevicesyslog` command is used.](5931b4f21d/packages/flutter_tools/lib/src/ios/devices.dart (L1269-L1277)).

Related Issue: #15072
Related PRs: #118104, #118895, #60623
2024-01-24 22:14:08 +00:00
hangyu 6adc8246e4
Update navigationBar label's maxScaleFactor to meet GAR requirement (#141998)
fixes: https://github.com/flutter/flutter/issues/141997
2024-01-24 19:45:47 +00:00
Greg Price e661ed3a00
Revise tooltip theme docs, including more cross-references (#137316)
Much of the new wording here is borrowed from [ChipTheme], [SliderTheme], or [RadioThemeData], which I think are pretty good. I believe a lot of other theme classes have similar wording too. I've also made some tweaks of my own, notably the references to [MaterialApp.theme].

This started from a desire to have clearer cross-references pointing at what to do with a FooThemeData to make it take effect:
  https://github.com/flutter/flutter/pull/135879#discussion_r1355851481
but then as I started writing I kept finding more and more small things I wanted to adjust, including a couple of bits that were extraneous or obsolete.
2024-01-24 17:26:03 +00:00
LongCatIsLooong b6e758addb
Fixes #138773, port autocomplete to OverlayPortal (#140285)
Fixes #138773, port autocomplete to OverlayPortal
2024-01-24 16:49:18 +00:00
Jesús S Guerrero b5262f0d80
Revert "[web] - Fix broken TextField in semantics mode when it's a sibling of Navigator" (#142129)
Reverts flutter/flutter#138446

b/322136071
2024-01-24 16:13:26 +00:00
yim 24e7a0be8b
Don't change the height of the Textfield's labelStyle when it focused. (#141943)
Fixes #141448
2024-01-24 04:13:50 +00:00
Polina Cherkasova be031cb908
Ignore a leak. (#141737) 2024-01-24 04:01:23 +00:00
Jackson Gardner a668aa7f99
Revert "Add abifilters to our gradle templates" (#142089)
Reverts flutter/flutter#135529

This had some failures in postsubmit:

https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20gradle_plugin_light_apk_test/17054/overview
and 

https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20gradle_plugin_fat_apk_test/17262/overview

We should revert and then investigate.
2024-01-23 19:05:20 -08:00
Gray Mackall 512335230c
Add abifilters to our gradle templates (#135529)
Fixes https://github.com/flutter/flutter/issues/135173, and could also be interpreted as fixing https://github.com/flutter/flutter/issues/83596 based on @chinmaygarde 's comment.
2024-01-23 23:19:23 +00:00
Andrew Kolos cbe0ceafe2
consolidate AssetBundle::entries and AssetBundle::entryKinds into a new type, AssetBundleEntry (#142029)
Part of work on https://github.com/flutter/flutter/pull/141194

The [`AssetBundle`](0833929c99/packages/flutter_tools/lib/src/asset.dart (L80)) class contains two members, `entries` and `entryKinds`. `entries` contains asset data indexed by asset key. `entryKinds` contains the "kinds" of these assets, again indexed by asset key.

**Change.** Rather than have two separate maps, this PR proposes combining these maps into one by wrapping the asset data and kind into a single data type `AssetBundleEntry`.

**Purpose.** In https://github.com/flutter/flutter/pull/141194, I am considering associating more information with an asset. In particular, what transformers are meant to be applied to it when copying it to the build output. Rather than adding another map member onto `AssetBundle` (e.g. `entryTransformers`), I decided to make things neater by introducing the `AssetBundleEntry` type.
2024-01-23 22:00:46 +00:00
Christopher Fujino 1cee81c40a
[flutter_tools] fix language_version_test and enable shuffle (#142009)
Part of https://github.com/flutter/flutter/issues/85160
2024-01-23 20:31:53 +00:00
Ian Hickson 574e598118
Merge flutter_goldens_client into flutter_goldens (#141900)
This is part 1 of a broken down version of the #140101 refactor.
2024-01-23 21:07:31 +01:00
Lau Ching Jun f52eaaea08
Allow overriding the native assets yaml file in the resident runner. (#142016)
This is used when the native assets are built by a separate build system.

Context: b/286799303
2024-01-23 19:49:10 +00:00
hangyu bff417ac43
Update material banner maxScaleFactor to meet GAR requirement (#142015)
fixes: https://github.com/flutter/flutter/issues/142012
2024-01-23 19:24:54 +00:00
Qun Cheng e86c1c88e2
Add tooltip for the clear button on SearchAnchor's search view (#141804)
Fixes #141347
This PR is to add a "clear text" tooltip for the clear button on `SearchAnchor`'s search view and also add a `clearButtonTooltip` entry for `material_localizations`.
2024-01-23 17:47:06 +00:00
Michael Goderbauer 930403c6c3
Remove unused clipBehavior from OverflowBar (#141976)
Fixes https://github.com/flutter/flutter/issues/141606.

OverflowBar doesn't do any clipping and therefore there's no need to specify a clip behavior.
2024-01-23 17:16:26 +00:00
Bruno Leroux bef9763008
Add Share button to the SelectableRegion toolbar on Android (#141447)
## Description

This PR adds the share button to text selection toolbar buttons on Android ~~and iOS~~ for `SelectableRegion` (and therefore `SelectionArea`).

https://github.com/flutter/flutter/pull/139479 adds this button for `EditableText` (which is used by `TextField` and `SelectableText` but not by `SelectionArea`).

**Edit**: supporting this on iOS will need more work (see https://github.com/flutter/flutter/pull/141447#issuecomment-1889942622 and https://github.com/flutter/flutter/issues/141775).

## Related Issue

Follow up for https://github.com/flutter/flutter/issues/138728

## Tests

Adds 1 test.
2024-01-23 13:25:34 +00:00
Ian Hickson 5dc3b1894f
Add a comment about how to test flutter_goldens (#141902)
This is part 2 of a broken down version of the #140101 refactor.

This particular change wasn't in that original refactor but is a note to myself so that I remember how to test each of these changes in the future.
2024-01-23 00:49:07 +00:00
Ian Hickson 15ceca93a4
Enable contextMenuBuilder in the absence of selectionControls (#141810) 2024-01-23 00:49:05 +00:00
auto-submit[bot] b258ca011e
Reverts "hello_world app: migrate to Gradle Kotlin DSL" (#142018)
Reverts flutter/flutter#141541
Initiated by: yusuf-goog
This change reverts the following previous change:
Original Description:
This PR introduces the first app in this repo that fully uses Gradle Kotlin DSL.

It also fixes a bug I found in the process – fields of `FlutterExtensions` must be `public`.
2024-01-23 00:01:17 +00:00
Justin McCandless 0f7f08d535
Floating cursor docs (#133002)
Explains what a "floating cursor" is in the docs.
2024-01-22 14:17:29 -08:00
Gustl22 a98e43a871
refactor: Rename filterPluginsByPlatform, cleanup Platform Strings (#141780)
Part of #137040 and #80374

- Rename _filterPluginsByPlatform to _createPluginMapOfPlatform
- Move method in chronological order
- Cleanup platform strings
2024-01-22 21:54:06 +00:00
Bartek Pacia e593cdfb80
hello_world app: migrate to Gradle Kotlin DSL (#141541)
This PR introduces the first app in this repo that fully uses Gradle Kotlin DSL.

It also fixes a bug I found in the process – fields of `FlutterExtensions` must be `public`.
2024-01-22 21:47:20 +00:00
Matan Lurey 3b1e96e074
Remove duplicate code as suggested by natebosch. (#141988)
See https://github.com/flutter/flutter/pull/141821/files#r1462288131.
2024-01-22 13:08:36 -08:00
Jesús S Guerrero a3cd05c6d3
Revert "Remove hack from PageView." (#141977)
Reverts flutter/flutter#141533

 b/321743868
2024-01-22 20:14:44 +00:00
Matan Lurey 0b2269447f
Do not hang on test failures of tests within flutter_tools (#141821)
Fixes https://github.com/flutter/flutter/issues/141823

Before this change, when a test would fail, the terminal would hang (by default for 30s) until killed by the test runner.

Basically, [`runZonedGuarded`](https://api.flutter.dev/flutter/dart-async/runZonedGuarded.html) _does_ document (though not clearly) that a returned future should not be awaited:

```txt
The zone will always be an error-zone ([Zone.errorZone](https://api.flutter.dev/flutter/dart-async/Zone/errorZone.html)), so returning a future created inside the zone, and waiting for it outside of the zone, will risk the future not being seen to complete.
```

For example, you can see other places in Dart and Flutter that we circumvent that problem:

- 5987563e4a/packages/flutter_tools/test/general.shard/base/async_guard_test.dart (L279-L306)
- b04c9c127f/lib/src/dartdoc.dart (L258-L264)
- d1afda52d2/lib/web_ui/dev/browser_process.dart (L20-L22)

I'm open to suggestions on how to test this :)

/cc @natebosch @jakemac53 @lrhn if you have any color commentary for us.
2024-01-22 19:49:59 +00:00
Greg Spencer 0dea82e684
Remove unneeded expectation in test (#141822)
## Description

This removes an unneeded expectation in the test for the AppLifecycleListener.  It's unneeded because the test immediately resets the state anyhow.  I'm removing it because the web implementation sets the value when initializing, so it's never initially null there.

## Related PR
 - https://github.com/flutter/engine/pull/44720#issuecomment-1898482363
2024-01-22 19:46:10 +00:00
Jonas Uekötter 174bbf254b
Add documentation which explains that debugPrint also logs in release mode (#141595)
It's confusing that `debugPrint` also prints in release mode, given that a lot (most?) other things prefixed with `debug` don't do anything in release mode. Therefore, this adds some documentation that this is indeed logging in release mode and adds an example how to disable this.

*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-01-22 18:24:38 +00:00
Taha Tesser 5aa6cb857d
Fix RangeSlider throws a null-check error after clearSemantics is called (#141965)
fixes [Null-check operator on RangeSlider's _startSemanticsNode](https://github.com/flutter/flutter/issues/141953)
2024-01-22 18:21:31 +00:00
Hassan Toor 59e892d391
[web] - Fix broken TextField in semantics mode when it's a sibling of Navigator (#138446)
When a `TextField` is rendered before a `Navigator`, it breaks in semantics mode.  This is because the framework generates the incorrect semantics tree (excludes the TextField) and when that tree gets sent to the engine, we don't get the signal to create the corresponding `<input>` element.

This happens for a few reasons:
* `ModalBarrier` uses `BlockSemantics` to drop the semantics of routes beneath the current route in `Navigator`
* `ModalBarrier` mistakenly recognizes the widget outside of the `Navigator` to be its sibling
*  So we end up dropping the semantics node of the `TextField` rendered before it. 

The fix is to let `Navigator` generate a semantics node so that `ModalBarrier` doesn't mistakenly think widgets outside of `Navigator` are its siblings.  

`Navigator` doesn't currently do this, which causes all the nodes generated from its widget subtree to be directly attached to the parent semantics node above `Navigator` - since this is also the parent of `TextField`, it considers them siblings. 

Fixes https://github.com/flutter/flutter/issues/129324
2024-01-22 17:03:14 +00:00
Tess Strickland 7ca4b7b86b
Mark defaultTargetPlatform as constant for non-debug non-web builds. (#141105)
This PR adds the Dart VM `vm:platform-const-if` pragma introduced in
https://github.com/dart-lang/sdk/commit/57a1168875 to the
`defaultTargetPlatform` property, allowing it to be computed as if it
was a constant field in non-debug AOT builds. In particular, this means
that platform-specific code executed conditionally based on this
property can be tree-shaken in release builds. Note that this PR changes
`defaultTargetPlatform` to only allow overriding via
`debugDefaultTargetPlatformOverride` in debug builds, and makes it so
that compilation throws an error if code assigns
to`debugDefaultTargetPlatformOverride` in other build modes.

Related issue: #14233

## 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] All existing and new tests are passing.
2024-01-22 14:49:47 +01:00
Taha Tesser 9574d585e3
Fix shape and collapsedShape isn't applied to ExpansionTile's splash ink (#141777)
This updates the previous attempt https://github.com/flutter/flutter/pull/135855 and removes the complications when testing M3 ink sparkle effect. 
Thanks to this [PR](https://github.com/flutter/flutter/pull/138757) by @Piinks 

fixes [ExpansionTile InkSplash doesn't respect Shape's borderRadius](https://github.com/flutter/flutter/issues/125779)
fixes [`ExpansionTile.backgroundColor` &  `ExpansionTile.collapsedBackgroundColor` removes splash effect](https://github.com/flutter/flutter/issues/107113)

### 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(
      debugShowCheckedModeBanner: false,
      home: Example(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return const Scaffold(
      body: Center(
          child: Padding(
        padding: EdgeInsets.symmetric(horizontal: 24.0),
        child: ExpansionTile(
          collapsedBackgroundColor: Color(0x25ff0000),
          backgroundColor: Color(0x250000ff),
          collapsedShape: RoundedRectangleBorder(
            borderRadius: BorderRadius.all(Radius.circular(30.0)),
            side: BorderSide(color: Colors.black, width: 2.0),
          ),
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.all(Radius.circular(30.0)),
            side: BorderSide(color: Colors.black, width: 2.0),
          ),
          clipBehavior: Clip.hardEdge,
          title: Text('Expansion Tile'),
          children: <Widget>[
            FlutterLogo(size: 50),
            FlutterLogo(size: 50),
            FlutterLogo(size: 50),
            FlutterLogo(size: 50),

          ],
        ),
      )),
    );
  }
}
```

</details>

### Before

<img width="789" alt="Screenshot 2024-01-18 at 18 16 15" src="https://github.com/flutter/flutter/assets/48603081/8c6a6f1e-6986-4acf-8dec-e223a682c0d7">

<img width="789" alt="Screenshot 2024-01-18 at 18 16 44" src="https://github.com/flutter/flutter/assets/48603081/f55f6a26-2128-48a1-b24d-3c14e4f6ecdc">

### After 
<img width="789" alt="Screenshot 2024-01-18 at 18 20 27" src="https://github.com/flutter/flutter/assets/48603081/7ec8b888-7319-460d-8488-9cd44c9246a6">

<img width="789" alt="Screenshot 2024-01-18 at 18 20 53" src="https://github.com/flutter/flutter/assets/48603081/80d66d5b-7eb2-4f47-ab4d-d7f469a731fa">
2024-01-22 11:13:31 +00:00
Daco Harkes 634b326efc
Reapply "Native assets: roll deps" (#141748) (#141864)
Fixes https://github.com/flutter/flutter/issues/141827

Reland: https://dart-review.googlesource.com/c/sdk/+/346960 has rolled into g3, so the imports should now resolve in g3 as well.

> [!CAUTION]
> _Do NOT merge if "Google Testing" bot didn't run!_

Rolls the packages from https://github.com/dart-lang/native in the native assets implementation.

Most notable we're refactoring `package:native_assets_cli` for `build.dart` use.
Therefore, all imports to that package for Flutter/Dart should be to the implementation internals that are no longer visible for `build.dart` writers. Hence all the import updates.

No behavior in Flutter apps should change.

This PR also updates the template to use the latests version of `package:native_assets_cli` which no longer exposes all the implementation details.
2024-01-22 10:42:15 +00:00
Taha Tesser 0ef4638822
Update ToggleButtons, ExpansionPanel, and ExpandIcon tests for Material 3 (#141868)
Updated unit tests for `ToggleButtons`, `ExpansionPanel`, and `ExpandIcon` to have M2 and M3 versions.

More info in #139076
2024-01-22 10:01:05 +00:00
Christopher Fujino 92094802fe
[flutter_tools] update analyze_once_test.dart to be null-safe (#141790)
Fixes https://github.com/flutter/flutter/issues/141743

I should have made this change in https://github.com/flutter/flutter/pull/124039, but it escaped my grep search.
2024-01-21 07:54:05 +00:00
林洵锋 f340d207f6
Adjust the position of require File.expand_path (#141521)
On `Podfile`:

```ruby
flutter_application_path = '../flutter_module'
load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')

target 'OCProject' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for OCProject
  # install_all_flutter_pods(flutter_application_path)
  # install_flutter_engine_pod(flutter_application_path)
  # install_flutter_application_pod(flutter_application_path)
  install_flutter_plugin_pods(flutter_application_path)

end

post_install do |installer|
  flutter_post_install(installer)
end
```
Encountering the following error after executing `pod install`:

```shell
pod install

[!] Invalid `Podfile` file: undefined method `flutter_relative_path_from_podfile' for #<Pod::Podfile:0x000000010e74c520 @defined_in_file=#<Pathname:/Users/lxf/gitHub/flutter_hybrid_bug/OCProject/Podfile>, @internal_hash={}, @root_target_definitions=[#<Pod::Podfile::TargetDefinition label=Pods>], @current_target_definition=#<Pod::Podfile::TargetDefinition label=Pods>>

  relative = flutter_relative_path_from_podfile(export_script_directory)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^.

 #  from /Users/lxf/gitHub/flutter_hybrid_bug/OCProject/Podfile:17
 #  -------------------------------------------
 #    # install_flutter_plugin_pods(flutter_application_path)
 >    install_flutter_application_pod(flutter_application_path)
 #
 #  -------------------------------------------
```

The `flutter_relative_path_from_podfile` method is in `flutter_tools/bin/podhelper.rb`, but now `flutter_tools/bin/podhelper.rb` is only required in `install_all_flutter_pods` in `podhelper.rb.tmpl`.

Sometimes we only need to use the `install_flutter_plugin_pods` method in podhelper.rb. For example, using `Shorebird` in an iOS hybird app scenario, we need to build `Flutter.xcframework` and `App.xcframework` and embed them into the iOS native project. In order to avoid unnecessary conflicts, use `install_flutter_plugin_pods` method to install Flutter plugin pods.

[Shorebird - Code Push In Hybrid Apps](https://docs.shorebird.dev/guides/hybrid-app/ios)

So I adjust the position of `require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)`.
2024-01-21 06:18:26 +00:00
LongCatIsLooong 5892a0039b
Remove more textScaleFactor references (#141816)
Remove more `textScaleFactor` references from flutter/flutter.  

- Some changes are related to label scaling: the padding EdgeInsets values of some chip subclasses scale linearly between predetermined "max" padding values and "min" padding values. Before they scale with the `textScaleFactor` scalar, now they scale with the font size and are still capped at the original "max" and "min" values.
- The rest of them are tests or size heuristics that depend on `textScaleFactor`, these are replaced by an effective text scale factor computed using a default font size (which is determined in a pretty random fashion, but it will only make a difference on Android 14+).

No API changes in this batch. There are still some references left that I intend to remove in a different batch that would introduce API changes.
2024-01-20 00:27:18 +00:00
Taha Tesser 788614d171
Fix "Delete" tooltip is shown disabled on chips with onDeleted callback (#141770)
fixes [Disabled chips with `onDeleted` callback shows "Delete" tooltip on hover](https://github.com/flutter/flutter/issues/141336)

### 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(
      debugShowCheckedModeBanner: false,
      home: Example(),
    );
  }
}

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

  @override
  State<Example> createState() => _ExampleState();
}

class _ExampleState extends State<Example> {
  bool _isEnable = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
          children: <Widget>[
            RawChip(
              label: const Text('RawChip'),
              onPressed: () {},
              isEnabled: _isEnable,
              onDeleted: () {},
            ),
            FilterChip(
              label: const Text('FilterChip'),
              selected: false,
              onSelected: _isEnable ? (bool value) {} : null,
              onDeleted: () {},
            ),
            InputChip(
              label: const Text('InputChip'),
              isEnabled: _isEnable,
              onDeleted: () {},
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton.extended(
        onPressed: () {
          setState(() {
            _isEnable = !_isEnable;
          });
        },
        label: Text(_isEnable ? 'Disable' : 'Enable'),
      ),
    );
  }
}
```

</details>

### Preview

| Before | After |
| --------------- | --------------- |
| <img src="https://github.com/flutter/flutter/assets/48603081/f80ae5f7-0a6d-4041-ade3-cbc2b5c78188" height="450" /> | <img src="https://github.com/flutter/flutter/assets/48603081/04e62854-e3f1-4b65-9753-183d288f3cfe" height="450" /> |
2024-01-19 22:19:16 +00:00
Qun Cheng 05854afa9b
SearchAnchor search view clear button only shows up when text input is not empty (#141755) 2024-01-19 13:01:07 -08:00
Reid Baker 684247a3c7
Use Integer instead of int in map in flutter.groovy (#141895)
packages Roller breakage 
https://ci.chromium.org/ui/p/flutter/builders/try/Linux_android%20android_build_all_packages%20master/5504/overview
Fixes flutter/flutter/issues/141897
```
FAILURE: Build failed with an exception.

* Where:
Script '/b/s/w/ir/x/w/flutter/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy' line: 168

* What went wrong:
Could not compile script '/b/s/w/ir/x/w/flutter/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy'.
> startup failed:
  script '/b/s/w/ir/x/w/flutter/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy': 168: primitive type parameters not allowed here;
     solution: use the corresponding wrapper type, such as Integer for int @ line 168, column 41.
     e static final Map<String, int> ABI_VERS
```

Covered by tests in packages.
2024-01-19 20:57:08 +00:00
Daco Harkes 2e229be2ff
Native assets: package in framework on iOS and MacOS (#140907)
Packages the native assets for iOS and MacOS in frameworks.

Issue:

* https://github.com/flutter/flutter/issues/140544
* https://github.com/flutter/flutter/issues/129757

## Details

* [x] This packages dylibs from the native assets feature in frameworks. It packages every dylib in a separate framework.
* [x] The dylib name is updated to use `@rpath` instead of `@executable_path`.
* [x] The dylibs for flutter-tester are no longer modified to change the install name. (Previously it was wrongly updating the install name to the location the dylib would have once deployed in an app.)
* [x] Use symlinking on MacOS.
2024-01-19 20:29:13 +00:00
Ian Hickson 77c3807c80
Revert "Make tests more resilient to Skia gold failures and refactor flutter_goldens for extensive technical debt removal (#140101)" (#141814)
Reverts https://github.com/flutter/flutter/pull/140101

That PR somehow made non-matching gold tests not fail at HEAD.

Fixes https://github.com/flutter/flutter/issues/141880
- Blocked by https://github.com/flutter/flutter/issues/140169
  - https://github.com/flutter/flutter/pull/141427
2024-01-19 20:29:11 +00:00
Qun Cheng ba4a11dafa
Add showDragHandle to showBottomSheet (#141754) 2024-01-19 11:17:40 -08:00
Michael Goderbauer cc544169be
Make pumpWidget's arguments named (#141728)
Much nicer calling API and simplifies evolving this API in the future.

I wish we could write a dart fix for this, but that's blocked on https://github.com/dart-lang/sdk/issues/54668.
2024-01-19 18:29:07 +00:00
fzyzcjy 9e024fdf31
Tiny fix inaccurate documentations about bindings (#140282)
The old doc says that, AutomatedTestWidgetsFlutterBinding for `flutter test` and LiveTestWidgetsFlutterBinding for `flutter run`. However, suppose we `flutter test integration_test/simple_test.dart` with the following code:

```
void main() {
  testWidgets('hi', (WidgetTester tester) async {
    print('hi ${TestWidgetsFlutterBinding.instance} ${Platform.operatingSystem}');
  });
}
```

We will see: `hi <IntegrationTestWidgetsFlutterBinding> ios`. Therefore, we see `IntegrationTestWidgetsFlutterBinding` is used in a `flutter test` command, which is contrary to the documentation.
2024-01-19 17:45:13 +00:00
Zachary Anderson d4707d12d5
Roll engine to 9a6c64de8a4694cef59a338cd33ac1a9e7d23d9d (#141870)
Includes the Engine roll from
https://github.com/flutter/flutter/pull/141841

A new version of Dart is having trouble with the tool integration test
test `passing one file with errors are detected`:
https://ci.chromium.org/ui/p/flutter/builders/try/Mac%20tool_integration_tests_2_4/31851/overview.

However the analysis server emits the expected errors when we give it
both the file without issues and the file with issues.

My guess is that the analysis server has changed it's behavior slightly
when supplied with a single malformed file.

Since the Dart roll is >20 dev versions behind, and this is the only
failing presubmit test, and it's testing something a bit weird, I
suggest we investigate the right way to test the thing that test was
attempting to cover as a follow-up.
2024-01-19 09:38:01 -08:00
Ian Hickson 8ff0af0c70
Move the requestKeyboard up to the widgets layer (#141655)
Turns out all implementations of this method made this call, so it seems like it should belong in the superclass.
2024-01-19 02:30:03 +00:00
Yegor 5987563e4a
enable more tests in web mode (#141791)
- Unskip `text_style_test` for CanvasKit.
- Remove no longer necessary `kIsWeb` checks in a few tests.

This PR depends on https://github.com/flutter/engine/pull/49786, which rolled into the framework. If the engine PR needs to be reverted, this PR will need to be reverted too.
2024-01-18 23:55:33 +00:00
David Martos 197cd4d665
Update margin between label and icon in Tab to better reflect Material specs (#140698)
This PR improves the distance between the label and the icon in the Tab widget. 
I updated the margin to 2 pixels, taken from the Figma design page for Material 3. On Material 2 I left the default value of 10 pixels.

Related to #128696 (In particular, the distance between label and icon)

Here are some screenshots for comparison. I looked a bit into the other mentioned issue of the tab height not following the M3 spec. Flutter uses 72 and the spec uses 64. But because Tab is a PreferredSizeWidget, I don't think there is an easy way to provide a different size depending on `ThemeData.useMaterial3`, because there is no `BuildContext` available.
I provide a sample image for the 64 height as well for context on the linked issue, even though it's not part of the PR changes.

The screenshots are taken side by side with the image at: https://m3.material.io/components/tabs/guidelines

## Original

![original](https://github.com/flutter/flutter/assets/22084723/f52d46bb-eaf9-4519-976e-9ea07c021e14)

## New (tab height = 72, Flutter default for 8 years)

![new_72](https://github.com/flutter/flutter/assets/22084723/8c9d3510-eaca-4b7d-92d8-0d06a7e75136)

## New (tab height = 64, M3 spec)

![new_64](https://github.com/flutter/flutter/assets/22084723/f8811b70-766f-4a4f-b069-33673b1e3744)
2024-01-18 23:04:26 +00:00
auto-submit[bot] 1901d6fa10
Reverts "Enable native compilation for windows-arm64 " (#141809)
Reverts flutter/flutter#137618
Initiated by: Jasguerrero
This change reverts the following previous change:
Original Description:
It's now possible to natively compile a flutter app for
windows-arm64. Cross-compilation is not yet implemented.

Uses arm64 artifacts now available for Dart/Flutter.
Platform detection is based on Abi class, provided by Dart. Depending if
Dart is an arm64 or x64 binary, the Abi is set accordingly.
Initial bootstrap of dart artifacts (update_dart_sdk.ps1) is checking
PROCESSOR_ARCHITECTURE environment variable, which is the way to detect
host architecture on Windows.

This is available only for master channel (on other channels, it
fallbacks to windows-x64).

On windows-x64, it produces an x64 app. On windows-arm64, it produces an
arm64 app.
2024-01-18 22:48:16 +00:00
Polina Cherkasova 2cd448574b
Reland "Remove hack from PageView." (#141533)
Fixes https://github.com/flutter/flutter/issues/141119
Original PR: https://github.com/flutter/flutter/pull/141138
Revert: https://github.com/flutter/flutter/pull/141479
Reason for revert: https://fusion2.corp.google.com/presubmit/597877179/OCL:597877179:BASE:597883748:1705084754455:88d992fc/targets
Fix: cl/599347719
2024-01-18 20:45:08 +00:00
Callum Moffat e05d0dd21f
ScaleGestureRecognizer pointerCount=2 for trackpad gestures (#140745)
Now trackpad gestures will count as pointerCount=2 instead of 1. It makes it easier for people who want to have different behaviour for single-finger drag vs two-finger pan/zoom. Also fixed up `scale_test.dart` to verify `pointerCount` in more places.

Related: https://github.com/flutter/flutter/issues/13102
Fixes https://github.com/flutter/flutter/issues/140730
2024-01-18 20:15:38 +00:00
Pierrick Bouvier 540559204e
Enable native compilation for windows-arm64 (#137618)
It's now possible to natively compile a flutter app for
windows-arm64. Cross-compilation is not yet implemented.

Uses arm64 artifacts now available for Dart/Flutter.
Platform detection is based on Abi class, provided by Dart. Depending if
Dart is an arm64 or x64 binary, the Abi is set accordingly.
Initial bootstrap of dart artifacts (update_dart_sdk.ps1) is checking
PROCESSOR_ARCHITECTURE environment variable, which is the way to detect
host architecture on Windows.

This is available only for master channel (on other channels, it
fallbacks to windows-x64).

On windows-x64, it produces an x64 app. On windows-arm64, it produces an
arm64 app.
2024-01-18 19:15:23 +00:00
Jesús S Guerrero 1997bec685
Revert "Native assets: roll deps" (#141748)
b/320767653

Reverts flutter/flutter#141684
2024-01-18 18:13:21 +00:00
Pierre-Louis ef5beeced3
Deprecate M2 curves (#134417)
These have 1:1 replacements with a new name, introduced in
https://github.com/flutter/flutter/pull/129942

Land after https://github.com/flutter/packages/pull/4898

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

## 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] 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
2024-01-18 18:38:00 +01:00
Renzo Olivares cd06ba7ab6
Fix: TextField can inherit errorStyle from InputDecorationTheme. (#141227)
Previously `TextField`s error `cursorColor` was being derived without taking into account any `InputDecorationTheme` defaults. This change respects `InputDecorationTheme` defaults when deriving the error `cursorColor`.

Fixes #140607
2024-01-18 17:37:06 +00:00
yaakovschectman 3123d98132
Add check for Bank of Brazil security module to Windows Flutter Doctor validators (#141135)
Add a warning to Flutter Doctor if Topaz OFD is found as a process on
the system.
The protection module used by the Bank of Brazil has been identified as
causing build failures when using VS with CMake for Windows (see
https://github.com/flutter/flutter/issues/121366#issuecomment-1845703728).
Disabling the software allows the build to succeed again.

If a running process is found by `flutter doctor` whose path contains
`Topaz OFD\Warsaw\core.exe`, a warning message is generated to convey
this.

Addresses https://github.com/flutter/flutter/issues/121366

## 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 `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat

---------

Co-authored-by: Elias Yishak <42216813+eliasyishak@users.noreply.github.com>
Co-authored-by: Loïc Sharma <737941+loic-sharma@users.noreply.github.com>
2024-01-18 12:32:49 -05:00
Reid Baker c479109e75
Fix gradle lints No semantic change should be present. (#141692)
Move static methods together.
Fix property uses of duplicate strings.
Add types wherever obvious
Fix format depth
Add whitespace to top and bottom of classes
Ignore line length for file
Ignore prefer single quote for file
Ignore correction for getFoo used instead of foo

Loosely related to flutter/flutter/issues/123934
2024-01-18 16:33:10 +00:00
Andrew Kolos 0833929c99
Catch UnsupportedError thrown when user provides an asset directory path containing invalid characters (#141214)
Fixes https://github.com/flutter/flutter/issues/140092
2024-01-18 08:35:59 +00:00
Yegor 00032569a1
[web] prepare layers_test.dart for https://github.com/flutter/engine/pull/49786 (#141731)
This disables the expectation for `TileMode` stringification because
https://github.com/flutter/engine/pull/49786 is about to fix it (as in,
the test would fail when the engine fix lands).
2024-01-17 18:53:33 -08:00
Qun Cheng ef794e2a28
Add headerHeight for SearchAnchor (#141223)
Fixes #140046

This PR is to add a `headerHeight` property to `SearchAnchor` and `SearchViewThemeData` so the header height on the search view can be customized.
2024-01-17 22:49:04 +00:00
Andrew Kolos 5757500931
Make test file systems/platforms used in asset_bundle_test.dart less dependent on the host platform (#141657)
Part of work on https://github.com/flutter/flutter/pull/141214. See [this discussion](https://github.com/flutter/flutter/pull/141214#discussion_r1446727495) for the inspiration for this PR.

## Issue
Many tests in [packages/flutter_tools/test/general.shard/asset_bundle_test.dart](4cd0a3252d/packages/flutter_tools/test/general.shard/asset_bundle_test.dart) aren't hermetic. When setting up fake `FileSystem` and `Platform` objects, the host OS is referenced:

f2745e97d5/packages/flutter_tools/test/general.shard/asset_bundle_test.dart (L35-L40)

f2745e97d5/packages/flutter_tools/test/general.shard/asset_bundle_test.dart (L43)

To improve hermeticity here, we could instead run each once _per_ valid combination of file system style and platform. However, it is unclear if these tests even depend on the file system style (integration tests should catch most cases where this might matter). As a result, I think it's sufficient to improve hermeticity by always assuming a Linux environment, which is generally our default (as `MemoryFileSystem` does, and most of our fakes of `Platform` do by default).

In general, if a test needs to run other kinds of environments, it should make this clear, ideally through the test name.
2024-01-17 21:23:01 +00:00
Daco Harkes f5442bf937
Native assets: roll deps (#141684)
Rolls the packages from https://github.com/dart-lang/native in the native assets implementation.

Most notable we're refactoring `package:native_assets_cli` for `build.dart` use.
Therefore, all imports to that package for Flutter/Dart should be to the implementation internals that are no longer visible for `build.dart` writers. Hence all the import updates.

No behavior in Flutter apps should change.

This PR also updates the template to use the latests version of `package:native_assets_cli` which no longer exposes all the implementation details.
2024-01-17 21:20:36 +00:00
Yegor bac4d8391b
[web] prepare for https://github.com/flutter/engine/pull/49786 (#141700)
Skip incorrect expectations in preparation for https://github.com/flutter/engine/pull/49786.

Bonus: improved error message when text style test fails
2024-01-17 19:22:19 +00:00
LongCatIsLooong da20edf0ff
Fix Tooltip show delay when mouse moves to one Tooltip from another (#141656)
Fixes https://github.com/flutter/flutter/issues/141644
2024-01-17 17:11:24 +00:00
Greg Spencer 4e3be0bf8e
Fix the --empty flag to not try working with non-app templates (#141632)
## Description

This adds a check to make sure that the `--empty` flag isn't applied to non-app templates.

## Related Issues
 - Fixes https://github.com/flutter/flutter/issues/141592

## Tests
 - Added a test.
2024-01-17 16:51:03 +00:00
Kostia Sokolovskyi e36a868beb
TrainHoppingAnimation should dispatch creation and disposal events. (#141635) 2024-01-16 19:13:58 -08:00
Christopher Fujino 4cd0a3252d
[flutter_tools] Fix analyze size on arm64 (#141317)
Fixes https://github.com/flutter/flutter/issues/140659
2024-01-17 00:15:28 +00:00
LongCatIsLooong 212d0a64c9
Allow selection in composing region (#140516)
Fixes https://github.com/flutter/flutter/issues/68547 for macOS. Needs https://github.com/flutter/engine/pull/49314
2024-01-16 23:33:49 +00:00
Anis Alibegić e063f56832
Fixed few typos (#141543)
I continued [my mission](https://github.com/flutter/flutter/pull/141431) to find as many typos as I could. This time it's a smaller set than before.

There is no need for issues since it's a typo fix.
2024-01-16 21:40:08 +00:00
Reid Baker 2b890af939
handle rc versions of gradle in version compare (#141612)
- handle number format exceptions and strip rc information from version compare
- add test that handles rc format

part 2/n https://github.com/flutter/flutter/issues/138523

Helpfully pointed out by [asaarnak](https://github.com/asaarnak) https://github.com/flutter/flutter/pull/139325#issuecomment-1892554584
2024-01-16 19:29:26 +00:00
Bartek Pacia 2442603cfc
Delete redundant settings.ext.flutterSdkPath (#141509)
This line is a leftover. Removing it is a no-op.
2024-01-16 19:19:24 +00:00
Bartek Pacia 1e5acbcb55
Reference GitHub issue in TODO comment (#141582)
[Source](https://github.com/flutter/flutter/pull/133598#discussion_r1446033128)

For future readers.
2024-01-16 18:56:19 +00:00
Bartek Pacia e1d6f7e822
migrate {min,target,compile}SdkVersion to {min,target,compile}Sdk (#141537)
Inspired by #137621.
2024-01-16 18:39:12 +00:00
Jenn Magder 90ced90f1b
Sort Swift imports in templates (#141487)
`swift-format` alphabetizes imports.  Alphabetize them in swift template files and integration tests.

I found this as part of https://github.com/flutter/flutter/issues/41129 running `swift-import` on packages.
2024-01-16 18:07:21 +00:00
Polina Cherkasova a8e699249b
Ignore or fix leaks. (#141468) 2024-01-16 09:44:49 -08:00
Spt 3d112429cc
Solve the problem that <Flutter/Flutter.h> cannot be imported when a pod transitive depends on Flutter (#125610)
![image](https://user-images.githubusercontent.com/8318578/234780282-89b18d27-df49-4b4e-88b5-c9d17cf3334f.png)
![image](https://user-images.githubusercontent.com/8318578/234780668-901ab816-5b6b-4d87-a6f4-120b5852580c.png)
If a pod transitive depends on a pod containing a framework, cocoapods will add the path of the framework to its FRAMEWORK_SEARCH_PATHS.
So I modified the relevant logic in podhelper, hoping to be consistent with the behavior of cocoapods.

Fixes https://github.com/flutter/flutter/issues/126251.
2024-01-16 15:36:38 +00:00
Sulav Parajuli a9f9136633
Fix #141061: Add 'color' property to DrawerButton and EndDrawerButton (#141159)
## Description

This PR addresses issue #141061, which requested the addition of a 'color' property to buttons extending _ActionButton. The 'color' property has been introduced to enhance customization options for these buttons.

## Issues Fixed

- Fixes #141061
2024-01-16 10:08:27 +00:00
auto-submit[bot] 8e94423e6a
Reverts "BoxPainter should dispatch creation and disposal events." (#141545)
Reverts flutter/flutter#141526
Initiated by: CaseyHillers
This change reverts the following previous change:
Original Description:
### Description
- Adds `BoxPainter` creation and disposal events dispatching for memory leak tracking as part of https://github.com/flutter/flutter/issues/141198

### Tests
- Updates `decoration_test.dart` to test `BoxPainter` object creation and disposal events dispatching.
2024-01-15 01:53:26 +00:00
Kostia Sokolovskyi e5f62cc5a0
Private disposables should dispatch creation and disposal events. (#141535) 2024-01-14 13:24:50 -08:00
Kostia Sokolovskyi 1a2c3151fe
BoxPainter should dispatch creation and disposal events. (#141526) 2024-01-14 10:07:10 -08:00
OutdatedGuy a8cb8af857
Added newline at end of .gitignore files (#141270)
Added missing required newline at end of some `.gitignore` files. All other `.gitignore` files ends with a newline except the changed ones, hence the PR.

> *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.*

**Not listing any issues because of trivial fixes as mentioned above.**
2024-01-12 23:22:11 +00:00
Anis Alibegić 81d80c587d
Fixed a lot of typos (#141431)
Fair amount of typos spotted and fixed. Some of them are in comments, some of them are in code and some of them are in nondart files.

There is no need for issues since it's a typo fix.

I have doubts about [packages/flutter_tools/lib/src/ios/core_devices.dart](https://github.com/flutter/flutter/compare/master...anisalibegic:flutter:master#diff-fdbc1496b4bbe7e2b445a567fd385677af861c0093774e3d8cc460fdd5b794fa), I have a feeling it might broke some things on the other end, even though it's a typo.
2024-01-12 22:10:25 +00:00
auto-submit[bot] 8f797fc379
Reverts "Remove hack from PageView." (#141479)
Reverts flutter/flutter#141138
Initiated by: itsjustkevin
This change reverts the following previous change:
Original Description:
Fixes https://github.com/flutter/flutter/issues/141119

The change is breaking, because now controller is nullable.

Migration path: https://github.com/flutter/website/pull/10033

Packages to fix:
2024-01-12 21:19:18 +00:00
Christopher Fujino 9e9af67b9a
unpin web_socket_channel and roll pub packages (#141424)
Fixes https://github.com/flutter/flutter/issues/141032

We pinned to web_socket_channel v2.4.1 because v2.4.2 was retracted, however v2.4.3 is now available.
2024-01-12 19:13:08 +00:00
Bartek Pacia dbf5f04b86
FlutterExtension: make fields non-static (#141463)
There's no issue for this PR. I can create one if requested.

## Summary

This PR makes public fields of `FlutterExtension` non-static. The aim is to make migrating from Gradle Groovy DSL to Gradle Kotlin DSL easier for Flutter developers, because...

### Without this PR

**android/app/build.gradle.kts**

```kotlin
plugins {
    id "com.android.application"
    id "dev.flutter.flutter-gradle-plugin"
}

android {
    namespace = "io.flutter.examples.hello_world"
    compileSdk = FlutterExtension.compileSdkVersion

    defaultConfig {
        applicationId = "io.flutter.examples.hello_world"
        minSdk = FlutterExtension.minSdkVersion
        targetSdk = FlutterExtension.targetSdkVersion
        // ...
    }
}
// ...
```

Groovy and Java allow accessing static fields of a class through its instance, but Kotlin is being more "correct" and disallows that.

### With this PR

Thanks to this PR, the user won't have to replace `flutter` with FlutterExtension in some places, thus decreasing possible confusion.

```kotlin
plugins {
    id "com.android.application"
    id "dev.flutter.flutter-gradle-plugin"
}

android {
    namespace = "io.flutter.examples.hello_world"
    compileSdk = flutter.compileSdkVersion

    defaultConfig {
        applicationId = "io.flutter.examples.hello_world"
        minSdk = flutter.minSdkVersion
        targetSdk = flutter.targetSdkVersion
        // ...
    }
}
// ...
```
2024-01-12 18:49:21 +00:00
hangyu 4b914bd17c
[deep link] Update a gradle task to add flag check and intent filter check to the AppLinkSettings (#141231)
These check result is used in devtool deep link validation
issue: https://github.com/flutter/flutter/issues/120408

## 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
2024-01-12 10:36:26 -08:00
Bartek Pacia fd827e3a88
Expose versionCode and versionName from local.properties in FlutterExtension (#141417)
This PR has no issue. I got this cool idea and decided to quickly try it out, and it works.

### Summary

This will allow Flutter Developers to have less code in their Android Gradle buildscripts.

```diff
 plugins {
     id "com.android.application"
     id "dev.flutter.flutter-gradle-plugin"
     id "kotlin-android"
 }

-def localProperties = new Properties()
-def localPropertiesFile = rootProject.file("local.properties")
-if (localPropertiesFile.exists()) {
-    localPropertiesFile.withReader("UTF-8") { reader ->
-        localProperties.load(reader)
-    }
-}
-
-def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
-if (flutterVersionCode == null) {
-    flutterVersionCode = "1"
-}
-
-def flutterVersionName = localProperties.getProperty("flutter.versionName")
-if (flutterVersionName == null) {
-    flutterVersionName = "1.0"
-}
-
-def keystorePropertiesFile = rootProject.file("keystore.properties")
-def keystoreProperties = new Properties()
-
 keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

 android {
         applicationId "pl.baftek.discoverrudy"
         minSdk 21
         targetSdk 34
-        versionCode flutterVersionCode.toInteger()
-        versionName flutterVersionName
+        versionCode flutter.versionCode()
+        versionName flutter.versionName()
     }
```

The boilerplate that loads 'local.properties' can live in Flutter Gradle Plugin.

### Concerns

I was worried about lifecycle/ordering issues, so I tested it.

To Flutter Gradle Plugin, I added:

```diff
 class FlutterPlugin implements Plugin<Project> {
     //...

     @Override
     void apply(Project project) {
+        project.logger.quiet("Start applying FGP")
         // ...
     }
 }
```

and to my `android/app/build.gradle` I added:

```diff
 android {
+    logger.quiet("Start evaluating android block")
     namespace "pl.bartekpacia.awesomeapp"
     compileSdk 34
 
     defaultConfig {
         applicationId "pl.baftek.discoverrudy"
         minSdk 21
         targetSdk 34
         versionCode flutter.versionCode()
         versionName flutter.versionName()
     }
```

Gradle first applies the plugins (which sets versionCode and versionName on FlutterExtension), and then it executes the `android {}` extension block:

```
$ ./gradlew :app:assembleDebug

> Configure project :app
Start applying FGP
Start evaluating android block

BUILD SUCCESSFUL in 2s
383 actionable tasks: 10 executed, 373 up-to-date
```

So ordering is fine.
2024-01-12 18:18:32 +00:00
Jonah Williams f2745e97d5
When Impeller is enabled for flutter tester choose correct shader target. (#141391)
When compiling shaders for flutter tester, include Vulkan shaders when targeting Impeller.
2024-01-12 17:49:54 +00:00
Polina Cherkasova 2da87e6108
Remove hack from PageView. (#141138) 2024-01-12 09:47:34 -08:00
Mairramer f40a99ce7e
Adds support for StepStyle visual property bundle to the Step widget (#140825)
Fixes  #140770 and #103124

Adds the possibility of passing a height and width to icons. And also a margin for the distance of the lines between the icons.
2024-01-12 16:35:08 +00:00
Taha Tesser e20d34c38a
Fix FlexibleSpaceBar centered title position and title color (#140883)
fixes [Invisible SliverAppBar title in Material 3 light theme](https://github.com/flutter/flutter/issues/138296) 
fixes [`FlexibleSpaceBar` title is misaligned without the leading widget](https://github.com/flutter/flutter/issues/138608)

Previous attempt https://github.com/flutter/flutter/pull/138611

--- 

### Description

 - fixes the `FlexibleSpaceBar` centered title position when there is a leading widget.
 - fixes the `FlexibleSpaceBar` title color for Material 3.
 - Added documentation when using a long `FlexibleSpaceBar` title and update its test.
 - Improved documentation of default title padding.

### Code sample

### 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(
      debugShowCheckedModeBanner: false,
      home: Example(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return const Scaffold(
      body: SafeArea(
          child: CustomScrollView(
        slivers: <Widget>[
          SliverAppBar(
            leading: Icon(Icons.favorite_rounded),
            flexibleSpace: FlexibleSpaceBar(
              title: ColoredBox(
                color: Color(0xffff0000),
                child: Text('SliverAppBar'),
              ),
            ),
          ),
        ],
      )),
    );
  }
}
```

</details>

###  Before

![Screenshot 2024-01-03 at 18 02 25](https://github.com/flutter/flutter/assets/48603081/92ae1062-c78f-4005-8e28-85af617acd60)

### After

![Screenshot 2024-01-03 at 18 02 16](https://github.com/flutter/flutter/assets/48603081/2ef97108-9b50-44f7-a303-018ff1b28db6)
2024-01-12 13:29:13 +00:00
Bartek Pacia 0a1af8a192
Add support for Gradle Kotlin DSL (#140744)
This PR resolves #140548. It's based on my work in #118067.
2024-01-12 02:20:06 +00:00
Taha Tesser 8dcae5ace4
Fix ListWheelScrollView in an AnimatedContainer with zero height throw an error (#141372)
fixes [`ListWheelScrollView` Throws Unexpected Error Inside `AnimatedContainer`](https://github.com/flutter/flutter/issues/140780)
fixes [`CupertinoDatePicker` throw exception when parent height is 0](https://github.com/flutter/flutter/issues/55630)

### 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,
      home: Scaffold(
        body: AnimatedContainer(
          height: 0,
          duration: Duration.zero,
          child: ListWheelScrollView(
            itemExtent: 20.0,
            children: <Widget>[
              for (int i = 0; i < 20; i++) Container(),
            ],
          ),
        ),
      ),
    );
  }
}
```

</details>
2024-01-11 18:26:04 +00:00
Andrew Kolos c355219154
make asset_test.dart tests not dependent on context (#141331)
Part of work on https://github.com/flutter/flutter/issues/141330, which is a part of work on https://github.com/flutter/flutter/issues/140092

This is a refactoring; there should be no behavioral changes in these tests.
2024-01-11 18:08:07 +00:00
Gianluca Bettega e281c39164
Expose 'enable' property to allow the user to disable the SearchBar (#137388)
This exposes the `enabled` property of the `TextField` widget to the `Searchbar` widget.

## Related Issues

https://github.com/flutter/flutter/issues/136943

Still missing tests
2024-01-11 17:58:50 +00:00
Jonah Williams 35903620c8
Add impeller key to skia gold client, Turn on a framework test shard that will run unit tests with --enable-impeller (#141341)
Redo of https://github.com/flutter/flutter/pull/140985 due to CLA issues.
2024-01-11 17:57:00 +00:00
Dan Field 9f2e681e7b
[Tool][Impeller] Make impellerc produce Vulkan and GLES shaders for Android. (#140976)
This should wait for some upstream work, just don't want to lose it locally for now. I'll switch this from draft and update the description when it's ready.
2024-01-11 17:49:59 +00:00
Kate Lovett 9785718031
Add dart fix support to flutter_driver (#141300)
Part of https://github.com/flutter/flutter/issues/139249

This adds dart fix support plus fixes for APIs that are currently deprecated in the flutter_driver package.
2024-01-11 00:07:49 +00:00
Polina Cherkasova 13684ca471
Fix a leak. (#141312) 2024-01-11 00:00:10 +00:00
Kate Lovett a94c14e063
Add covariants to reduce subclass casts in 2D APIs (#141318)
While working in https://pub.dev/packages/two_dimensional_scrollables, I found I could eliminate some casts if we added covariants here in the framework.
Much of the 2D aPI in the framework is abstract, so I think it make sense to add these and make it easier/cleaner for subclasses using the APIs.
I made a similar change in https://github.com/flutter/flutter/pull/131358, this would cover all of the cases I could find so its nice and accommodating now.
2024-01-10 23:28:48 +00:00
Justin McCandless 865825c3c1
Call onPopInvoked when pages API is used (#141221)
(Predictive Back) Fixes a bug where when using PopScope and Navigator.pages together, onPopInvoked wasn't being called.
2024-01-10 14:29:30 -08:00
Polina Cherkasova 420b15a75a
Fix mechanism to pass flag for leak tracking. (#141226) 2024-01-10 22:08:06 +00:00
Polina Cherkasova 34f1f5f19e
Improve testing for leak tracking. (#140553) 2024-01-10 11:04:28 -08:00
Christopher Fujino 0f5cd7855d
[flutter_tools] fix flutter create -t skeleton (#141233)
Fixes https://github.com/flutter/flutter/issues/139138

This had been broken since https://github.com/flutter/flutter/pull/130090 merged, however, the test happened run with flutter_tools/pubspec.yaml in the current working directory.
2024-01-10 18:50:07 +00:00
Derek Xu eff2e7dbb1
Unpin package:vm_service (#141279) 2024-01-10 12:47:25 -05:00
Igor Hnízdo 7efed85b35
NestedScrollView's outer scrollable jumping with BouncingScrollPhysics due to double precision errors (#138319)
This PR fixes scrolling issues with `NestedScrollView` using the `BouncingScrollPhysics`. In one of the steps of the calculation, we can reach a state where the position of the inner scrollable is set to a `double` value that falls within `precisionErrorTolerance` of `0` but we were using `==` with `0` rather than checking for a precision. My posts in the linked issue show the current behavior, and how I reached to conclusion (the code in this PR). This PR only addresses the "jumping" of the outer scrollable.  

Fixes #136199

I have not finished a test for this since I have never done so and therefore have 0 experience writing tests in Flutter, so any help there would be appreciated. I am also not sure how to test double precision errors in general. I did run all the nested_scroll_view_tests.dart locally and there are no failures.
2024-01-10 00:28:09 +00:00
Polina Cherkasova 0f2618ff4f
Fix or except leaks. (#141081)
Contributes to https://github.com/flutter/devtools/issues/6909.
2024-01-10 00:17:33 +00:00
Chris Bobbe 8d2aca385f
TextStyle: In copyWith, stop ignoring debugLabel when receiver has none (#141141)
Fixes #141140.

This ensures that if you call `.copyWith` and pass a `debugLabel`, the `debugLabel` won't be ignored, even if the receiver (the TextStyle you're calling `.copyWith` on) doesn't have a `debugLabel`.

The debugLabel field was added in #12552. I skimmed the discussion there and didn't find anything indicating that the param was being ignored on purpose.

I added a test case that passes with the new code and fails with the old code.
2024-01-09 23:21:24 +00:00
stuartmorgan 32fd2cbf73
Replace deprecated exists in podhelper.rb (#141169)
The recently landed https://github.com/flutter/flutter/pull/140222 accidentally used the deprecated `exists?` instead of the non-deprecated `exist?` (which other code in this file is already, correctly, using).

Fixes https://github.com/flutter/flutter/issues/141167
2024-01-09 22:25:57 +00:00
Kevin Moore 0cef3f1629
Correctly handle null case in ProcessText.queryTextActions (#141205)
Replace `as Map<Object?, Object?>` to handle nullable case
Fixes runtime issue in Wasm

*Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.*

*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.*

*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-01-09 22:25:54 +00:00
Michael Goderbauer 4534a24c09
Reapply "Dynamic view sizing" (#140165) (#140918)
This reverts commit
d24c01bd0c.

The original change was reverted because it caused some apps to get
stuck on the splash screen on some phones.

An investigation determined that this was due to a rounding error.
Example: The device reports a physical size of 1008.0 x 2198.0 with a
dpr of 1.912500023841858. Flutter would translate that to a logical size
of 527.0588169589221 x 1149.2810314243163 and use that as the input for
its layout algorithm. Since the constraints here are tight, the layout
algorithm would determine that the resulting logical size of the root
render object must be 527.0588169589221 x 1149.2810314243163.
Translating this back to physical pixels by applying the dpr resulted in
a physical size of 1007.9999999999999 x 2198.0 for the frame. Android
now rejected that frame because it didn't match the expected size of
1008.0 x 2198.0 and since no frame had been rendered would never take
down the splash screen.

Prior to dynamically sized views, this wasn't an issue because we would
hard-code the frame size to whatever the requested size was.

Changes in this PR over the original PR:

* The issue has been fixed now by constraining the calculated physical
size to the input physical constraints which makes sure that we always
end up with a size that is acceptable to the operating system.
* The `ViewConfiguration` was refactored to use the slightly more
convenient `BoxConstraints` over the `ViewConstraints` to represent
constraints. Both essentially represent the same thing, but
`BoxConstraints` are more powerful and we avoid a couple of translations
between the two by translating the` ViewConstraints` from the
`FlutterView` to `BoxConstraints` directly when the `ViewConfiguration`
is created.

All changes over the original PR are contained in the second commit of
this PR.

Fixes b/316813075
Part of https://github.com/flutter/flutter/issues/134501.
2024-01-09 14:10:43 -08:00
SharbelOkzan 0c40f21fc5
Introduce new Form validation method (#135578)
Introduced `validateGranually` which, apart from announcing the errors to the UI, returns a `Map<Key, bool>` providing more granular validation details: The results of calling `validate` on each `FormField` and their corresponding widget keys.

* related issue: #135363
2024-01-09 21:10:04 +00:00
Taha Tesser 536de5ed91
Update RouteObserver example and fix an error thrown (#141166)
fixes [`RouteObserver` example throws an error](https://github.com/flutter/flutter/issues/141078)

### Description
This updates the `RouteObserver` example from snippet to Dartpad example and fixes the error when running the code snippet
2024-01-09 20:48:56 +00:00
Polina Cherkasova 1f3103e50d
Upgrade leak_tracker. (#141153) 2024-01-09 12:02:35 -08:00
Polina Cherkasova 188d4d1fdf
Remove conditions that depend on order. (#141183) 2024-01-09 11:19:04 -08:00
Nishant Kumar 83cf44ed12
resolved the issue of indeterminate CircularProgressIndicator.adaptive on Darwin (#140947)
Fixes #140574

Passes the value from `CircularProgressIndicator` to the Cupertino version so that functionality is not lost on Apple devices.
2024-01-09 18:19:07 +00:00
Bruno Leroux 5f17badf41
[Android] Add custom system-wide text selection toolbar buttons for SelectableRegion (#141103)
## Description

This PR adds custom system-wide text selection toolbar buttons on Android for `SelectableRegion` and `SelectionArea`.

https://github.com/flutter/flutter/pull/139738 adds those buttons for `EditableText` (which is used by `TextField` and `SelectableText` but not by `SelectionArea`).

## Related Issue

Step 5 for https://github.com/flutter/flutter/issues/139361

## Tests

Adds 2 tests.
2024-01-09 09:49:13 +00:00
Taha Tesser f7f437ce2a
Update Chips and ChipTheme tests and for Material 3 (#141022)
Updated unit tests for `Tooltip` to have M2 and M3 versions.

More info in #139076
2024-01-09 09:05:06 +00:00
Taha Tesser 649877d2cc
Update chip_test.dart tests for Material 3 (#140964)
Updated unit tests for `Tooltip` to have M2 and M3 versions.

More info in #139076
2024-01-09 09:03:02 +00:00
Bruno Leroux 2e6aac6ee6
Fix spell check throws when text contains regex reserved characters (#140384)
## Description

This PR fixes an issue related to the spell check implementation usage of Regex (searched text should be escaped).

## Related Issue

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

## Tests

Adds 1 test.
2024-01-09 08:59:20 +00:00
Daco Harkes b2ef2802d2
Native assets support for Android Add2app (#140802)
Support for FFI calls with @Native external functions through Native assets on Android add to app. This enables bundling native code without any build-system boilerplate code.

For more info see:

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

## Implementation details for Android add2app

The `.so` files are bundled with the same mechanism that bundles `libapp.so`.
2024-01-09 08:47:53 +00:00
asci 3b7ed0006c
[docs] Add document content related to chip shape (#140015)
(#139572)  I would like to request an update to the document to resolve confusion.
I actually modified the code by applying priority as in the comment in [#139572](https://github.com/flutter/flutter/issues/139572) as shown below, but I thought that if 'OutlinedBorder' was used for 'shape', the default value of side for 'OutlinedBorder' was also the developer's intention.

```
OutlinedBorder _getShape(ThemeData theme, ChipThemeData chipTheme, ChipThemeData chipDefaults) {
  final BorderSide? resolvedSide =
      MaterialStateProperty.resolveAs<BorderSide?>(widget.side, materialStates)
          ?? MaterialStateProperty.resolveAs<BorderSide?>(chipTheme.side, materialStates);
  final BorderSide? resolvedShapeSide =
      MaterialStateProperty.resolveAs<BorderSide?>(widget.shape?.side, materialStates)
          ?? MaterialStateProperty.resolveAs<BorderSide?>(chipTheme.shape?.side, materialStates);
  final OutlinedBorder resolvedShape =
      MaterialStateProperty.resolveAs<OutlinedBorder?>(widget.shape, materialStates)
          ?? MaterialStateProperty.resolveAs<OutlinedBorder?>( chipTheme.shape, materialStates)
          ?? MaterialStateProperty.resolveAs<OutlinedBorder?>(chipDefaults.shape, materialStates)
          // TODO(tahatesser): Remove this fallback when Material 2 is deprecated.
          ?? const StadiumBorder();
  // If the side is provided, shape uses the provided side.

  if (resolvedSide != null) {
    return resolvedShape.copyWith(side: resolvedSide);
  }
  if (resolvedShapeSide != null) {
    return resolvedShape.copyWith(side: resolvedShapeSide);
  }
  // If the side is not provided
  // then the shape's side is used. Otherwise, the default side is used.
  return resolvedShape.copyWith(side: chipDefaults.side);
}
```
(in `chip.dart`)

However, (#133856)  PR seems to be intended to ignore this and use the aspect of `chipDefault.side` even if the developer specifies `shape.side` as [Border.none] without explicitly applying `side` .
This is probably because the default value of OutlinedBorder is [Border.none].
I think this is an area that can cause enough confusion, but there are a lot of things that need to be modified to reduce confusion through code changes, and the impact on existing code is likely to be significant.
I also confirmed that this is not accurately explained in the API Docs.
So rather than modifying the code, I decided to add additional explanation to the `shape` comment.
If the results are different from what you intended or the updated content is strange, please review. 🙏
2024-01-08 23:06:10 +00:00
Zachary Anderson 7859fe3b24
Disable test shuffling in widget_tester_leaks_test.dart (#141110)
Fails with `flutter test --test-randomize-ordering-seed=20240108`

https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20framework_tests_misc/15044/overview

cc @polina-c
2024-01-08 15:54:05 +00:00
Christopher Fujino 6edbce9e07
Manual pub roll pinning web socket channel (#141040)
Work around https://github.com/flutter/flutter/issues/141032

Otherwise a re-land of https://github.com/flutter/flutter/pull/140979

Fixes https://github.com/flutter/flutter/issues/137163 & https://github.com/flutter/flutter/issues/139181
2024-01-05 22:29:58 +00:00
Andrew Kolos e90e4888b8
in flutter run, throw tool exit when --flavor is provided but is not supported on the target device (#139045)
Fixes https://github.com/flutter/flutter/issues/134197
2024-01-05 21:47:58 +00:00
Andrew Kolos 8c11aa030d
add flavor-conditional asset bundling support to flutter test (#140944)
Fixes https://github.com/flutter/flutter/issues/140932
2024-01-05 21:47:55 +00:00
TabooSun e8436970e6
Gen l10n add named argument option (#138663)
Add an option to use named argument for generated method.

Fix #116308
2024-01-05 21:28:08 +00:00
Luke Hutchison 0d6927cb61
Fix refresh cancelation (#139535)
Changes drag release logic so that an armed refresh is only canceled if the user has scrolled back up beyond the point where the refresh indicator was armed. (Fixes https://github.com/flutter/flutter/issues/138848.)

This is the minimal change I found could be made to restore something like the behavior that I would expect.

This may still need a bit of work, because it only masks the second issue I mentioned, that releasing a drag can cause the scroll position to be animated back up from the release point. There is actually a bug about that: https://github.com/flutter/flutter/issues/6052. I would like to see that bug fixed too. This PR doesn't address that, but makes it harder to hit that issue.

@Piinks this is a recreation of #139015 (since I couldn't figure out some issue with a git detached branch, so I fixed the PR and I'm re-submitting it). This version includes one line that was somehow accidentally dropped from the original PR. This will hopefully fix the test failures.

However, I don't have a clue how to write a test for a Flutter UI widget. I'll try to figure that out, but also I don't have a lot of time to work on this. I would appreciate at least some user testing to verify that the new behavior is much more intuitive than the old behavior.

- [?] All existing and new tests are passing.
2024-01-05 21:28:07 +00:00
auto-submit[bot] c2286a7642
Reverts "manual pub roll to pick up dds fixes" (#141033)
Reverts flutter/flutter#140979
Initiated by: loic-sharma
This change reverts the following previous change:
Original Description:
Fixes https://github.com/flutter/flutter/issues/137163
Fixes https://github.com/flutter/flutter/issues/139181
2024-01-05 19:10:19 +00:00
Taha Tesser 88016c11b4
Fix scrollable TabBar expands to full width when the divider is removed (#140963)
fixes [TabBar Expands to full width of the screen isScrollable: true after upgrading to flutter 3.16.4](https://github.com/flutter/flutter/issues/140338)

---

## Description

Fixes the scrollable `TabBar` width when the divider is removed. (when the divider height is set to `0` or divider color is set to `Colors.transparent`)

### 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) {
    const int tabsCount = 2;

    return MaterialApp(
      home: DefaultTabController(
        initialIndex: 1,
        length: tabsCount,
        child: Scaffold(
          appBar: AppBar(
            title: const Text('TabBar Sample'),
            bottom: PreferredSize(
              preferredSize: const Size.fromHeight(48.0),
              child: ColoredBox(
                color: Theme.of(context).colorScheme.secondaryContainer,
                child:  TabBar(
                  // dividerColor: Theme.of(context).colorScheme.onSurface,
                  dividerColor: Colors.transparent, // remove divider
                  // dividerHeight: 0, // remove divider
                  isScrollable: true,
                  tabAlignment: TabAlignment.center,
                  tabs: <Widget>[
                    for (int i = 0; i < tabsCount; i++)
                      Tab(
                        text: 'Tab $i',
                      ),
                  ],
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
```

</details>

### Before
![Simulator Screenshot - iPhone 15 Pro - 2024-01-04 at 15 16 15](https://github.com/flutter/flutter/assets/48603081/b776e7e6-e5f0-49df-8a79-55032eaad631)

### After
![Simulator Screenshot - iPhone 15 Pro - 2024-01-04 at 15 16 23](https://github.com/flutter/flutter/assets/48603081/9ad13793-43a9-4ae8-977e-7cf84cb59bb1)
2024-01-05 08:33:26 +00:00
Yegor 1fb95ba41b
[web] Fix and unskip a few more CanvasKit tests (#140821)
Fix and unskip the following CanvasKit tests:

- `test/painting/decoration_test.dart`
- `test/rendering/layers_test.dart`
- `test/widgets/app_overrides_test.dart`
2024-01-04 23:26:38 +00:00
Danny Tuppeny 2d3166b7f9
Pin package:vm_service (#140972)
vm_service 14 should not be used yet (see
https://github.com/flutter/flutter/pull/140916#issuecomment-1877383354)
but when trying to unpin pkg:test it was upgraded. This pins it to
v13.0.0.
2024-01-04 21:10:44 +00:00
Qun Cheng be8a1eac73
Add scrollbar for menus (#140941)
Fixes #140162

This PR is to add a scrollbar for MenuAnchor and DropdownMenu for all platforms when height is limited. Previously, a scrollbar only shows on desktop platforms. This PR also disabled scrollbar's overscroll for MenuAnchor and DropdownMenu.

<img src="https://github.com/flutter/flutter/assets/36861262/9ca3d4d0-415f-43bf-9d2b-df96a42db620" width="250"/><img src="https://github.com/flutter/flutter/assets/36861262/18da8d02-586b-4aa4-b647-927691542429" width="350"/>
2024-01-04 21:09:31 +00:00
Christopher Fujino e256d49117
manual pub roll to pick up dds fixes (#140979)
Fixes https://github.com/flutter/flutter/issues/137163
Fixes https://github.com/flutter/flutter/issues/139181
2024-01-04 19:43:06 +00:00
Polina Cherkasova 3ed0399663
Reland "integrate testWidgets with leak tracking" (#140521) (#140928) 2024-01-04 10:20:36 -08:00
Sharabiddin Ahmayev 2ae39c0cc0
Fix SegmentedButton states update logic (#140772)
This PR fixes: #140746

Desc: Style state update logic fix on SegmentedButton
2024-01-04 17:57:06 +00:00
Tirth 64a732740d
[Fix] Consistency in ButtonStyleButton related Tests (#140610)
[Fix] Consistency in ButtonStyleButton related Tests:
- Replaced the usage of ElevatedButton with FilledButton in FilledButton's test.
- Replaced the usage of TextButton.styleFrom with FilledButton.styleFrom in FilledButton's test.
- Replaced the usage of TextButton.styleFrom with ElevatedButton.styleFrom in ElevatedButton's test.
2024-01-04 17:03:58 +00:00
stuartmorgan 24e06232a7
Fix local engine use in macOS plugins (#140222)
Currently podhelper.rb will always point plugin builds at the cached engine artifacts, even when using `--local-engine`. In most cases this is fine, since when the final build actually runs it will be using the engine bundled into the app build, which will be the correct local engine build. When trying to test a local engine build with API additions against a local plugin modified to use those additions to ensure that they are working as expected, however, compilation will fail, because the new APIs won't be present in the plugin build.

This fixes that for macOS, and adds a TODO for iOS (which is more complicated to fix due to the host vs target build distinction).

macOS portion of https://github.com/flutter/flutter/issues/132228
2024-01-04 15:40:08 +00:00
Jenn Magder 5d4f5f77b8
Remove deprecated bitcode stripping from tooling (#140903)
Bitcode has been removed https://github.com/flutter/flutter/issues/107887, clean up the leftover commands.
2024-01-03 23:15:23 +00:00
Jenn Magder 076cb8a328
Migrate Xcode projects last version checks to Xcode 15.1 (#140256)
Change the following in the `flutter create` templates.  I didn't make any auto-migrations for existing apps because none seem that critical:
1. Turn on `ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS` in iOS and macOS.
1. Turn on `BuildIndependentTargetsInParallel` in macOS template.  https://github.com/flutter/flutter/pull/125827/files#r1181817619 
1. Turn on `DEAD_CODE_STRIPPING` in macOS template. 
1. Set `ENABLE_USER_SCRIPT_SANDBOXING=NO` in iOS and macOS template.  `flutter` scripts don't work with this on.  This might require a migration in the future to explicitly turn this one off. However at least for now if the setting isn't present it defaults to `NO`.

Add migration for `LastUpgradeVersion` so users won't see these validation issues in Xcode.

Run migrator on all the example apps.  A few aren't Flutter apps so I edited them in Xcode.

Fixes https://github.com/flutter/flutter/issues/140253
See also https://github.com/flutter/flutter/issues/125817 and https://github.com/flutter/flutter/pull/90304.
2024-01-03 23:05:46 +00:00
Michael Goderbauer ae4fb0ca7c
fix typo and reflow (#140925)
Fixes "differenet" => "different" and reflows the doc to 80 char line length.
2024-01-03 23:01:57 +00:00
auto-submit[bot] 253dc6f847
Reverts "Re-land integrate testWidgets with leak tracking." (#140926)
Reverts flutter/flutter#140521
Initiated by: zanderso
This change reverts the following previous change:
Original Description:
Original PR: https://github.com/flutter/flutter/pull/138057
Revert: https://github.com/flutter/flutter/pull/140502
Issue: https://ci.chromium.org/ui/p/flutter/builders/prod/Linux_android%20flutter_test_performance/12787/overview
Exception: flutter test rendered unexpected output (1 bad lines)
Explanation: leak tracker adds tear down even when there is no leak tracking, because at the moment of adding tear down it is unclear if leak tracking will be used for some tests.
Fix: add enabling flag for leak tracker and make creation of tear down conditional.
Prerequisites:
2024-01-03 22:36:17 +00:00
yim 0d4eb5eaa0
Changes the regular cursor to a floating cursor when a long press occurs. (#138479)
This PR changes the regular cursor to a floating cursor when a long press occurs.

This is a new feature. Fixes  #89228
2024-01-03 21:45:07 +00:00
Furkan Acar 83ac76050d
Add SegmentedButton.styleFrom (#137542)
fixes https://github.com/flutter/flutter/issues/138289

---

SegmentedButtom.styleFrom has been added to the segment button, so there is no longer any need to the button style from the beginning. It works like ElevatedButton.styleFrom only I added selectedForegroundColor, selectedBackgroundColor. In this way, the user will be able to change the color first without checking the MaterialState states. I added tests of the same controls.

#129215 I opened this problem myself, but I was rejected because I handled too many items in a PR. For now, I wrote a structure that only handles MaterialStates instead of users.

old (still avaliable)
<img width="626" alt="image" src="https://github.com/flutter/flutter/assets/65075121/9446b13b-c355-4d20-bda2-c47a23d42d4f">

new (just an option for developer)
<img width="483" alt="image" src="https://github.com/flutter/flutter/assets/65075121/0a645257-4c83-4029-9484-bd746c02265f">

### Code sample

<details>
<summary>expand to view the code sample</summary> 

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

/// Flutter code sample for [SegmentedButton].

void main() {
  runApp(const SegmentedButtonApp());
}

enum Calendar { day, week, month, year }

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

  @override
  State<SegmentedButtonApp> createState() => _SegmentedButtonAppState();
}

class _SegmentedButtonAppState extends State<SegmentedButtonApp> {
  Calendar calendarView = Calendar.day;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(useMaterial3: true),
      home: Scaffold(
        body: Center(
          child: SegmentedButton<Calendar>(
            style: SegmentedButton.styleFrom(
              foregroundColor: Colors.amber,
              visualDensity: VisualDensity.comfortable,
            ),
            // style: const ButtonStyle(
            //   foregroundColor: MaterialStatePropertyAll<Color>(Colors.deepPurple),
            //   visualDensity: VisualDensity.comfortable,
            // ),
            segments: const <ButtonSegment<Calendar>>[
              ButtonSegment<Calendar>(
                  value: Calendar.day,
                  label: Text('Day'),
                  icon: Icon(Icons.calendar_view_day)),
              ButtonSegment<Calendar>(
                  value: Calendar.week,
                  label: Text('Week'),
                  icon: Icon(Icons.calendar_view_week)),
              ButtonSegment<Calendar>(
                  value: Calendar.month,
                  label: Text('Month'),
                  icon: Icon(Icons.calendar_view_month)),
              ButtonSegment<Calendar>(
                  value: Calendar.year,
                  label: Text('Year'),
                  icon: Icon(Icons.calendar_today)),
            ],
            selected: <Calendar>{calendarView},
            onSelectionChanged: (Set<Calendar> newSelection) {
              setState(() {
                calendarView = newSelection.first;
              });
            },
          ),
        ),
      ),
    );
  }
}

```

</details>
2024-01-03 21:26:02 +00:00
Polina Cherkasova baf6ba134f
Re-land integrate testWidgets with leak tracking. (#140521) 2024-01-03 12:21:08 -08:00
Jonah Williams 0d378ed5ab
[flutter_tools] add support for --enable-impeller to test device. (#140899)
This allows unit tests to use the impeller backend, which can be useful for Scubas/golden tests.
2024-01-03 19:14:49 +00:00
Ann Marie Mossman 743cdd68b7
Handle KEYCODE_DPAD_CENTER and KEYCODE_ENTER (#140808)
https://github.com/flutter/flutter/issues/1670

Note: This PR replaces the the original PR (https://github.com/flutter/flutter/pull/138240) that got into a state where a rebase was not possible and made it difficult to determine what was causing unrelated test failures.
2024-01-03 18:37:23 +00:00
Elliott Brooks 55ba27d3bc
Link to wiki page about updating dependencies in each pubspec.yaml file (#140826)
Added a minimal wiki page about how to use the `update-packages` tool: https://github.com/flutter/flutter/wiki/Updating-dependencies-in-Flutter

This PR adds a link to that wiki page at the top of each pubspec.yaml file
2024-01-03 18:28:52 +00:00
Jack Gibbons f4cb3d215d
Add key to BottomNavigationBarItem (#139617)
Pass key into _BottomNavigationTile

Adding a optional key parameter to BottomNavigationBarItem to be passed through to _BottomNavigationTile.
This will allow easier testing in some scenarios, and fix the splash appearing on the wrong tile.

https://github.com/flutter/flutter/issues/139615
https://github.com/flutter/flutter/issues/34833
2024-01-03 15:58:21 +00:00
Satsrag c033b08df7
fix: cannot input new line using custom input control (#140356)
For https://github.com/flutter/flutter/issues/125875 and https://github.com/flutter/engine/pull/45522

According to [this discussion](https://github.com/flutter/flutter/pull/139446#discussion_r1424776370), Just added `forceMultiline` to JSON on `_configurationToJson`. @LongCatIsLooong @Renzo-Olivares
2024-01-03 01:58:24 +00:00
Jenn Magder b08fc60024
Set template and migrate apps to iOS 12 minimum (#140823)
Reland https://github.com/flutter/flutter/pull/140478 with `ios_content_validation_test` test fix.
```
[ios_content_validation_test] Process terminated with exit code 0.
Task result:
{
  "success": true,
  "data": null,
  "detailFiles": [],
  "benchmarkScoreKeys": [],
  "reason": "success"
}

```

__________

1. Change templates to `IPHONEOS_DEPLOYMENT_TARGET`, `MinimumOSVersion`, and Podfile `platform :ios` to 12.0.
2. Add migrator for Podfile part to migrate `platform :ios, '11.0'` -> `platform :ios, '12.0'`
3. Compile with `-miphoneos-version-min=12.0`
4. Run the migrator on all example apps and integration tests.

See also https://github.com/flutter/flutter/pull/62902 and https://github.com/flutter/flutter/pull/85174 and https://github.com/flutter/flutter/pull/101963

Fixes https://github.com/flutter/flutter/issues/136060
2024-01-03 00:47:40 +00:00
David Iglesias 6b4f0d5753
[flutter] Allow ViewCollection to start empty. (#140532)
This enables multi-view apps to start with zero views.
2024-01-03 00:22:52 +00:00
Andrew Kolos 3ac2dba58d
Fix setup race in asset bundle tests (#140832)
Fixes https://github.com/flutter/flutter/issues/140665 by replacing use of `setUpAll` and `teardownAll` with `setUp` and `teardown` respectively.

My theory has to how this issue happened (and how this PR fixes it) is that `setUpAll` is not guaranteed to run after any `setUp` in any parent test groups. However, `setUp` is guaranteed to run after any set-up callbacks in parent groups. From the [documentation](https://api.flutter.dev/flutter/flutter_test/setUp.html): 

> If this is called within a test group, it applies only to tests in that group. The body will be run after any set-up callbacks in parent groups or at the top level.

Meanwhile, [`setUpAll`](https://api.flutter.dev/flutter/flutter_test/setUpAll.html) has a weaker documented guarantee that applies only to other `setUpAll` calls:

> If this is called within a test group, The body will run before all tests in that group. It will be run after any [setUpAll](https://api.flutter.dev/flutter/flutter_test/setUpAll.html) callbacks in parent groups or at the top level. It won't be run if none of the tests in the group are run.
2024-01-03 00:15:51 +00:00
LongCatIsLooong f3b6505f14
Fix 139196 selection OOB (#140300)
Fixes #139196
2024-01-03 00:11:18 +00:00
Polina Cherkasova 45c611f040
Upgrade leak_tracker. (#140758) 2024-01-02 20:58:16 +00:00
auto-submit[bot] bd634f3298
Reverts "Set template and migrate apps to iOS 12 minimum" (#140822)
Reverts flutter/flutter#140478
Initiated by: loic-sharma
This change reverts the following previous change:
Original Description:
1. Change templates to `IPHONEOS_DEPLOYMENT_TARGET`, `MinimumOSVersion`, and Podfile `platform :ios` to 12.0.
2. Add migrator for Podfile part to migrate `platform :ios, '11.0'` -> `platform :ios, '12.0'`
3. Compile with `-miphoneos-version-min=12.0`
4. Run the migrator on all example apps and integration tests.

See also https://github.com/flutter/flutter/pull/62902 and https://github.com/flutter/flutter/pull/85174 and https://github.com/flutter/flutter/pull/101963

Fixes https://github.com/flutter/flutter/issues/136060
2024-01-02 20:49:19 +00:00
LongCatIsLooong 5883a6ca10
Reland "Make TextSpan hit testing precise." (#140468) (#140621)
Fixes https://github.com/flutter/flutter/issues/131435, https://github.com/flutter/flutter/issues/104594, https://github.com/flutter/flutter/issues/43400

Currently the method we use for text span hit testing `TextPainter.getPositionForOffset` always returns the closest `TextPosition`, even when the given offset is far away from the text.

The new TextPaintes method tells you the layout bounds `(width =  letterspacing / 2 + x_advance + letterspacing / 2, height = font ascent + font descent)` of a character, the PR changes the hit testing implementation such that a TextSpan is only considered hit if the point-down event landed in one of its character's layout bounds.

Potential issues:

In theory since the text is baseline aligned, we should use the max ascent and max descent of each character to calculate the height of the text span's hit-test region, in case some characters in the span have to fall back to a different font, but that will be slower and it typically doesn't make a huge difference.
This is a breaking change.
2024-01-02 20:26:12 +00:00
Elliott Brooks cb07292f57
Update dependencies with flutter update-packages --force-upgrade (#140810) 2024-01-02 12:10:10 -08:00
Jenn Magder acdbcadb9e
Set template and migrate apps to iOS 12 minimum (#140478)
1. Change templates to `IPHONEOS_DEPLOYMENT_TARGET`, `MinimumOSVersion`, and Podfile `platform :ios` to 12.0.
2. Add migrator for Podfile part to migrate `platform :ios, '11.0'` -> `platform :ios, '12.0'`
3. Compile with `-miphoneos-version-min=12.0`
4. Run the migrator on all example apps and integration tests.

See also https://github.com/flutter/flutter/pull/62902 and https://github.com/flutter/flutter/pull/85174 and https://github.com/flutter/flutter/pull/101963

Fixes https://github.com/flutter/flutter/issues/136060
2024-01-02 19:42:13 +00:00
shirne 7249d9ec6d
improve comment doc in tabs.dart (#140568)
*Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.*

*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.*

*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-01-02 19:03:10 +00:00
Dan Field bfdc32fcd0
Revert "[Impeller] Plumb through the impeller-force-gl flag." (#140535)
Reverts flutter/flutter#123828

Fixes https://github.com/flutter/flutter/issues/140523
2024-01-02 18:28:04 +00:00
Polina Cherkasova f667376cc8
Rename MemoryAllocations to FlutterMemoryAllocations. (#140623)
Contributes to https://github.com/flutter/flutter/issues/140622
2024-01-02 09:56:30 -08:00
Polina Cherkasova 59242b75c5
Add command line parameter that turns on leak tracking. (#138653) 2024-01-02 09:20:12 -08:00
Daniel Chevalier 186659dc35
Show width and height in inspector overlay (#140709)
![](https://media.giphy.com/media/SX71qs3TDxVkvbLJ4o/giphy-downsized.gif)

Fixes https://github.com/flutter/devtools/issues/6871

Add the width and height to the inspector overlay. 1 decimal precision is used since that matches the way Devtools displays the values.

## Examples
<img width="442" alt="Screenshot 2023-12-28 at 2 39 49 PM" src="https://github.com/flutter/flutter/assets/1386322/2de40092-de15-4ada-a954-e911e6bef217">

<img width="645" alt="Screenshot 2023-12-28 at 2 39 42 PM" src="https://github.com/flutter/flutter/assets/1386322/8f53dad5-1aba-43d9-9419-ca93cd894624">
<img width="149" alt="Screenshot 2023-12-28 at 2 39 37 PM" src="https://github.com/flutter/flutter/assets/1386322/bbed74b7-c962-4c20-80d8-48e5eaa14de6">
2023-12-29 01:34:40 +00:00
hhh b0b0e423d6
expose didExceedMaxLines from RenderParagraph (#139962)
I want to build a widget that adds some extra functionality when the inner text overflow. So the problem occurred, I can't find an elegant way to determine if the text is overflowing. 
So i expose `didExceedMaxLines` from `RenderParagraph`, I think it can make sense. Have there some advice?
2023-12-28 01:38:38 +00:00
Harry Terkelsen 13feba5852
[web] Re-enable text field test now that fix has landed in engine (#140678)
Re-enables skipped flaky test now that the underlying cause of flakiness (GPU memory leak) has been fixed in the engine and the fix has rolled into the framework.

The fix is here: https://github.com/flutter/engine/pull/49336

Fixes https://github.com/flutter/flutter/issues/137669
2023-12-27 21:45:18 +00:00
Zachary Anderson ddb8d1f670
Makes the flutter tool retry on a bad gateway network error from gradle (#140670)
Seen in https://github.com/flutter/flutter/issues/140643
2023-12-27 20:13:36 +00:00
Bruno Leroux 89f0c69e49
Add custom system-wide text selection toolbar buttons on Android (#139738)
## Description

This PR adds custom system-wide text selection toolbar buttons on Android.
~~This is a WIP until https://github.com/flutter/flutter/pull/139479 is merged (potential conflicts).~~

## Related Issue

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

## Tests

Adds 5 tests.
2023-12-27 19:03:29 +00:00
Zachary Anderson 6664dfec2f
Disable random test order in asset_bundle_test.dart (#140666)
For https://github.com/flutter/flutter/issues/140665
2023-12-27 18:06:31 +00:00
Reid Baker 48ae5ff6f6
Use double quotes over single quotes in gradle build files (#140512)
Following https://developer.android.com/build/migrate-to-kotlin-dsl
2/n Use double quotes instead of single quotes. 

Should be a no-op change. If you see a behavioral change please flag it.
2023-12-22 16:25:06 +00:00
flutter-pub-roller-bot 9c2a756009
Roll pub packages (#140525)
This PR was generated by `flutter update-packages --force-upgrade`.
2023-12-21 22:13:24 +00:00
Ian Hickson 62f1594908
Make tests more resilient to Skia gold failures and refactor flutter_goldens for extensive technical debt removal (#140101)
Originally landed in https://github.com/flutter/flutter/pull/139549
Originally reverted in https://github.com/flutter/flutter/pull/140085

- Remove all use of global variables.
- Always pass in all dependencies, only create them in main or in tests.
- Pass in the "print" primitive.
- Make all network traffic retry (except when run locally, when it just auto-passes).
- Enable tests to be run in random order.
- Better error messages
2023-12-21 21:35:07 +00:00
Andrew Kolos 9e104eb7c8
Fix flavor conditional asset bundling for macos (#140433)
Fixes https://github.com/flutter/flutter/issues/140430
Fixes https://github.com/flutter/flutter/issues/140432 while we are at it
2023-12-21 20:30:21 +00:00
Christopher Fujino 674fbd26bc
[flutter_tools] Ensure flutter daemon clients can detect preview device (#140112)
Part of https://github.com/flutter/flutter/issues/130277
2023-12-21 19:01:16 +00:00
Non Vachara 90badf7050
Add send_text_input_action case to deserialization_factory to allow sendTextInputAction usages through flutter_driver. (#139197)
**As a follow up to https://github.com/flutter/flutter/pull/131776.**

**Summary:**
Previously in https://github.com/flutter/flutter/pull/106561, SendTextInputAction was added to Flutter Driver.
But it still cannot be used from flutter_driver tests. This PR intends to resolve that issue.

**Issue:**
An `DriverError: Unsupported command kind send_text_input_action` would be thrown from `flutter_driver/lib/src/common/deserialization_factory.dart` when a call to `driver.sendTextInputAction(TextInputAction.done);` was made despite the method `sendTextInputAction` is available for use since https://github.com/flutter/flutter/pull/106561.

Previous works has been done in https://github.com/flutter/flutter/pull/131776, I merely added tests.

Best regards.
2023-12-21 17:48:16 +00:00
auto-submit[bot] cb50d4a804
Reverts "[web] Re-enable test now that source of flakiness is fixed" (#140515)
Reverts flutter/flutter#140462
Initiated by: cbracken
This change reverts the following previous change:
Original Description:
The test was flaky before due to overflowing GPU memory during the test. The memory leak was fixed here https://github.com/flutter/engine/pull/49214

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

As a side effect of the fix, this test also runs much faster, from about 3 minutes on my Macbook down to about 25 seconds.
2023-12-21 17:46:16 +00:00
Gustl22 f5ac225c8d
Reland: "Fix how Gradle resolves Android plugin" (#137115)
Relands #97823

When the tool migrated to `.flutter-plugins-dependencies`, the Gradle plugin was never changed.
Until now, the plugin had the heuristic that a plugin with a `android/build.gradle` file supported the Android platform.

Also applies schema of `getPluginDependencies` to `getPluginList` which uses a `List` of Object instead of `Properties`.

Fixes #97729
Cause of the error: 5f105a6ca7/packages/flutter_tools/gradle/flutter.gradle (L421C25-L421C25)

Fixes #98048
The deprecated line `include ":$name"` in `settings.gradle` (pluginEach) in old projects causes the `project.rootProject.findProject` to also find the plugin "project", so it is not failing on the `afterEvaluate` method. But the plugin shouldn't be included in the first place as it fails with `Could not find method implementation() for arguments` error in special cases.

Related to #48918, see [_writeFlutterPluginsListLegacy](27bc1cf61a/packages/flutter_tools/lib/src/flutter_plugins.dart (L248)).

Co-authored-by: Emmanuel Garcia <egarciad@google.com>
2023-12-21 16:55:04 +00:00
Jim Graham 8407dd2d0e
Revert "Integrate testWidgets with leak tracking. (#138057)" (#140502)
The PR is breaking the `flutter_test_performance` test and making the
tree red.
2023-12-21 12:44:58 +01:00
Polina Cherkasova d746007fcd
Integrate testWidgets with leak tracking. (#138057)
Contributes to: https://github.com/flutter/flutter/issues/135856

TODO:
2023-12-21 00:19:59 +00:00
Qun Cheng c0acd8c45f
Fix import pattern (#140425)
This PR is just to fix the import pattern to follow the convention.
2023-12-21 00:18:09 +00:00
flutter-pub-roller-bot 2d75f76b44
Roll pub packages (#140472)
This PR was generated by `flutter update-packages --force-upgrade`.
2023-12-20 22:57:21 +00:00
Michael Goderbauer 68e346e41c
Remove outdated ignores from tool (#140467)
These were not ignoring anything (anymore).
2023-12-20 22:14:32 +00:00
Michael Goderbauer c4fda23393
Remove outdated ignores from framework (#140465)
These were not ignoring anything (anymore).
2023-12-20 22:05:29 +00:00
LongCatIsLooong e2e8bcb1bc
Reland find.textRange.ofSubstring changes (#140469)
Extracted from https://github.com/flutter/flutter/pull/139717 as-is. Landing this change first so we can avoid doing a g3fix.
2023-12-20 22:00:55 +00:00
Reid Baker d6e435a7ac
Part 1/n migration steps for kotlin migration (#140452)
Following https://developer.android.com/build/migrate-to-kotlin-dsl
1/n Add parentheses to method calls 

Should be a no-op change. If you see a behavioral change please flag it.
2023-12-20 20:40:17 +00:00
auto-submit[bot] 9003f13803
Reverts "Make TextSpan hit testing precise." (#140468)
Reverts flutter/flutter#139717
Initiated by: LongCatIsLooong
This change reverts the following previous change:
Original Description:
Fixes https://github.com/flutter/flutter/issues/131435, #104594, #43400
Needs https://github.com/flutter/engine/pull/48774 (to fix the web test failure).

Currently the method we use for text span hit testing `TextPainter.getPositionForOffset` always returns the closest `TextPosition`, even when the given offset is far away from the text. 

The new TextPaintes method tells you the layout bounds (`width =  letterspacing / 2 + x_advance + letterspacing / 2`, `height = font ascent + font descent`) of a character, the PR changes the hit testing implementation such that a TextSpan is only considered hit if the point-down event landed in one of it's character's layout bounds.

Potential issues:

1. In theory since the text is baseline aligned, we should use the max ascent and max descent of each character to calculate the height of the text span's hit-test region, in case some characters in the span have to fall back to a different font, but that will be slower and it typically doesn't make a huge difference. 

This is a breaking change. It also introduces a new finder and a new method `WidgetTester.tapOnText`: `await tester.tapOnText('string to match')` for ease of migration.
2023-12-20 19:32:10 +00:00
Harry Terkelsen 11bfb3c46a
[web] Re-enable test now that source of flakiness is fixed (#140462)
The test was flaky before due to overflowing GPU memory during the test.
The memory leak was fixed here
https://github.com/flutter/engine/pull/49214

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

As a side effect of the fix, this test also runs much faster, from about
3 minutes on my Macbook down to about 25 seconds.

## 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] 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-12-20 11:11:56 -08:00
Bruno Leroux 0d90014bae
_TabBarViewState should not recreate page controller (#135500)
## Description

This PR replaces the unconditional instantiation of `PageController` in `_TabBarViewState.didChangeDependencies` as suggested in https://github.com/flutter/flutter/pull/134091#discussion_r1319177744.

## Related Issue

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

## Tests

Adds 1 test.
2023-12-20 17:04:29 +00:00
Gustl22 da0cd69659
Revert automated changes made to deprecated settings.gradle (plugins.each) (#140037)
Restore testing deprecated settings.gradle (plugins.each).

Updated presumably by accident in #83067

Split from #137115
See also https://github.com/flutter/flutter/pull/137115#issuecomment-1781909865
2023-12-20 15:45:08 +00:00
LongCatIsLooong ea5b97286e
Make TextSpan hit testing precise. (#139717)
Fixes https://github.com/flutter/flutter/issues/131435, #104594, #43400
Needs https://github.com/flutter/engine/pull/48774 (to fix the web test failure).

Currently the method we use for text span hit testing `TextPainter.getPositionForOffset` always returns the closest `TextPosition`, even when the given offset is far away from the text. 

The new TextPaintes method tells you the layout bounds (`width =  letterspacing / 2 + x_advance + letterspacing / 2`, `height = font ascent + font descent`) of a character, the PR changes the hit testing implementation such that a TextSpan is only considered hit if the point-down event landed in one of it's character's layout bounds.

Potential issues:

1. In theory since the text is baseline aligned, we should use the max ascent and max descent of each character to calculate the height of the text span's hit-test region, in case some characters in the span have to fall back to a different font, but that will be slower and it typically doesn't make a huge difference. 

This is a breaking change. It also introduces a new finder and a new method `WidgetTester.tapOnText`: `await tester.tapOnText('string to match')` for ease of migration.
2023-12-20 03:23:29 +00:00
Christopher Fujino ef1227f05d
[flutter_tools] handle FileSystemException trying to delete temp directory from core_devices.dart (#140415)
Fixes https://github.com/flutter/flutter/issues/140416, the top crasher on stable/3.16.4
2023-12-20 00:08:54 +00:00
Fedor Blagodyr 2bb19a9501
Added onEnd callback into AnimatedSize (#139859)
close #106439
2023-12-19 22:59:46 +00:00
Bartek Pacia a1e1dc3f6c
Reland "Warn when Gradle plugins are applied using the legacy apply script method (#140103)
> This PR relands #139690 which was reverted in #140102

This PR adds a deprecation message when Android build is using the legacy "apply script method" way of applying Flutter's Gradle plugins (that is: [`flutter.gradle`](https://github.com/flutter/flutter/blob/3.16.0/packages/flutter_tools/gradle/flutter.gradle) and [`app_plugin_loader.gradle`](https://github.com/flutter/flutter/blob/3.16.0/packages/flutter_tools/gradle/app_plugin_loader.gradle)).

See also:
- #121541
  - in particular https://github.com/flutter/flutter/issues/121541#issuecomment-1836947311
- #135392
  - and PR that add the migration guide: [#9857](https://github.com/flutter/website/pull/9857)

- I think either `logger.error` or `logger.quiet` must be used, because all other error levels are not shown during `flutter build apk` (and that's what most people use).
2023-12-19 16:03:23 +00:00
Polina Cherkasova 6368d65622
Upgrade to version of leak tracker that does not depend on test_widgets. (#140247)
Contributes to: https://github.com/flutter/flutter/issues/135856
2023-12-19 04:28:09 +00:00
Bartek Pacia a4388773bb
SemanticsProperties: default identifier and tooltip to null (#140283)
This PR applies [the suggestion made here](https://github.com/flutter/devtools/pull/6942#issuecomment-1852773200).
2023-12-18 19:38:05 +00:00
Simon Friis Vindum b893884f50
Document difference between softWrap and maxLine (#139363)
This PR fixes #13631 through documentation as suggested in https://github.com/flutter/flutter/issues/13631#issuecomment-354902727.

Since the documentation additions rely on new screenshots this PR will be accompanied by a PR in the assets repository.
2023-12-18 19:09:07 +00:00
raphire08 4659b0c402
refactored cli tool ipa method name to support --export-options-plist (#138555)
This PR changes the way the IPA method is read in the run command for `build ipa` command. If export options plist argument is provided it takes method name from plist, otherwise it uses the method name from export method argument.

*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 [#122179](https://github.com/flutter/flutter/issues/122179)
2023-12-18 08:56:07 +00:00
Bruno Leroux 596d9b6c1a
Center Floating Snackbar with custom width when direction is RTL (#140215)
## Description

This PR fixes the positionning of a floating snackbar when the text direction is RTL.

## Related Issue

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

## Tests

Adds 1 test.
2023-12-16 19:23:11 +00:00
Bartek Pacia 8c02a22403
Use SemanticsUpdateBuilder again, remove all references to temporary SemanticsUpdateBuilderNew (#139942)
This PR removes all usages of the temporary `SemanticsUpdateBuilderNew` API in favor of `SemanticsUpdateBuilder`. These two APIs are the same as of now.

This is mainly targeted at https://github.com/flutter/flutter/issues/17988

Steps:
part 1: [engine] add `SemanticsUpdateBuilderNew` https://github.com/flutter/engine/pull/47961
part 2: [flutter] use `SemanticsUpdateBuilderNew` https://github.com/flutter/flutter/pull/138331
part 3: [engine] update `SemanticsUpdateBuilder` to be the same as `SemanticsUpdateBuilderNew` https://github.com/flutter/engine/pull/48882
**part 4: [flutter] use (now updated) `SemanticsUpdateBuilder` again** <-- we are here
part 5: [engine] remove `SemanticsBuilderNew`
2023-12-16 15:23:24 +00:00
Xilai Zhang c1762215ad
[github actions] minor PR to test latest github actions (#140252)
Minor fix of a typo.

A merged PR on flutter/flutter with a newer base commit is needed to test the latest version of https://github.com/flutter/flutter/blob/master/.github/workflows/easy-cp.yml. (more details in https://github.com/flutter/flutter/pull/140191#issuecomment-1857169933).

This PR has a base commit that includes the latest updates to easy-cp.yml, and would be a good candidate for testing purposes when merged
2023-12-16 03:31:21 +00:00
Polina Cherkasova baf739c8e6
Remove usage of testWidgetsWithLeakTracking. (#140239) 2023-12-15 14:13:31 -08:00
Elias Yishak d180c12705
Use new enabledFeature param for Analytics (#139934)
Related to tracker issue:
- https://github.com/flutter/flutter/issues/128251

This updates the `Analytics` constructor to provide it with the enabled features for the flutter-tool. This will be sent with each event for the flutter-tool.
2023-12-15 19:58:05 +00:00
Polina Cherkasova bda158adf0
Reorganize dependencies on leak_tracker. (#140233)
1. Move leak_tracker and leak_tracker_testing out of direct dependencies.
2. Move leak_tracker_flutter_testing from dev to prod dependencies for flutter_test

It is prerequisite for https://github.com/flutter/flutter/issues/135856
2023-12-15 19:33:23 +00:00
Chris Bracken d0670f0591
[macOS,iOS] CocoaPods recommended version: 1.13.0 (#135447)
Due to changes in Xcode 15, several variables such as `DT_TOOLCHAIN_DIR`
have been eliminateed in favour of others such as `TOOLCHAIN_DIR`. This
broke CocoaPods support under Xcode 15, as reported in:
https://github.com/CocoaPods/CocoaPods/issues/12012

@vashworth worked around this in Flutter in:
https://github.com/flutter/flutter/pull/132803

The CocoaPods issue was resolved by the following PR to their repo:
https://github.com/CocoaPods/CocoaPods/pull/12009
and was released in CocoaPods 1.13.0.

Also switches from an if-else chain to a switch for CocoaPodsStatus
handling.

Related: https://github.com/flutter/flutter/issues/133584
Related: https://github.com/flutter/flutter/issues/132755

## 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] 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: Greg Spencer <gspencergoog@users.noreply.github.com>
2023-12-15 11:16:52 -08:00
Srujan Gaddam 2407f699e9
Move package:web dependency to dev dependency (#139696)
Pinning the package:web dependency constrains downstream packages from
using newer versions and making sure they support the version pinned in
Flutter. Since the usage of package:web in Flutter is light, we should
instead have a small shim like the engine and keep package:web as a dev
dependency only.
2023-12-15 08:53:27 -08:00
Polina Cherkasova 6a85684877
Increase versions of leak tracker libraries. (#140018)
Contributes to https://github.com/flutter/flutter/issues/135856
2023-12-15 05:18:23 +00:00
Mitchell Goodwin f0051d8b12
Cupertino text clear label (#129727)
Fixes #123107

Adds a customizable semantic label so that the clear button on the Cupertino text field will be picked up by screen readers.

https://github.com/flutter/flutter/assets/58190796/de31d9dd-923c-402f-a55b-e5cc77ea68bb
2023-12-15 04:55:55 +00:00
lsaudon 703ae77882
feat: Add onTapAlwaysCalled in TextFormField (#140089)
Add onTapAlwaysCalled in TextFormField

*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.*

*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-12-14 23:05:54 +00:00
yim 4752b8638a
fix reorderable_list drop animation (#139362)
This PR fixes reorderable_list drop animation.

Fixes #138994
2023-12-14 22:05:06 +00:00
Shashi cf3ed1ee17
Fix BottomNavigationBarItem label overflow (#120206)
This PR wraps the `label` with `IntrinsicWidth` and then `Flexible` which allows DefaulTextStyle `TextOverflow.ellipsis` to work. Wrapping `label` directly with `Flexible` brings more space between `icon` and `label`. `IntrinsicWidth` fixes this by giving reasonable width.

Fixes #112163
2023-12-14 21:31:51 +00:00
Lau Ching Jun d24c01bd0c
Revert "Dynamic view sizing" (#140165)
Reverts flutter/flutter#138648

This caused the app to be stuck in the splash screen on certain phone models.

Context: b/316244317
2023-12-14 19:42:06 +00:00
Akito Nishiyama f8ddd4b653
🎨: fix cupertionActionSheet design (#134345)
## Overview
Fixed the implementation of CupertionActionSheet based on [Apple Design Resource](https://www.figma.com/community/file/1248375255495415511).
I also deleted devicePixelRatio because Flutter uses logical pixels based on https://api.flutter.dev/flutter/dart-ui/FlutterView/devicePixelRatio.html.

ISSUE: #134539 

UPDATED GOLDEN: https://flutter-gold.skia.org/search?issue=134345&crs=github&patchsets=3&corpus=flutter

### Before
<img src="https://github.com/flutter/flutter/assets/40790076/8492fe5f-582f-4623-86eb-c60cb88d81a1" width=300>

### After
<img src="https://github.com/flutter/flutter/assets/40790076/fcdd7f7e-6ab5-4b68-a7b0-27a6fc2975b8" width=300>
2023-12-14 18:40:59 +00:00
Gustl22 fc77dd90d4
Adapt wording for required Android SDK for plugins (#140043)
Solves https://github.com/flutter/flutter/pull/137115#discussion_r1388251047
2023-12-14 05:45:15 +00:00
Andrew Kolos 935775cb74
[reland] Support conditional bundling of assets based on --flavor (#139834)
Reland of https://github.com/flutter/flutter/pull/132985. Fixes the path to AssetManifest.bin in flavors_test_ios
2023-12-14 05:30:10 +00:00
Daco Harkes 3b370c8539
[deps] update Android SDK to 34 (#138183)
Update Android SDK from 33 to 34.

Following the engine update:

* https://github.com/flutter/engine/pull/47839
2023-12-14 00:55:57 +00:00
LongCatIsLooong f2c6f03ca3
Catch Stopwatch with static analysis (#140019)
I did not include the `'// flutter_ignore_for_file: stopwatch (see analyze.dart)'` directive since it's currently not used, and adding that shouldn't be too difficult.
2023-12-14 00:31:49 +00:00
Michael Goderbauer 4162272592
Overlay supports unconstrained environments (#139513)
Fixes https://github.com/flutter/flutter/issues/137875.

Unfortunately, we cannot auto-detect which OverlayEntry should be sizing the Overlay in unconstrained environment. So, this PR adds a special flag to annotate the Overlay Entry that should be used.
2023-12-14 00:19:45 +00:00
Renzo Olivares 5be1918b67
Remove deprecated ThemeData.selectedRowColor (#139080)
Part of: https://github.com/flutter/flutter/issues/139243
2023-12-14 00:11:34 +00:00
Lau Ching Jun c1caa24aa4
Optimize file transfer when using proxied devices. (#139968)
List of changes:
1. Optimizations in FileTransfer. a. Use `stream.forEach` instead of `await for`. b. Type cast `List<int>` to `Uint8List` instead of using `Uint8List.fromList` results in (presumably) fewer copy and faster execution. c. Iterate through `Uint8List` with regular for loop instead of for-in loop.
2. Precache the block hashes of a file, and reuse it on subsequent runs.
2023-12-14 00:11:32 +00:00
hgraceb a9c40a2a8d
Add commonly used parameter names (#140027)
## Description

Similar to #119877, but with more cases that I could find in `packages/flutter`. 

Although there is already a [proposal](https://github.com/dart-lang/linter/issues/4102), it is uncertain how long it will take to be implemented.

![[image-20200711205959042](https://user-images.githubusercontent.com/72788825/216486897-b56453d2-b309-47ea-885b-b0ec6ed1b648.png)](https://user-images.githubusercontent.com/72788825/216486897-b56453d2-b309-47ea-885b-b0ec6ed1b648.png)
2023-12-14 00:11:30 +00:00
Reid Baker 3c80cc7eb9
Do not use project in do last (#139325)
- Use copy task that branches for 8.3 and above to avoid using project.exec in a dolast block. 

part 1/n for flutter/flutter/issues/138523 

This PR does not test the 8.3 branch but instead builds the ability to write a branching gradle test. 
After fixing this project.exec action there I discovered a second that needs to be removed or migrated in order for the build to work. 

Related reading https://docs.gradle.org/8.0/userguide/configuration_cache.html#config_cache:requirements
https://docs.gradle.org/current/javadoc/org/gradle/process/ExecOperations.html (not used but considered) 
https://docs.gradle.org/8.2/dsl/org.gradle.api.tasks.Copy.html#org.gradle.api.tasks.Copy:fileMode
2023-12-13 23:47:58 +00:00
auto-submit[bot] 625bc50c39
Reverts "Warn when Gradle plugins are applied using the legacy "apply script method" way" (#140102)
Reverts flutter/flutter#139690
Initiated by: hellohuanlin
This change reverts the following previous change:
Original Description:
This PR adds a deprecation message when Android build is using the legacy "apply script method" way of applying Flutter's Gradle plugins (that is: [`flutter.gradle`](https://github.com/flutter/flutter/blob/3.16.0/packages/flutter_tools/gradle/flutter.gradle) and [`app_plugin_loader.gradle`](https://github.com/flutter/flutter/blob/3.16.0/packages/flutter_tools/gradle/app_plugin_loader.gradle)).

See also:
- #121541
  - in particular https://github.com/flutter/flutter/issues/121541#issuecomment-1836947311
- #135392
  - and PR that add the migration guide: [#9857](https://github.com/flutter/website/pull/9857)

- I think either `logger.error` or `logger.quiet` must be used, because all other error levels are not shown during `flutter build apk` (and that's what most people use).
2023-12-13 23:08:25 +00:00
Mitchell Goodwin c781302643
Swap iOS back button icon in Material app bar (#134754)
Fixes #128555.

Changes the back icon for the Material app bar when running on Apple devices from `arrow_back_ios` to `arrow_back_ios_new_rounded`, as the old version of the icon wasn't centered (https://github.com/google/material-design-icons/issues/824) and the native back icon, as well as the one in Cupertino, are rounded.

| Before | After |
| ------------- | ------------- |
| <img width="295" alt="Screenshot 2023-09-14 at 11 24 10 AM" src="https://github.com/flutter/flutter/assets/58190796/242e5fae-1107-4e1d-9749-a988462e7767"> | <img width="285" alt="Screenshot 2023-09-14 at 11 23 50 AM" src="https://github.com/flutter/flutter/assets/58190796/4df1ecaa-4313-4eb3-9cf3-335a777e133f"> |

New icon works as expected with RTL:

<img width="283" alt="Screenshot 2023-09-14 at 10 57 34 AM" src="https://github.com/flutter/flutter/assets/58190796/ae92fb35-40fd-4ee0-be60-cd452f16b2e3">
2023-12-13 20:59:00 +00:00
Bartek Pacia 4aef59befb
Warn when Gradle plugins are applied using the legacy "apply script method" way (#139690)
This PR adds a deprecation message when Android build is using the legacy "apply script method" way of applying Flutter's Gradle plugins (that is: [`flutter.gradle`](https://github.com/flutter/flutter/blob/3.16.0/packages/flutter_tools/gradle/flutter.gradle) and [`app_plugin_loader.gradle`](https://github.com/flutter/flutter/blob/3.16.0/packages/flutter_tools/gradle/app_plugin_loader.gradle)).

See also:
- #121541
  - in particular https://github.com/flutter/flutter/issues/121541#issuecomment-1836947311
- #135392
  - and PR that add the migration guide: [#9857](https://github.com/flutter/website/pull/9857)

- I think either `logger.error` or `logger.quiet` must be used, because all other error levels are not shown during `flutter build apk` (and that's what most people use).
2023-12-13 20:45:56 +00:00
auto-submit[bot] 91877c6345
Reverts "Make tests more resilient to Skia gold failures and refactor flutter_goldens for extensive technical debt removal" (#140085)
Reverts flutter/flutter#139549
Initiated by: Piinks
This change reverts the following previous change:
Original Description:
* Remove all use of global variables.
* Always pass in all dependencies, only create them in main or in tests.
* Pass in the "print" primitive.
* Make all network traffic retry (except when run locally, when it just auto-passes).
* Enable tests to be run in random order.
2023-12-13 20:20:20 +00:00
Ian Hickson 11a9cb7029
Make tests more resilient to Skia gold failures and refactor flutter_goldens for extensive technical debt removal (#139549)
* Remove all use of global variables.
* Always pass in all dependencies, only create them in main or in tests.
* Pass in the "print" primitive.
* Make all network traffic retry (except when run locally, when it just auto-passes).
* Enable tests to be run in random order.
2023-12-13 04:09:13 +00:00
Gray Mackall 9a72e1c699
Allow plugins to use compileSdkPreview (#131901)
Fixes https://github.com/flutter/flutter/issues/124748

Based (heavily) off https://github.com/flutter/flutter/pull/104662
2023-12-12 20:06:04 +00:00
Tirth 87b8bf646f
[Docs] Added missing CupertinoApp.showSemanticsDebugger (#139913)
Added missing reference to `CupertinoApp.showSemanticsDebugger`.

Fixes #139897
2023-12-12 17:39:31 +00:00
flutter-pub-roller-bot e278279a48
Roll pub packages (#139969)
This PR was generated by `flutter update-packages --force-upgrade`.
2023-12-12 10:12:26 +00:00
Greg Spencer 49be0586fb
Fix dayPeriodColor handling of non-MaterialStateColors (#139845)
## Description

This fixes the handling of `dayPeriodColor` on the `TimePicker` so that if it's a non-`MaterialStateColor`, it only applies the color to the selected state, but otherwise uses the given `MaterialStateColor` to get custom behavior.

## Related Issues
 - Fixes https://github.com/flutter/flutter/issues/139445

## Tests
 - Added tests for both non-`MaterialStateColor` and `MaterialStateColor` cases.
2023-12-12 01:51:13 +00:00
Christopher Fujino fac41dde7f
[flutter_tools] catch SocketException writing to ios-deploy stdin (#139784)
Fixes https://github.com/flutter/flutter/issues/139709

This adds a static helper method `ProcessUtils.writelnToStdinGuarded()`, which will asynchronously write to a sub-process's STDIN `IOSink` and catch errors.

In talking with Brian, it sounds like this is the best and most reliable way to catch `SocketException`s during these writes *to sub-process file descriptors* specifically (with a "real" hard drive file, the future returned by `.flush()` should complete with the write error).

Also, as I note in the dartdoc to `writelnToStdinGuarded()`, the behavior seems to be different between macOS and linux.

Moving forward, in any place where we want to catch exceptions writing to STDIN, we will want to use this new helper.
2023-12-12 00:32:18 +00:00
Tim Maffett 2b3a16b459
fix typo of 'not' instead of 'now' for useInheritedMediaQuery (#139940)
The doc comment for `useInheritedMediaQuery` has a typo of 'not' instead of 'now' and it is confusing at the `@Deprecated()` message clearly states it is *now* ignored.
(and indeed checking the code you can verify that it *is* indeed ignored)

existing code before PR:
```dart
/// {@template flutter.widgets.widgetsApp.useInheritedMediaQuery}
/// Deprecated. This setting is not ignored.
///                             ^^^
/// The widget never introduces its own [MediaQuery]; the [View] widget takes
/// care of that.
/// {@endtemplate}
@Deprecated(
  'This setting is now ignored. '
  'WidgetsApp never introduces its own MediaQuery; the View widget takes care of that. '
  'This feature was deprecated after v3.7.0-29.0.pre.'
)
final bool useInheritedMediaQuery;
```

- [X ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
2023-12-11 23:11:10 +00:00
Nate 140f5eef4c
Implement switch expressions in examples/ and animation/ (#139882)
Thanks so much for approving the previous PR (#139048) a couple weeks ago!

This one is the same, except it's covering files in `examples/` and `packages/flutter/lib/src/animation/`.

(solving issue #136139)
2023-12-11 22:56:04 +00:00
Greg Spencer a33dec1a27
Deprecate RawKeyEvent, RawKeyboard, et al. (#136677)
## Description

This starts the deprecation of the `RawKeyEvent`/`RawKeyboard` event system that has been replaced by the `KeyEvent`/`HardwareKeyboard` event system.

Migration guide is available here: https://docs.flutter.dev/release/breaking-changes/key-event-migration

## Related Issues
 - https://github.com/flutter/flutter/issues/136419

## Related PRs
 - https://github.com/flutter/website/pull/9889
2023-12-11 22:19:18 +00:00
Renzo Olivares f60e54b24c
Fix SelectionArea select-word edge cases (#136920)
This change fixes issues with screen order comparison logic when rects are encompassed within each other. This was causing issues when trying to select text that includes inline `WidgetSpan`s inside of a `SelectionArea`.

* Adds `boundingBoxes` to `Selectable` for a more precise hit testing region.

Fixes #132821
Fixes updating selection edge by word boundary when widget spans are involved.
Fixes crash when sending select word selection event to an unselectable element.
2023-12-11 21:32:55 +00:00
LongCatIsLooong aa609127e7
Use dart analyze package for num.clamp (#139867)
Extacted from #130101, dropped the `@_debugAssert` stuff from that PR so it's easier to review.
2023-12-11 20:25:26 +00:00
flutter-pub-roller-bot 44beb843aa
Roll pub packages (#139926)
This PR was generated by `flutter update-packages --force-upgrade`.
2023-12-11 18:35:25 +00:00