Commit graph

23093 commits

Author SHA1 Message Date
Kate Lovett 6d7922f3f5
Fix SliverMainAxisGroup layout in reverse (#145572)
Fixes https://github.com/flutter/flutter/issues/145068

The original tests for SliverMainAxisGroup did not actually check where the child was painted (#126596).

Followed the same pattern in RenderSliverMultiBoxAdaptor:

11c034f037/packages/flutter/lib/src/rendering/sliver_multi_box_adaptor.dart (L666)
2024-04-01 19:06:07 +00:00
Dimil Kalathiya a187cc7255
Fixes some gesture recognizers are not disposed. (#146072) 2024-04-01 09:50:59 -07:00
Bartek Pacia ec82f0d895
Flutter Gradle Plugin: add versionName and versionCode to FlutterExtension (#146044)
This PR is a follow-up of a previous PR of mine:
https://github.com/flutter/flutter/pull/141417. It was unfinished, i.e.
I only implemented it and used it in `examples/hello_world`. No "flutter
create" templates were modified.

This change is theoretically breaking, but in practice, I am pretty sure
nobody uses this. It was not accounced anywhere, the only app using it
is `examples/hello_world`. I did not do that (that=update docs and
templates) because I wanted a solution that is idiomatic in both Gradle
and Kotlin, and only now I found time to do this.

### Without this change

```groovy
defaultConfig {
    applicationId = "io.flutter.examples.hello_world"
    minSdk = flutter.minSdkVersion
    targetSdk = flutter.targetSdkVersion
    versionCode = flutter.versionCode()
    versionName = flutter.versionName()
}
```

### With this change

```groovy
defaultConfig {
    applicationId = "io.flutter.examples.hello_world"
    minSdk = flutter.minSdkVersion
    targetSdk = flutter.targetSdkVersion
    versionCode = flutter.versionCode
    versionName = flutter.versionName
}
```

Idiomatic getter - yay! It's consistent between assignment of all four
props.

### Issue

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

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

---------

Co-authored-by: Reid Baker <reidbaker@google.com>
2024-04-01 18:09:13 +02:00
Taha Tesser e85340e1e4
Deprecate ButtonBar, ButtonBarThemeData, and ThemeData.buttonBarTheme (#145523)
fixes [Deprecate `ButtonBar`](https://github.com/flutter/flutter/issues/127955)

### Code sample

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

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        buttonBarTheme: const ButtonBarThemeData(
          alignment: MainAxisAlignment.spaceEvenly,
        ),
      ),
      home: Scaffold(
        body: ButtonBar(
          alignment: MainAxisAlignment.spaceEvenly,
          children: <Widget>[
            TextButton(
              onPressed: () {},
              child: const Text('Button 1'),
            ),
            TextButton(
              onPressed: () {},
              child: const Text('Button 2'),
            ),
            TextButton(
              onPressed: () {},
              child: const Text('Button 3'),
            ),
          ],
        ),
      ),
    );
  }
}
```

</details>

## Data driven fix

### Before executing `dart fix --apply`
```dart
  return MaterialApp(
      theme: ThemeData(
        buttonBarTheme: const ButtonBarThemeData(
          alignment: MainAxisAlignment.spaceEvenly,
        ),
      ),
      home: Scaffold(
        body: ButtonBar(
          alignment: MainAxisAlignment.spaceEvenly,
          children: <Widget>[
            TextButton(
              onPressed: () {},
              child: const Text('Button 1'),
            ),
            TextButton(
              onPressed: () {},
              child: const Text('Button 2'),
            ),
            TextButton(
              onPressed: () {},
              child: const Text('Button 3'),
            ),
          ],
        ),
      ),
    );
```

### After executing `dart fix --apply`
```dart
    return MaterialApp(
      theme: ThemeData(

      ),
      home: Scaffold(
        body: OverflowBar(
          alignment: MainAxisAlignment.spaceEvenly,
          children: <Widget>[
            TextButton(
              onPressed: () {},
              child: const Text('Button 1'),
            ),
            TextButton(
              onPressed: () {},
              child: const Text('Button 2'),
            ),
            TextButton(
              onPressed: () {},
              child: const Text('Button 3'),
            ),
          ],
        ),
      ),
    );
```
2024-04-01 11:39:48 +00:00
Taha Tesser 40dda2b4bb
Add DataColumn.headingRowAlignment for DataTable (#144006)
fixes [[`DataTable`]  Unable to center the label of a DataColumn without side effects](https://github.com/flutter/flutter/issues/143340)

### 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: MaterialApp(
        home: Material(
          child: DataTable(
            columns: <DataColumn>[
              DataColumn(
                headingRowAlignment: MainAxisAlignment.center,
                onSort: (int columnIndex, bool ascending) {},
                label: const Text('Header'),
              ),
            ],
            sortColumnIndex: 0,
            rows: const <DataRow>[
              DataRow(
                cells: <DataCell>[
                  DataCell(Center(child: Text('Data'))),
                ],
              ),
            ],
          ),
        ),
      ),
    );
  }
}
```

</details>

### Center `DataColumn.mainAxisAlignment` without sort arrow
![Screenshot 2024-03-25 at 17 13 05](https://github.com/flutter/flutter/assets/48603081/0c91d279-23e8-40d9-ab86-c08013c73666)

### Center `DataColumn.mainAxisAlignment` with sort arrow

![Screenshot 2024-03-25 at 17 11 54](https://github.com/flutter/flutter/assets/48603081/d042d02a-e7be-4f47-a90c-8a1ee0f7f5f3)
2024-04-01 09:42:51 +00:00
LongCatIsLooong ff284c51bd
Implement computeDryBaseline for cupertino RenderBoxes (#145951)
The `_debugVerifyDryBaselines` method verifies that dry baseline implementation is consistent with the wet baseline method at the current constraints.
2024-03-30 21:38:24 +00:00
Nate a17d4b34f0
Implementing switch expressions in flutter_tools/ (#145632)
This pull request is step 12 in the journey to make this entire repository more readable.

(previous PRs: #139048, #139882, #141591, #142279, #142634, #142793, #143293, #143496, #143634, #143812, #144580)

We're getting close to the end! 😄
2024-03-29 22:31:19 +00:00
Ian Hickson 887bdcfb6b
Add flutter_goldens README (#145278)
This is part 5 of a broken down version of the #140101 refactor.

This PR adds a README to flutter_goldens with breadcrumbs to other sources of documentation.
2024-03-29 21:20:58 +00:00
Ian Hickson 16ec1a8434
Remove state shared across tests (#145281)
This is part 6 of a broken down version of the #140101 refactor.

This change tries to be as minimal as possible to make review as easy as possible. We can further simplify this file in future PRs. This change allows us to re-enable test order randomization for these tests.
2024-03-29 21:19:47 +00:00
Bruno Leroux 49183c256c
InputDecorator M3 tests migration - Step7 - container (#145583)
## Description

This PRs adds a test group for the input decorator container, this group is organised similarly to the M3 spec, see https://m3.material.io/components/text-fields/specs.

It is step 7 for the M3 test migration for `InputDecorator`.
Step 1: https://github.com/flutter/flutter/pull/142981
Step 2: https://github.com/flutter/flutter/pull/143369
Step 3: https://github.com/flutter/flutter/pull/143520
Step 4: https://github.com/flutter/flutter/pull/144169
Step 5: https://github.com/flutter/flutter/pull/144932
Step 6: https://github.com/flutter/flutter/pull/145213

## Related Issue

Related to https://github.com/flutter/flutter/issues/139076

@justinmc The diff is not very readable. The tests added by this PR are from line 298 to line 975. Other changes are due to moving some existing tests to this new 'container' group.
2024-03-29 20:48:49 +00:00
Polina Cherkasova bca1d6ad1f
Upgrade leak_tracker. (#145997) 2024-03-29 12:31:52 -07:00
Gray Mackall 85288818b5
Remove trailing commas in android dependency version checking gradle plugin (#145718)
Apparently old versions of kotlin (pre 1.4) don't allow trailing commas.

Example logs: https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8752506486861217537/+/u/Run_package_tests/build_all_packages_for_Android_-_legacy_version/stdout
2024-03-29 16:31:06 +00:00
Polina Cherkasova 1a2f34ab5b
Upgrade leak_tracker. (#145940) 2024-03-29 02:39:17 +00:00
Gray Mackall 0984a7f04b
Point kotlin message in gradle_errors.dart towards new place where templates define the kotlin version (#145936)
Fixes https://github.com/flutter/flutter/issues/144454

For reference, after formatting it looks like:
```
┌─ Flutter Fix ──────────────────────────────────────────────────────────────────────────────────────────┐
│ [!] Your project requires a newer version of the Kotlin Gradle plugin.                                 │
│ Find the latest version on https://kotlinlang.org/docs/releases.html#release-details, then update the  │
│ version number of the plugin with id "org.jetbrains.kotlin.android" in the plugins block of            │
│ /Users/mackall/development/BugTesting/ELIMINATEME/blah/android/settings.gradle.                        │
│                                                                                                        │
│ Alternatively (if your project was created before Flutter 3.19), update                                │
│ /Users/mackall/development/BugTesting/ELIMINATEME/blah/android/build.gradle                            │
│ ext.kotlin_version = '<latest-version>'                                                                │
└────────────────────────────────────────────────────────────────────────────────────────────────────────┘
```
2024-03-29 00:31:01 +00:00
LongCatIsLooong 460a5e22bd
RenderFlex baseline intrinsics (#145483)
Implements `RenderFlex` intrinsics calculation when children are baseline aligned in the cross axis.
2024-03-28 23:07:06 +00:00
Qun Cheng ea1268a78d
Update tokens to v2.3.5 (#145356)
* Updated the Material Design tokens to v2.3.5
* Linear and circular progress indicator token sets are deprecated in v0.207. The `md.com.progress-indicator` token set was created and should be used instead.
* tokens is now using [semantic versioning](https://semver.org/) (Thanks @guidezpl for reminding:) )
* ~Fixes #128877. The default text style is updated to `bodyLarge` now:)~ Added TODOs for the label text style of `PopupMenuButton`. Will create a separate PR because this change breaks Google testing.
2024-03-28 22:22:20 +00:00
Taha Tesser 0bcd228e67
Update TabBar and TabBar.secondary to use indicator height/color M3 tokens (#145753)
fixes [Secondary `TabBar` indicator height token is missing ](https://github.com/flutter/flutter/issues/124965)

### 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: DefaultTabController(
        length: 2,
        child: Scaffold(
          appBar: AppBar(
            title: const Text('Sample'),
            bottom: const TabBar.secondary(
              tabs: <Widget>[
                Tab(icon: Icon(Icons.directions_car)),
                Tab(icon: Icon(Icons.directions_transit)),
              ],
            ),
          ),
          floatingActionButton: FloatingActionButton(
            onPressed: () {},
            child: const Icon(Icons.add),
          ),
        ),
      ),
    );
  }
}
```

</details>
2024-03-28 17:56:09 +00:00
Mouad Debbar 42988d1b0d
Add viewId to TextInputConfiguration (#145708)
In order for text fields to work correctly in multi-view on the web, we need to have the `viewId` information sent to the engine (`TextInput.setClient`). And while the text field is active, if it somehow moves to a new `View`, we need to inform the engine about such change (`TextInput.updateConfig`).

Engine PR: https://github.com/flutter/engine/pull/51099
Fixes https://github.com/flutter/flutter/issues/137344
2024-03-28 17:09:53 +00:00
Renzo Olivares f5b65bad0f
Remove deprecated TextTheme members (#139255)
Part of: https://github.com/flutter/flutter/issues/143956
2024-03-28 01:20:55 +00:00
maRci002 2079f34962
[WIP] Predictive back support for routes (#141373)
A new page transition, PredictiveBackPageTransitionsBuilder, which handles predictive back gestures on Android (where supported).
2024-03-27 16:43:10 -07:00
godofredoc 1c8b378ffb
Update localization files. (#145780)
Update the localization files to be used in the upcoming stable release.
2024-03-27 02:33:05 +00:00
David Iglesias 9786682492
[web] Add BackgroundIsolateBinaryMessenger.ensureInitialized to web. (#145786)
This PR makes the static API of the `BackgroundIsolateBinaryMessenger` consistent between its web and IO implementations.

This way, multi-platform applications will compile for the web when using the `ensureInitialized` method (even though it'll throw at runtime, like the `instance` getter, because isolates are not supported on the web).

### Issues

* Fixes: https://github.com/flutter/flutter/issues/145260
2024-03-26 23:51:23 +00:00
Christopher Fujino 385bec0abb
Roll pub packages and regenerate gradle lockfiles (#145727)
Example failing devicelab build https://ci.chromium.org/ui/p/flutter/builders/prod/Linux_pixel_7pro%20platform_views_scroll_perf__timeline_summary/2980/overview

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

Supercedes https://github.com/flutter/flutter/pull/145564
2024-03-26 22:07:06 +00:00
Lipu e5e70b069a
Correct typo: "Free" to "Three" in comments (#145689)
*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-03-26 20:25:00 +00:00
Taha Tesser d2c8552944
Fix disabled DropdownMenu doesn't defer the mouse cursor (#145686)
fixes [DropdownMenu cursor in disabled state](https://github.com/flutter/flutter/issues/144611)

This was added in https://github.com/flutter/flutter/pull/121353

### 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: Center(
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: <Widget>[
              const Spacer(),
              const Text('enabled: true,\nrequestFocusOnTap: true,'),
              const SizedBox(height: 16),
              DropdownMenu<String>(
                enabled: true,
                initialSelection: 'First',
                requestFocusOnTap: true,
                width: 200,
                dropdownMenuEntries: ['First', 'Second', 'Third']
                    .map((e) => DropdownMenuEntry(value: e, label: e))
                    .toList(),
              ),
              const Text('Expected: text cursor'),
              const Spacer(),
              const Text('enabled: true,\nrequestFocusOnTap: false,'),
              const SizedBox(height: 16),
              DropdownMenu<String>(
                enabled: true,
                initialSelection: 'First',
                requestFocusOnTap: false,
                width: 200,
                dropdownMenuEntries: ['First', 'Second', 'Third']
                    .map((e) => DropdownMenuEntry(value: e, label: e))
                    .toList(),
                // label: const Text('requestFocusOnTap: false'),
              ),
              const Text('Expected: clickable cursor'),
              const Spacer(),
              const Text('enabled: false,\nrequestFocusOnTap: true,'),
              const SizedBox(height: 16),
              DropdownMenu<String>(
                enabled: false,
                initialSelection: 'First',
                requestFocusOnTap: true,
                width: 200,
                dropdownMenuEntries: ['First', 'Second', 'Third']
                    .map((e) => DropdownMenuEntry(value: e, label: e))
                    .toList(),
              ),
              const Text('Expected: deferred cursor'),
              const Spacer(),
              const Text('enabled: false,\nrequestFocusOnTap: false,'),
              const SizedBox(height: 16),
              DropdownMenu<String>(
                enabled: false,
                initialSelection: 'First',
                requestFocusOnTap: false,
                width: 200,
                dropdownMenuEntries: ['First', 'Second', 'Third']
                    .map((e) => DropdownMenuEntry(value: e, label: e))
                    .toList(),
              ),
              const Text('Expected: deferred cursor'),
              const Spacer(),
            ],
          ),
        ),
      ),
    );
  }
}
```

</details>

### Preview
![Screenshot 2024-03-25 at 14 52 31](https://github.com/flutter/flutter/assets/48603081/cf4361a5-d3bb-4635-9825-5eefa4efe6cc)
2024-03-26 20:15:48 +00:00
Kostia Sokolovskyi 94c63f825f
Memory leaks clean up 2 (#145757) 2024-03-26 12:22:57 -07:00
Kostia Sokolovskyi 8953ba658f
Fix memory leak in Overlay.wrap. (#145744) 2024-03-26 12:21:21 -07:00
Jackson Gardner 158328921d
Be tolerant of backticks around directory name in pub output. (#145768)
This fixes https://github.com/flutter/flutter/issues/145766

The output of the pub command changed slightly with this change: https://dart.googlesource.com/pub/+/2179b765aa9071386be02d408b3c3caa82af98f5

Update the tests to be tolerant of the directory path being surrounded by backticks (or not) so that we are compatible with the current and upcoming implementation.
2024-03-26 19:04:52 +00:00
Taha Tesser 81f969e807
Fix ExpansionTile Expanded/Collapsed announcement is interrupted by VoiceOver (#143936)
fixes [`ExpansionTile` accessibility information doesn't read Expanded/Collapsed (iOS)](https://github.com/flutter/flutter/issues/132264)

### 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(
        appBar: AppBar(
          title: const Text('ExpansionTile'),
        ),
        body: const ExpansionTile(
          title: Text("Title"),
          children: <Widget>[
            Placeholder(),
          ],
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: () {},
          child: const Icon(Icons.add),
        ),
      ),
    );
  }
}
```

</details>

### Before

https://github.com/flutter/flutter/assets/48603081/542d8392-52dc-4319-92ba-215a7164db49

### After

https://github.com/flutter/flutter/assets/48603081/c9225144-4c12-4e92-bc41-4ff82b370ad7
2024-03-26 18:36:09 +00:00
Kevin Moore 388f3217e4
[flutter_tools] Enable WebAssembly compilation everywhere, remove feature flag (#145562) 2024-03-26 18:23:49 +00:00
Taha Tesser 8363e78280
Fix SearchAnchor triggers unnecessary suggestions builder calls (#143443)
fixes [`SearchAnchor` triggers extra search operations](https://github.com/flutter/flutter/issues/139880)

### Code sample

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

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

Future<List<String>> createFuture() async {
  return List.generate(1000, (index) => "Hello World!");
}

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

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Flutter Demo',
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final SearchController controller = SearchController();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            SearchAnchor(
              searchController: controller,
              suggestionsBuilder: (suggestionsContext, controller) {
                final resultFuture = createFuture();
                return [
                  FutureBuilder(
                    future: resultFuture,
                    builder: ((context, snapshot) {
                      if (snapshot.connectionState != ConnectionState.done) {
                        return const LinearProgressIndicator();
                      }
                      final result = snapshot.data;
                      if (result == null) {
                        return const LinearProgressIndicator();
                      }
                      return ListView.builder(
                        shrinkWrap: true,
                        physics: const NeverScrollableScrollPhysics(),
                        itemCount: result.length,
                        itemBuilder: (BuildContext context, int index) {
                          final root = result[index];
                          return ListTile(
                            leading: const Icon(Icons.article),
                            title: Text(root),
                            subtitle: Text(
                              root,
                              overflow: TextOverflow.ellipsis,
                              style: TextStyle(
                                color: Theme.of(suggestionsContext)
                                    .colorScheme
                                    .onSurfaceVariant,
                              ),
                            ),
                            onTap: () {},
                          );
                        },
                      );
                    }),
                  ),
                ];
              },
              builder: (BuildContext context, SearchController controller) {
                return IconButton(
                  onPressed: () {
                    controller.openView();
                  },
                  icon: const Icon(Icons.search),
                );
              },
            ),
          ],
        ),
      ),
    );
  }
}

```

</details>

### Before

https://github.com/flutter/flutter/assets/48603081/69f6dfdc-9f92-4d2e-8a3e-984fce25f9e4

### After

https://github.com/flutter/flutter/assets/48603081/be105e2c-51d8-4cb0-a75b-f5f41d948e5e
2024-03-25 22:58:11 +00:00
Taha Tesser 5e19b33534
Fix vertical Stepper draws connector on the last step (#145703)
fixes [Vertical stepper shows line after last step](https://github.com/flutter/flutter/issues/144376)

### 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: Center(
          child: Stepper(
            currentStep: 1,
            steps: const <Step>[
              Step(
                title: Text("Step 1"),
                content: Text("Content 1"),
              ),
              Step(
                title: Text("Step 2"),
                content: Text("Content 2"),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
```

</details>

### Before

![Screenshot 2024-03-25 at 18 36 32](https://github.com/flutter/flutter/assets/48603081/af859a88-7ec8-4432-8eec-f8eb72706b57)

### After
![Screenshot 2024-03-25 at 18 36 24](https://github.com/flutter/flutter/assets/48603081/994325b2-4bd4-44ef-9473-245d3492faf7)
2024-03-25 21:47:05 +00:00
Kenzie Davisson 31f4f2b6c0
Add a --print-dtd flag to print the DTD address served by DevTools server (#144272) 2024-03-25 13:04:18 -07:00
Ikko Eltociear Ashimine 9fa731ddf8
Update semantics.dart (#145683)
loosing -> losing
2024-03-25 18:17:54 +00:00
Kostia Sokolovskyi 453a04d9f3
TwoDimensionalChildDelegate should dispatch creation and disposal events (#145684) 2024-03-25 10:45:02 -07:00
Kostia Sokolovskyi 47bfa827ba
Memory leaks clean up 1 (#145691) 2024-03-25 10:36:42 -07:00
Sahil Kachhap a9f18b803b
[Fix]: Searchbar doesn't lose focus when tapped outside (#145232)
Added a Fix to search bar that allows it be unfocused when tapped anywhere outside the search bar.

I have attached below the app flow after implementing the fix.

https://github.com/flutter/flutter/assets/54017876/70915c47-9b77-4a43-a128-8706107f921f

Issue that gets resolved by this fix: #145096

*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-03-25 17:02:07 +00:00
Kostia Sokolovskyi 2851ed3202
Fix typo in hitTest docs (#145677)
This PR fixes the typo in the `hitTest` method documentation.
2024-03-25 17:00:06 +00:00
Daco Harkes baa54fdd76
[deps] Bump native assets dependencies (#145612)
Roll of a bunch of breaking changes from the native_assets_builder and
native_assets_cli upstream. Most notably:

* https://github.com/dart-lang/native/pull/946
* https://github.com/dart-lang/native/pull/1018
* https://github.com/dart-lang/native/pull/1019

This PR also updates the template in `flutter create
--template=package_ffi` to use the rewritten API.

This PR does not change any functionality in Flutter.

For reference, the same roll in the Dart SDK:

* https://dart-review.googlesource.com/c/sdk/+/357605
* https://dart-review.googlesource.com/c/sdk/+/357623

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

<!-- 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-03-25 15:02:49 +01:00
Taha Tesser 23687c5260
Add AnimationStyle to showBottomSheet and showModalBottomSheet (#145536)
fixes [Introduce animation customizable with `AnimationStyle` to `BottomSheet`](https://github.com/flutter/flutter/issues/145532)

### Default bottom sheet animation
![00-ezgif com-video-to-gif-converter](https://github.com/flutter/flutter/assets/48603081/a295b002-b310-4dea-8bc4-23b1d299748c)

### Custom bottom sheet animation
![01-ezgif com-video-to-gif-converter](https://github.com/flutter/flutter/assets/48603081/8c5c3d5f-e67d-4ed5-880d-f17d262087e1)

### No bottom sheet animation
![02-ezgif com-video-to-gif-converter](https://github.com/flutter/flutter/assets/48603081/872409d8-8a8d-4db9-b95b-7f96a62cdffc)
2024-03-25 08:39:05 +00:00
Andrew Kolos cd785544fa
make hot reload reflect changes to asset transformer configurations (#144660)
In service of https://github.com/flutter/flutter/issues/143348

This PR makes hot reloads reflect changes to transformer configurations under the `assets` section in pubspec.yaml.
This PR is optimized for ease of implementation, and should not be merged as-is. If it is merged as-is, seriously consider creating a tech debt issue and assigning it to someone to make sure it gets resolved.
2024-03-25 04:13:11 +00:00
Polina Cherkasova 9fee27b244
Leak clean up. (#144803)
Fix some leaks and mark others.

[Known leaks](https://github.com/issues?q=is%3Aopen+is%3Aissue+label%3A%22a%3A+leak+tracking%22+-label%3A%22c%3A+new+feature%22+)
2024-03-24 18:01:17 +00:00
Pierre-Louis 9ae8a6b7d5
Reland #128236 "Improve build output for all platforms" (#145495)
Reland #128236, reverted in https://github.com/flutter/flutter/pull/143125, https://github.com/flutter/flutter/pull/145261, and https://github.com/flutter/flutter/pull/145487.

The errors were raised in post-submit tests on Windows. I have finally obtained a Windows machine to reproduce the errors locally and adjust the test (remove size expectation and rename output `.exe`).

## Original description

Improves the build output:

1. Gives confirmation that the build succeeded, in green
1. Gives the path to the built executable, without a trailing period to make it slightly easier to cmd/ctrl+open
1. Gives the size of the built executable (when the built executable is self contained) 

### `apk`, `appbundle` 

<img width="607" alt="image" src="https://github.com/flutter/flutter/assets/6655696/ecc52abe-cd2e-4116-b22a-8385ae3e980d">

<img width="634" alt="image" src="https://github.com/flutter/flutter/assets/6655696/8af8bd33-c0bd-4215-9a06-9652ee019436">

### `macos`, `ios`, `ipa`
Build executables are self-contained and use a newly introduced `OperatingSystemUtils.getDirectorySize`.

<img width="514" alt="image" src="https://github.com/flutter/flutter/assets/6655696/b5918a69-3959-4417-9205-4f501d185257">

<img width="581" alt="image" src="https://github.com/flutter/flutter/assets/6655696/d72fd420-18cf-4470-9e4b-b6ac10fbcd50">

<img width="616" alt="image" src="https://github.com/flutter/flutter/assets/6655696/5f235ce1-252a-4c13-898f-139f6c7bc698">

### `windows`, `linux`, and `web`
Build executables aren't self-contained, and folder size can sometimes overestimate distribution size, therefore their size isn't mentioned (see discussion below).

<img width="647" alt="image" src="https://github.com/flutter/flutter/assets/6655696/7179e771-1eb7-48f6-b770-975bc073437b">

<img width="658" alt="image" src="https://github.com/flutter/flutter/assets/6655696/a6801cab-7b5a-4975-a406-f4c9fa44d7a2">

<img width="608" alt="image" src="https://github.com/flutter/flutter/assets/6655696/ee7c4125-a273-4a65-95d7-ab441edf8ac5">

### Size reporting
When applicable, the printed size matches the OS reported size.

- macOS
    <img width="391" alt="image" src="https://github.com/flutter/flutter/assets/6655696/881cbfb1-d355-444b-ab44-c1a6343190ce">
- Windows
    <img width="338" alt="image" src="https://github.com/flutter/flutter/assets/6655696/3b806def-3d15-48a9-8a25-df200d6feef7">
- Linux   
    <img width="320" alt="image" src="https://github.com/flutter/flutter/assets/6655696/89a4aa3d-2148-4f3b-b231-f93a057fee2b">

## Related issues
Part of #120127
Fixes https://github.com/flutter/flutter/issues/121401
2024-03-23 12:05:21 +00:00
David Iglesias df75d249b2
[web][docs] Improve HtmlElementView widget docs. (#145192)
This PR expands the `HtmlElementView` widget DartDocs, with the following sections:

* Usage: How to use the widget, two ways:
  * The `HtmlElementView.fromTagName` constructor
  * The `PlatformViewRegistry` way
* Lifecycle: There's an `onCreated` callback on the widget. When does it get called?
* HTML Lifecycle: How to listen to events coming from the DOM.
* Visibility: what is the `isVisible` property for?

Small additional tweaks here and there to mention common pitfalls of using HtmlElementView on the web, and mentions to workarounds, like `package:pointer_interceptor`.

## Issues

* Fixes: https://github.com/flutter/flutter/issues/143922
* Fixes: https://github.com/flutter/flutter/issues/49634
* Related: https://github.com/flutter/website/issues/5063
2024-03-23 00:53:26 +00:00
Kate Lovett 4820e0cd9f
Fix skipping golden comparator for CI environments (#145619)
Fixes https://github.com/flutter/flutter/issues/145618

The local file comparator was being used in post submit for the Linux coverage shard. This corrects it to choose the skipping comparator.
2024-03-22 20:45:35 +00:00
Kate Lovett c5047e0ada
2DScrollView - Fix drag when one axis does not have enough content (#145566)
Fixes https://github.com/flutter/flutter/issues/144982
For reference, may have to do with #138442 when we reworked the gesture handling. The adjustments to the comments here were certainly from #138442 not updating them. Confused myself for a minute or two. 🙃
2024-03-22 16:42:19 +00:00
Nate 7fb35db62f
Intensive if chain refactoring (#145194)
This pull request refactors if-statements into switch expressions, as part of the effort to solve issue #144903.

Making changes beyond just swapping syntax is more difficult (and also more difficult to review, I apologize), but much more satisfying too.
2024-03-22 13:55:06 +00:00
Bruno Leroux 859eb2eda9
Adds numpad navigation shortcuts for Linux (#145464)
## Description

This PR adds shortcuts related to numpad keys on Linux.

## Related Issue

Linux side for https://github.com/flutter/flutter/issues/144936

## Tests

Adds 2 tests.
2024-03-22 06:22:09 +00:00
LongCatIsLooong d755bc222b
Replace RenderBox.compute* with RenderBox.get* and add @visibleForOverriding (#145503)
`@visibleForOverriding` + `@protected` unfortunately does not catch the case where a `compute*` method was overridden in a subtype and the overide was called in that same type's implementation.

I did not add a `flutter_ignore` for this because it doesn't seem there will be false positives.
2024-03-22 02:44:55 +00:00
Greg Spencer 0f685f88c6
Add some cross references in the docs, move an example to a dartpad example (#145571)
## Description

This adds some "See also" links to some docs for `TweenAnimationBuilder` and `ValueListenableBuilder`.

Also, moved a "snippet" example in `ValueListenableBuilder` into the examples directory as a Dartpad example.

## Tests
 - Added test for the example.
2024-03-22 02:35:11 +00:00
Bernardo Ferrari 784f19c49c
Fix BorderSide.none requiring explicit transparent color for UnderlineInputBorder (#145329)
Fix could have been "paint transparent when Border none" but, following other Borders, we will just not paint anything.

Fix https://github.com/flutter/flutter/issues/143746
2024-03-22 02:31:16 +00:00
Michael Goderbauer 11c034f037
Fix nullability of getFullHeightForCaret (#145554)
Fixes https://github.com/flutter/flutter/issues/145507.

Looks like this was accidentally migrated to nullable all the way back when we switched to NNBD.
2024-03-21 23:38:16 +00:00
Lau Ching Jun c759c22e71
Fixed race condition in PollingDeviceDiscovery. (#145506)
There are two issues in the previous implementation:
1. `_populateDevices` will return the devices from `deviceNotifier` if it had been initialized, assuming that once it's initialized, it has been properly populated. That assumption is not true because calling getters like `onAdded` would initialize `deviceNotifier` without populating it.
2. `deviceNotifier` instance might be replaced in some cases, causing `onAdded` subscribers to lose any future updates.

To fix (1), this commit added the `isPopulated` field in `deviceNotifier` as a more accurate flag to determine if we need to populate it.

To fix (2), this commit made `deviceNotifier` a final member in `PolingDeviceDiscovery`.
2024-03-21 22:37:08 +00:00
Ian Hickson afe01503d8
Clarify AutomaticKeepAliveClientMixin semantics in build method (#145297)
This should help folks who trace the code before reading the documentation.
2024-03-21 21:28:07 +00:00
Michael Goderbauer eaf509aaf8
Eliminate more window singleton usages (#145560)
These usages in strings slipped through the initial clean-up.
2024-03-21 20:59:25 +00:00
Jackson Gardner 31209d04ff
flutter test --wasm support (#145347)
* Adds support for `flutter test --wasm`.
  * The test compilation flow is a bit different now, so that it supports compilers other than DDC. Specifically, when we run a set of unit tests, we generate a "switchboard" main function that imports each unit test and runs the main function for a specific one based off of a value set by the JS bootstrapping code. This way, there is one compile step and the same compile output is invoked for each unit test file.
* Also, removes all references to `dart:html` from flutter/flutter.
* Adds CI steps for running the framework unit tests with dart2wasm+skwasm
  * These steps are marked as `bringup: true`, so we don't know what kind of failures they will result in. Any failures they have will not block the tree at all yet while we're still in `bringup: true`. Once this PR is merged, I plan on looking at any failures and either fixing them or disabling them so we can get these CI steps running on presubmit.

This fixes https://github.com/flutter/flutter/issues/126692
2024-03-21 20:08:07 +00:00
Pascal Welsch 4bbe6d594d
Add WidgetsApp.debugShowWidgetInspectorOverride again (deprecated) (#145334)
`WidgetsApp.debugShowWidgetInspectorOverride` was replaced with ` WidgetsBinding.instance.debugShowWidgetInspectorOverrideNotifier` in https://github.com/flutter/flutter/pull/144029.

The old API was removed, not deprecated.

It is used by some [open-source projects](https://github.com/search?q=WidgetsApp.debugShowWidgetInspectorOverride&type=code), thus I'm making the effort of bringing the API back as deprecated.

Fixes https://github.com/flutter/flutter/issues/145333
2024-03-21 17:43:05 +00:00
flutter-pub-roller-bot 61b3f975a0
Roll pub packages (#145476)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-03-21 00:09:24 +00:00
Vatsal Bhesaniya 01fc13d9f9
Add helper widget parameter to InputDecoration (#145157)
This pull request introduces a new field named `helper` to the InputDecoration class. This field allows for specifying a widget containing contextual information about the InputDecorator.child's value. Unlike `helperText`, which accepts a plain string, `helper` supports widgets, enabling functionalities like tappable links for further explanation. This change aligns with the established pattern of `error`, `label`, `prefix`, and `suffix`.

fixes [#145163](https://github.com/flutter/flutter/issues/145163)
2024-03-20 20:48:05 +00:00
Gray Mackall 39bdff16c1
Remove embedding v1 code in framework (#144726)
Pre work for https://github.com/flutter/engine/pull/51229. Removes a lot of code referencing v1 of the android embedding, though not necessarily all of it (I may have missed some, it is hard to know).

Will hopefully make landing that PR less painful (or maybe painless?)
2024-03-20 20:34:14 +00:00
auto-submit[bot] a01eac78ee
Reverts "Reland #128236 "Improve build output for all platforms" (#145376)" (#145487)
Reverts: flutter/flutter#145376
Initiated by: loic-sharma
Reason for reverting: It caused the following post-submit failures:

1. https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8752928710548811665/+/u/run_run_release_test_windows/stdout
2. https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8752927564747697169/+/u/run_run_release_test_windows/stdout
Original PR Author: guidezpl

Reviewed By: {loic-sharma}

This change reverts the following previous change:
Reland #128236, reverted in https://github.com/flutter/flutter/pull/143125 and https://github.com/flutter/flutter/pull/145261.

This PR contains 3 additional commits, fixing post-submit tests on Android and Windows.

## Original description

Improves the build output:

1. Gives confirmation that the build succeeded, in green
1. Gives the path to the built executable, without a trailing period to make it slightly easier to cmd/ctrl+open
1. Gives the size of the built executable (when the built executable is self contained) 

### `apk`, `appbundle` 

<img width="607" alt="image" src="https://github.com/flutter/flutter/assets/6655696/ecc52abe-cd2e-4116-b22a-8385ae3e980d">

<img width="634" alt="image" src="https://github.com/flutter/flutter/assets/6655696/8af8bd33-c0bd-4215-9a06-9652ee019436">

### `macos`, `ios`, `ipa`
Build executables are self-contained and use a newly introduced `OperatingSystemUtils.getDirectorySize`.

<img width="514" alt="image" src="https://github.com/flutter/flutter/assets/6655696/b5918a69-3959-4417-9205-4f501d185257">

<img width="581" alt="image" src="https://github.com/flutter/flutter/assets/6655696/d72fd420-18cf-4470-9e4b-b6ac10fbcd50">

<img width="616" alt="image" src="https://github.com/flutter/flutter/assets/6655696/5f235ce1-252a-4c13-898f-139f6c7bc698">

### `windows`, `linux`, and `web`
Build executables aren't self-contained, and folder size can sometimes overestimate distribution size, therefore their size isn't mentioned (see discussion below).

<img width="647" alt="image" src="https://github.com/flutter/flutter/assets/6655696/7179e771-1eb7-48f6-b770-975bc073437b">

<img width="658" alt="image" src="https://github.com/flutter/flutter/assets/6655696/a6801cab-7b5a-4975-a406-f4c9fa44d7a2">

<img width="608" alt="image" src="https://github.com/flutter/flutter/assets/6655696/ee7c4125-a273-4a65-95d7-ab441edf8ac5">

### Size reporting
When applicable, the printed size matches the OS reported size.

- macOS
    <img width="391" alt="image" src="https://github.com/flutter/flutter/assets/6655696/881cbfb1-d355-444b-ab44-c1a6343190ce">
- Windows
    <img width="338" alt="image" src="https://github.com/flutter/flutter/assets/6655696/3b806def-3d15-48a9-8a25-df200d6feef7">
- Linux   
    <img width="320" alt="image" src="https://github.com/flutter/flutter/assets/6655696/89a4aa3d-2148-4f3b-b231-f93a057fee2b">

## Related issues
Part of #120127
Fixes https://github.com/flutter/flutter/issues/121401
2024-03-20 18:18:25 +00:00
Pierre-Louis 6b568f3943
Reland #128236 "Improve build output for all platforms" (#145376)
Reland #128236, reverted in https://github.com/flutter/flutter/pull/143125 and https://github.com/flutter/flutter/pull/145261.

This PR contains 3 additional commits, fixing post-submit tests on Android and Windows.

## Original description

Improves the build output:

1. Gives confirmation that the build succeeded, in green
1. Gives the path to the built executable, without a trailing period to make it slightly easier to cmd/ctrl+open
1. Gives the size of the built executable (when the built executable is self contained) 

### `apk`, `appbundle` 

<img width="607" alt="image" src="https://github.com/flutter/flutter/assets/6655696/ecc52abe-cd2e-4116-b22a-8385ae3e980d">

<img width="634" alt="image" src="https://github.com/flutter/flutter/assets/6655696/8af8bd33-c0bd-4215-9a06-9652ee019436">

### `macos`, `ios`, `ipa`
Build executables are self-contained and use a newly introduced `OperatingSystemUtils.getDirectorySize`.

<img width="514" alt="image" src="https://github.com/flutter/flutter/assets/6655696/b5918a69-3959-4417-9205-4f501d185257">

<img width="581" alt="image" src="https://github.com/flutter/flutter/assets/6655696/d72fd420-18cf-4470-9e4b-b6ac10fbcd50">

<img width="616" alt="image" src="https://github.com/flutter/flutter/assets/6655696/5f235ce1-252a-4c13-898f-139f6c7bc698">

### `windows`, `linux`, and `web`
Build executables aren't self-contained, and folder size can sometimes overestimate distribution size, therefore their size isn't mentioned (see discussion below).

<img width="647" alt="image" src="https://github.com/flutter/flutter/assets/6655696/7179e771-1eb7-48f6-b770-975bc073437b">

<img width="658" alt="image" src="https://github.com/flutter/flutter/assets/6655696/a6801cab-7b5a-4975-a406-f4c9fa44d7a2">

<img width="608" alt="image" src="https://github.com/flutter/flutter/assets/6655696/ee7c4125-a273-4a65-95d7-ab441edf8ac5">

### Size reporting
When applicable, the printed size matches the OS reported size.

- macOS
    <img width="391" alt="image" src="https://github.com/flutter/flutter/assets/6655696/881cbfb1-d355-444b-ab44-c1a6343190ce">
- Windows
    <img width="338" alt="image" src="https://github.com/flutter/flutter/assets/6655696/3b806def-3d15-48a9-8a25-df200d6feef7">
- Linux   
    <img width="320" alt="image" src="https://github.com/flutter/flutter/assets/6655696/89a4aa3d-2148-4f3b-b231-f93a057fee2b">

## Related issues
Part of #120127
Fixes https://github.com/flutter/flutter/issues/121401
2024-03-20 16:14:53 +00:00
Lau Ching Jun a80286270c
Fix remote DDS in proxied devices. (#145346)
A ProxiedDevice has two port forwarder, one to forward remote host port and another to forward remote device port. During an attach workflow, the port was forwarded by the latter. Update ProxiedDDS to make sure that it works in such case.
2024-03-19 21:36:06 +00:00
hangyu 2b317d584f
Add a minTileHeight to ListTile widget so its height can be customized to less than the default height. (#145244)
fixes: https://github.com/flutter/flutter/issues/145369
2024-03-19 17:58:16 +00:00
Mitchell Goodwin 6190c5eea1
Widget state properties (#142151)
Fixes #138270.

Moves the majority of the logic of MaterialStateProperties down to the widgets layer, then has the existing Material classes pull from the widgets versions.
2024-03-19 17:58:13 +00:00
goodmost 3236957f02
chore: fix some comments (#145397)
fix some comments
2024-03-19 17:00:24 +00:00
Bruno Leroux 6f61f6135f
Activate shortcuts based on NumLock state (#145146)
## Description

The PR updates `SingleActivator` in order to add a parameter for specifying that a shortcut depends on <kbd>NumLock</kbd> key state. 

Somewhat similarly to what is possible with common modifiers expect that a boolean is not enough in this case because: by default, a shortcut should ignore the <kbd>NumLock</kbd> state and it should be possible to define shortcuts that require <kbd>NumLock</kbd> to be locked and other that require it to be unlocked.

@gspencergoog I considered defining a new `ShortcutActivator` implementation for this, but I thinks that adding the feature directly to `SingleActivator` results in a cleaner API.

## Related Issue

Fixes https://github.com/flutter/flutter/issues/145144
Preparation for https://github.com/flutter/flutter/issues/144936

## Tests

Adds 3 tests.
2024-03-19 08:27:50 +00:00
Danny Tuppeny 89ef73e068
Roll pub packages + update DAP tests (#145349)
This manually rolls pub packages and updates some calls to use updated APIs that use `Uri` instead of file paths (since macro-generated sources don't exist as files on disk).
2024-03-18 21:39:21 +00:00
sanni prasad 993f554e4c
Fix for issue 140372 (#144947)
*Continuing work from the PR https://github.com/flutter/flutter/pull/140373*

Add the ability to set route settings on PopupMenuButton

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

Added UTs as requested
2024-03-18 21:35:37 +00:00
LongCatIsLooong 98369bdd50
Introduce methods for computing the baseline location of a RenderBox without affecting the current layout (#144655)
Extracted from https://github.com/flutter/flutter/pull/138369

Introduces `RenderBox.{compute,get}DryBaseline` for computing the baseline location in `RenderBox.computeDryLayout`.
2024-03-18 21:32:22 +00:00
Bruno Leroux 50e7f2b84b
InputDecorator M3 tests migration - Step6 - constraints (#145213)
## Description

This PR migrates `InputDecorator.constraints` related tests to M3 and also various regression tests.

It is the fifth step for the M3 test migration for `InputDecorator`.
Step 1: https://github.com/flutter/flutter/pull/142981
Step 2: https://github.com/flutter/flutter/pull/143369
Step 3: https://github.com/flutter/flutter/pull/143520
Step 4: https://github.com/flutter/flutter/pull/144169
Step 5: https://github.com/flutter/flutter/pull/144932

## Related Issue

Related to https://github.com/flutter/flutter/issues/139076

@justinmc A somewhat small PR, I wanted to migrate the small group related to 'InputDecoration.constraints' (starting at line 2801), it adds a test checking min interactive height and two others that shows one way to bypass the standard min interactive height.
2024-03-18 12:53:14 +00:00
Taha Tesser 06ed849cbc
Update inherited_theme_test.dart, ink_paint_test.dart, ink_splash_test.dart, opacity_test.dart for Material 3 (#144013)
Updated unit tests for `Tooltip` to have M2 and M3 versions.

More info in #139076
2024-03-18 12:45:22 +00:00
Ian Hickson c7123c96cd
Factor out use of "print" in flutter_goldens (#144846)
This is part 5 of a broken down version of the #140101 refactor.

This PR removes direct use of `print` and replaces it with a callback.
2024-03-17 01:56:19 +00:00
auto-submit[bot] 48c1c2313a
Reverts "Reland #128236 "Improve build output for all platforms" (#143166)" (#145261)
Reverts: flutter/flutter#143166
Initiated by: guidezpl
Reason for reverting: breaks devicelab windows tests
Original PR Author: guidezpl

Reviewed By: {loic-sharma}

This change reverts the following previous change:
Reland #128236, reverted in https://github.com/flutter/flutter/pull/143125.

This PR contains [one additional commit](199baea9a9), fixing the 2 failed tests.

## Original description

Improves the build output:

1. Gives confirmation that the build succeeded, in green
1. Gives the path to the built executable, without a trailing period to make it slightly easier to cmd/ctrl+open
1. Gives the size of the built executable (when the built executable is self contained) 

### `apk`, `appbundle` 

<img width="607" alt="image" src="https://github.com/flutter/flutter/assets/6655696/ecc52abe-cd2e-4116-b22a-8385ae3e980d">

<img width="634" alt="image" src="https://github.com/flutter/flutter/assets/6655696/8af8bd33-c0bd-4215-9a06-9652ee019436">

### `macos`, `ios`, `ipa`
Build executables are self-contained and use a newly introduced `OperatingSystemUtils.getDirectorySize`.

<img width="514" alt="image" src="https://github.com/flutter/flutter/assets/6655696/b5918a69-3959-4417-9205-4f501d185257">

<img width="581" alt="image" src="https://github.com/flutter/flutter/assets/6655696/d72fd420-18cf-4470-9e4b-b6ac10fbcd50">

<img width="616" alt="image" src="https://github.com/flutter/flutter/assets/6655696/5f235ce1-252a-4c13-898f-139f6c7bc698">

### `windows`, `linux`, and `web`
Build executables aren't self-contained, and folder size can sometimes overestimate distribution size, therefore their size isn't mentioned (see discussion below).

<img width="647" alt="image" src="https://github.com/flutter/flutter/assets/6655696/7179e771-1eb7-48f6-b770-975bc073437b">

<img width="658" alt="image" src="https://github.com/flutter/flutter/assets/6655696/a6801cab-7b5a-4975-a406-f4c9fa44d7a2">

<img width="608" alt="image" src="https://github.com/flutter/flutter/assets/6655696/ee7c4125-a273-4a65-95d7-ab441edf8ac5">

### Size reporting
When applicable, the printed size matches the OS reported size.

- macOS
    <img width="391" alt="image" src="https://github.com/flutter/flutter/assets/6655696/881cbfb1-d355-444b-ab44-c1a6343190ce">
- Windows
    <img width="338" alt="image" src="https://github.com/flutter/flutter/assets/6655696/3b806def-3d15-48a9-8a25-df200d6feef7">
- Linux   
    <img width="320" alt="image" src="https://github.com/flutter/flutter/assets/6655696/89a4aa3d-2148-4f3b-b231-f93a057fee2b">

## Related issues
Part of #120127
Fixes https://github.com/flutter/flutter/issues/121401
2024-03-16 12:40:26 +00:00
Pierre-Louis 2fc76c7896
Reland #128236 "Improve build output for all platforms" (#143166)
Reland #128236, reverted in https://github.com/flutter/flutter/pull/143125.

This PR contains [one additional commit](199baea9a9), fixing the 2 failed tests.

## Original description

Improves the build output:

1. Gives confirmation that the build succeeded, in green
1. Gives the path to the built executable, without a trailing period to make it slightly easier to cmd/ctrl+open
1. Gives the size of the built executable (when the built executable is self contained) 

### `apk`, `appbundle` 

<img width="607" alt="image" src="https://github.com/flutter/flutter/assets/6655696/ecc52abe-cd2e-4116-b22a-8385ae3e980d">

<img width="634" alt="image" src="https://github.com/flutter/flutter/assets/6655696/8af8bd33-c0bd-4215-9a06-9652ee019436">

### `macos`, `ios`, `ipa`
Build executables are self-contained and use a newly introduced `OperatingSystemUtils.getDirectorySize`.

<img width="514" alt="image" src="https://github.com/flutter/flutter/assets/6655696/b5918a69-3959-4417-9205-4f501d185257">

<img width="581" alt="image" src="https://github.com/flutter/flutter/assets/6655696/d72fd420-18cf-4470-9e4b-b6ac10fbcd50">

<img width="616" alt="image" src="https://github.com/flutter/flutter/assets/6655696/5f235ce1-252a-4c13-898f-139f6c7bc698">

### `windows`, `linux`, and `web`
Build executables aren't self-contained, and folder size can sometimes overestimate distribution size, therefore their size isn't mentioned (see discussion below).

<img width="647" alt="image" src="https://github.com/flutter/flutter/assets/6655696/7179e771-1eb7-48f6-b770-975bc073437b">

<img width="658" alt="image" src="https://github.com/flutter/flutter/assets/6655696/a6801cab-7b5a-4975-a406-f4c9fa44d7a2">

<img width="608" alt="image" src="https://github.com/flutter/flutter/assets/6655696/ee7c4125-a273-4a65-95d7-ab441edf8ac5">

### Size reporting
When applicable, the printed size matches the OS reported size.

- macOS
    <img width="391" alt="image" src="https://github.com/flutter/flutter/assets/6655696/881cbfb1-d355-444b-ab44-c1a6343190ce">
- Windows
    <img width="338" alt="image" src="https://github.com/flutter/flutter/assets/6655696/3b806def-3d15-48a9-8a25-df200d6feef7">
- Linux   
    <img width="320" alt="image" src="https://github.com/flutter/flutter/assets/6655696/89a4aa3d-2148-4f3b-b231-f93a057fee2b">

## Related issues
Part of #120127
Fixes https://github.com/flutter/flutter/issues/121401
2024-03-16 08:13:56 +00:00
Pierre-Louis 3109b1118e
Introduce Split curve (#143130)
`Split` is a curve that progresses according to `beginCurve` until
`split`, then according to `endCurve`.

This curve is used with bottom sheets to allow linear finger dragging
and non-linear enter/exit animations. This PR cleans up a previously
private class I introduced and replaces it with the more customisable
`Split`.

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

Diagram to be added with
https://github.com/flutter/assets-for-api-docs/pull/239

## 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-03-16 09:08:00 +01:00
LongCatIsLooong cc01701781
Use a separate TextPainter for intrinsics calculation in RenderEditable and RenderParagraph (#144577)
Use a dedicated `TextPainter` for intrinsic size calculation in `RenderEditable` and `RenderParagraph`.

This is an implementation detail so the change should be covered by existing tests.  Performance wise this shouldn't be significantly slower since SkParagraph [caches the result of slower operations across different paragraphs](9c62e7b382/modules/skparagraph/src/ParagraphCache.cpp (L254-L272)). Existing benchmarks should be able to catch potential regressions (??).

The reason for making this change is to make sure that intrinsic size computations don't destroy text layout artifacts, so I can expose the text layout as a stream of immutable `TextLayout` objects, to signify other render objects that text-layout-dependent-cache (such as caches for `getBoxesForRange` which can be relatively slow to compute) should be invalidated and  `markNeedsPaint` needs to be called if the painting logic depended on text layout.
Without this change, the intrinsics/dry layout calculations will add additional events to the text layout stream, which violates the "dry"/non-destructive contract.
2024-03-16 01:15:19 +00:00
hangyu 58eb0e8ae6
Update a11y for SliverAppBar (#144437)
1. Set cacheExtent for sliverAppBar so it's not dropped from the
semantics tree.
2. Update its toolbarOpacity in a11y mode to 1.0. When scrolling in a11y
mode and the focus is back to the sliverAppBar, the content should be
visible.
fixes: https://github.com/flutter/flutter/issues/143437


## 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].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

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

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
[Data Driven Fixes]:
https://github.com/flutter/flutter/wiki/Data-driven-Fixes
2024-03-15 10:42:02 -07:00
Loïc Sharma 8d54abfc22
Roll pub packages manually (#145170)
The automated roll failed as a test needs to be updated: https://github.com/flutter/flutter/pull/145167

Fixes: https://github.com/flutter/flutter/issues/139861
2024-03-15 14:12:22 +00:00
Nate 17a27358a6
Implementing switch expressions in flutter/test/ (#144580)
Migrates test code to new `switch` syntax.
2024-03-14 14:20:44 -07:00
auto-submit[bot] bc611f565b
Reverts "Fix TextField helper top padding on M3 (#145087)" (#145168)
Reverts: flutter/flutter#145087
Initiated by: Jasguerrero
Reason for reverting: failing on accessibility checks b/329548765
Original PR Author: bleroux

Reviewed By: {justinmc}

This change reverts the following previous change:
## Description

`InputDecorator` adds a 8.0 gap beetween the container and the helper text.
From the Material 3 specification, this gap should be 4.0.
See https://m3.material.io/components/text-fields/specs#0c5c8d6d-2169-4d42-960c-51f6ee42eb57.

This PR sets the correct values for M3 without changing the value for M2.

| Before | After | M3 Spec |
|--------|--------|--------|
| ![image](https://github.com/flutter/flutter/assets/840911/9947f334-d98f-4f7e-9da7-ca6d5c0770ac) | ![image](https://github.com/flutter/flutter/assets/840911/081dec4b-eb9f-4eee-a7dc-2538e7110ff0)| ![image](https://github.com/flutter/flutter/assets/840911/c8c8f045-3b79-43a5-a1a3-cc6d5460644f) |

If this change is accepted, a future step will be to make this value configurable, probably by `InputDecorationTheme`.

## Related Issue

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

## Tests

Updates a value used by several existing tests.
2024-03-14 18:00:26 +00:00
LouiseHsu 9f5fd75e54
[framework] fix incorrect chinese localizations for Search Web and Share in selection controls (#144857)
Fixes https://github.com/flutter/flutter/issues/144825

Corresponding translation suggestions:

https://tc.corp.google.com/btviewer/edittranslation?project=Flutter&msgId=7417055026368500447&language=zh-TW
(I accidentally pressed submit 3 times :( )

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

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

https://tc.corp.google.com/btviewer/edittranslation?project=Flutter&msgId=8883913494819754382&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 [relevant style guides] and ran the
auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages
repo does use `dart format`.)
- [x] I signed the [CLA].
- [x] The title of the PR starts with the name of the package surrounded
by square brackets, e.g. `[shared_preferences]`
- [x] I [linked to at least one issue that this PR fixes] in the
description above.
- [x] I updated `pubspec.yaml` with an appropriate new version according
to the [pub versioning philosophy], or this PR is [exempt from version
changes].
- [x] I updated `CHANGELOG.md` to add a description of the change,
[following repository CHANGELOG style].
- [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-03-14 10:14:20 -07:00
LongCatIsLooong a69567a36f
Asserts if a TextPainter gets disposed more than once (#145124)
The overflow indicator was sharing the same `TextPainter`.
2024-03-14 16:43:00 +00:00
Lau Ching Jun 3dba3f2a0f
Update proxied devices to handle connection interface and diagnostics. (#145061)
Also improve the performance of daemon device discovery by parallelizing the calls.
2024-03-13 22:24:25 +00:00
Matej Knopp 19087442ce
RenderViewport max layout cycles should depend on number of slivers (#144104)
Fixes https://github.com/flutter/flutter/issues/144102

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

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

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
[Data Driven Fixes]:
https://github.com/flutter/flutter/wiki/Data-driven-Fixes
2024-03-13 22:28:43 +01:00
LongCatIsLooong 4f786841f9
Revert "Add FocusNode.focusabilityListenable (#144280)" since the feature is no longer needed (#145102)
This reverts commit 726e5d28c0.

*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-03-13 20:17:07 +00:00
Bruno Leroux 33fbb75a95
Fix TextField helper top padding on M3 (#145087)
## Description

`InputDecorator` adds a 8.0 gap beetween the container and the helper text.
From the Material 3 specification, this gap should be 4.0.
See https://m3.material.io/components/text-fields/specs#0c5c8d6d-2169-4d42-960c-51f6ee42eb57.

This PR sets the correct values for M3 without changing the value for M2.

| Before | After | M3 Spec |
|--------|--------|--------|
| ![image](https://github.com/flutter/flutter/assets/840911/9947f334-d98f-4f7e-9da7-ca6d5c0770ac) | ![image](https://github.com/flutter/flutter/assets/840911/081dec4b-eb9f-4eee-a7dc-2538e7110ff0)| ![image](https://github.com/flutter/flutter/assets/840911/c8c8f045-3b79-43a5-a1a3-cc6d5460644f) |

If this change is accepted, a future step will be to make this value configurable, probably by `InputDecorationTheme`.

## Related Issue

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

## Tests

Updates a value used by several existing tests.
2024-03-13 19:56:49 +00:00
Dhikshith f91614a4b9
Fix Cupertino Context Menu Container to Remove White Corners (#144883)
Fixes a visual glitch when CupertinoContextMenu is on a non-white background.
2024-03-13 12:38:28 -07:00
Jonah Williams e4c79841a3
[Impeller] remove unstable debug checked banner for zoom test. (#145097)
These tests have been flaky for impeller since it has rotated text.
2024-03-13 18:07:59 +00:00
Nate b9e537336f
Turning if chains into shorter switch statements (#144977)
This pull request is part of the effort to solve issue #144903.

In the past, my efforts to reduce line length involved refactoring away from switch statements, but unlike [yesterday's PR](https://github.com/flutter/flutter/pull/144905), this one is full of switch statements that make things more concise!
2024-03-13 17:16:17 +00:00
Victoria Ashworth 825e901e00
Set cacheExtent for SliverFillRemaining widget (#143612)
When a Sliver with items is outside of the Viewport, but within the Viewport's `cacheExtent`, the framework should create SemanticNodes for the items even though they are out of view. However, for this to work, the Sliver's geometry must have a `cacheExtent` (how much space the sliver took up of the Viewport's `cacheExtent`) greater than 0, otherwise it is [excluded](f01ce9f4cb/packages/flutter/lib/src/rendering/viewport.dart (L311-L315)).

`SliverFillRemaining` widgets that fall outside the viewport did not have this set and therefore were being excluded when SemanticNodes were created, even if they were within the Viewport's `cacheExtent`. This PR sets the `cacheExtent` for `SliverFillRemaining` widgets.

In addition, `RenderSliverFillRemainingWithScrollable` would get dropped from the semantic tree because it's child had a size of 0 when outside the remaining paint extent. To fix, we give the child a `maxExtent` of the sliver's `cacheExtent` if it's outside the remaining paint extent but within the viewport's cacheExtent.

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

Definitions:
* `RenderViewport.cacheExtent`:
  ```dart
  /// The viewport has an area before and after the visible area to cache items
  /// that are about to become visible when the user scrolls.
  ///
  /// Items that fall in this cache area are laid out even though they are not
  /// (yet) visible on screen. The [cacheExtent] describes how many pixels
  /// the cache area extends before the leading edge and after the trailing edge
  /// of the viewport.
  ///
  /// The total extent, which the viewport will try to cover with children, is
  /// [cacheExtent] before the leading edge + extent of the main axis +
  /// [cacheExtent] after the trailing edge.
  ///
  /// The cache area is also used to implement implicit accessibility scrolling
  /// on iOS: When the accessibility focus moves from an item in the visible
  /// viewport to an invisible item in the cache area, the framework will bring
  /// that item into view with an (implicit) scroll action.
  ```
* `SliverGeometry.cacheExtent`:
  ```dart
  /// How many pixels the sliver has consumed in the
  /// [SliverConstraints.remainingCacheExtent].
  ```
* `SliverContraints.remainingCacheExtent`:
  ```dart
  /// Describes how much content the sliver should provide starting from the
  /// [cacheOrigin].
  ///
  /// Not all content in the [remainingCacheExtent] will be visible as some
  /// of it might fall into the cache area of the viewport.
  ///
  /// Each sliver should start laying out content at the [cacheOrigin] and
  /// try to provide as much content as the [remainingCacheExtent] allows.
  ```
2024-03-13 16:34:25 +00:00
Qun Cheng 1ccad1a2a7
Remove showTrackOnHover from Scrollbar and ScrollbarTheme (#144180)
This PR is to remove deprecated `Scrollbar.showTrackOnHover` and `ScrollbarThemeData.showTrackOnHover`.

These parameters are made obsolete in https://github.com/flutter/flutter/pull/111706.
Part of https://github.com/flutter/flutter/issues/143956
2024-03-13 16:31:50 +00:00
Bruno Leroux 34b454f42d
InputDecorator M3 tests migration - Step5 - Helper/Counter/Error (#144932)
## Description

This PR migrates `InputDecorator` helper/counter/error related tests to M3 and adds some missing tests.

It is the fifth step for the M3 test migration for `InputDecorator`.
Step 1: https://github.com/flutter/flutter/pull/142981
Step 2: https://github.com/flutter/flutter/pull/143369
Step 3: https://github.com/flutter/flutter/pull/143520
Step 4: https://github.com/flutter/flutter/pull/144169

## Related Issue

Related to https://github.com/flutter/flutter/issues/139076
fixes https://github.com/flutter/flutter/issues/138213
2024-03-13 07:16:18 +00:00
xubaolin c83237f37c
[New feature]Introduce iOS multi-touch drag behavior (#141355)
Fixes #38926

This patch implements the iOS behavior pointed out by @dkwingsmt at #38926 , which is also consistent with the performance of my settings application on the iPhone.

### iOS behavior (horizontal or vertical drag)

## Algorithm
When dragging: delta(combined) = max(i of n that are positive) delta(i) - max(i of n that are negative) delta(i)
It means that, if two fingers are moving +50 and +10 respectively, it will move +50; if they're moving at +50 and -10 respectively, it will move +40.

~~TODO~~
~~Write some test cases~~
2024-03-13 07:10:48 +00:00
Jackson Gardner 3c30e3cb20
Flutter Web Bootstrapping Improvements (#144434)
This makes several changes to flutter web app bootstrapping.
* The build now produces a `flutter_bootstrap.js` file.
  * By default, this file does the basic streamlined startup of a flutter app with the service worker settings and no user configuration.
  * The user can also put a `flutter_bootstrap.js` file in the `web` subdirectory in the project directory which can have whatever custom bootstrapping logic they'd like to write instead. This file is also templated, and can use any of the tokens  that can be used with the `index.html` (with the exception of `{{flutter_bootstrap_js}}`, see below).
* Introduced a few new templating tokens for `index.html`:
  * `{{flutter_js}}` => inlines the entirety of `flutter.js`
  * `{{flutter_service_worker_version}}` => replaced directly by the service worker version. This can be used instead of the script that sets the `serviceWorkerVersion` local variable that we used to have by default.
  * `{{flutter_bootstrap_js}}` => inlines the entirety of `flutter_bootstrap.js` (this token obviously doesn't apply to `flutter_bootstrap.js` itself).
* Changed `IndexHtml` to be called `WebTemplate` instead, since it is used for more than just the index.html now.
* We now emit warnings at build time for certain deprecated flows:
  * Warn on the old service worker version pattern (i.e.`(const|var) serviceWorkerVersion = null`) and recommends using `{{flutter_service_worker_version}}` token instead
  * Warn on use of `FlutterLoader.loadEntrypoint` and recommend using `FlutterLoader.load` instead
  * Warn on manual loading of `flutter_service_worker.js`.
* The default `index.html` on `flutter create` now uses an async script tag with `flutter_bootstrap.js`.
2024-03-12 22:41:26 +00:00
Kate Lovett eb74e5a497
Update gold validator to check for regression in flutter-gold check (#145008)
There were some recent change in flutter/cocoon. Check that the bot warns and holds up the PR as expected.
2024-03-12 20:20:51 +00:00
Gray Mackall d5896d5ede
Manually roll pub packages (#145005)
Manual takeover of https://github.com/flutter/flutter/pull/145003, to include some gradle lockfile changes.
2024-03-12 19:53:57 +00:00
Michael Goderbauer 77651bc496
Reland "Fail tests on exceptions raised after test completed (#144706)" (#144980)
Reverts flutter/flutter#144970

No changes in this PR compared to the original. The test failure was fixed by adding missing awaits in https://github.com/flutter/flutter/pull/144978.

Fixes https://github.com/flutter/flutter/issues/144353.
2024-03-12 18:17:10 +00:00
Michael Goderbauer e277549751
add missing awaits (#144978)
This was uncovered as part of https://github.com/flutter/flutter/pull/144706.
2024-03-12 16:51:51 +00:00
Nate 61812ca3eb
Add platform check to FocusManager app lifecycle listener (#144718)
This PR implements a temporary fix for the mobile device keyboard bug reported in [this comment](https://github.com/flutter/flutter/pull/142930#issuecomment-1981750069).

CC @gspencergoog
2024-03-12 15:43:06 +00:00
godofredoc 1ca88730a0
Update integration tests regexes. (#144847)
Some tests are assuming the flutter sdk code is being checked out to flutter and checking the code to a different repository makes them fail.

Bug: https://github.com/flutter/flutter/issues/144487
2024-03-12 01:31:25 +00:00
auto-submit[bot] 49f45d2095
Reverts "Fail tests on exceptions raised after test completed (#144706)" (#144970)
Reverts: flutter/flutter#144706
Initiated by: gspencergoog
Reason for reverting: This has broken the tree because some tests are still failing post completion. This particular one looks like it might have to do with a gold image not existing.
Original PR Author: goderbauer

Reviewed By: {Piinks}

This change reverts the following previous change:
A test was failing silently because of this (see https://github.com/flutter/flutter/issues/144353 and fixed in https://github.com/flutter/flutter/pull/144709). The failure went undetected for months. Ideally, this should have been a regular non-silent failure. This change makes that so. `package:test` can properly handle reported exceptions outside of test cases. With this change, the test fails as follows:

```
00:03 +82: Smoke test material/color_scheme/dynamic_content_color.0.dart
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following assertion was thrown running a test (but after the test had completed):
setState() called after dispose(): _DynamicColorExampleState#1cd37(lifecycle state: defunct, not
mounted)
This error happens if you call setState() on a State object for a widget that no longer appears in
the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error
can occur when code calls setState() from a timer or an animation callback.
The preferred solution is to cancel the timer or stop listening to the animation in the dispose()
callback. Another solution is to check the "mounted" property of this object before calling
setState() to ensure the object is still in the tree.
This error might indicate a memory leak if setState() is being called because another object is
retaining a reference to this State object after it has been removed from the tree. To avoid memory
leaks, consider breaking the reference to this object during dispose().

When the exception was thrown, this was the stack:
#0      State.setState.<anonymous closure> (package:flutter/src/widgets/framework.dart:1167:9)
#1      State.setState (package:flutter/src/widgets/framework.dart:1202:6)
#2      _DynamicColorExampleState._updateImage (package:flutter_api_samples/material/color_scheme/dynamic_content_color.0.dart:191:5)
<asynchronous suspension>
════════════════════════════════════════════════════════════════════════════════════════════════════
00:03 +81 -1: Smoke test material/context_menu/context_menu_controller.0.dart
00:03 +81 -1: Smoke test material/color_scheme/dynamic_content_color.0.dart [E]
  Test failed. See exception logs above.
  The test description was: Smoke test material/color_scheme/dynamic_content_color.0.dart
  
  This test failed after it had already completed.
  Make sure to use a matching library which informs the test runner
  of pending async work.
```
2024-03-11 23:31:18 +00:00
Polina Cherkasova e66811ae04
Make TabController communicating creation in constructor. (#144912)
Contributes to https://github.com/flutter/flutter/issues/144910
2024-03-11 23:13:47 +00:00
Michael Goderbauer 91cccc8e6b
Fail tests on exceptions raised after test completed (#144706)
A test was failing silently because of this (see
https://github.com/flutter/flutter/issues/144353 and fixed in
https://github.com/flutter/flutter/pull/144709). The failure went
undetected for months. Ideally, this should have been a regular
non-silent failure. This change makes that so. `package:test` can
properly handle reported exceptions outside of test cases. With this
change, the test fails as follows:

```
00:03 +82: Smoke test material/color_scheme/dynamic_content_color.0.dart
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following assertion was thrown running a test (but after the test had completed):
setState() called after dispose(): _DynamicColorExampleState#1cd37(lifecycle state: defunct, not
mounted)
This error happens if you call setState() on a State object for a widget that no longer appears in
the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error
can occur when code calls setState() from a timer or an animation callback.
The preferred solution is to cancel the timer or stop listening to the animation in the dispose()
callback. Another solution is to check the "mounted" property of this object before calling
setState() to ensure the object is still in the tree.
This error might indicate a memory leak if setState() is being called because another object is
retaining a reference to this State object after it has been removed from the tree. To avoid memory
leaks, consider breaking the reference to this object during dispose().

When the exception was thrown, this was the stack:
#0      State.setState.<anonymous closure> (package:flutter/src/widgets/framework.dart:1167:9)
#1      State.setState (package:flutter/src/widgets/framework.dart:1202:6)
#2      _DynamicColorExampleState._updateImage (package:flutter_api_samples/material/color_scheme/dynamic_content_color.0.dart:191:5)
<asynchronous suspension>
════════════════════════════════════════════════════════════════════════════════════════════════════
00:03 +81 -1: Smoke test material/context_menu/context_menu_controller.0.dart
00:03 +81 -1: Smoke test material/color_scheme/dynamic_content_color.0.dart [E]
  Test failed. See exception logs above.
  The test description was: Smoke test material/color_scheme/dynamic_content_color.0.dart
  
  This test failed after it had already completed.
  Make sure to use a matching library which informs the test runner
  of pending async work.
```
2024-03-11 16:05:24 -07:00
Nate 26e379e0fc
Refactoring if chains into switch statements (#144905)
Based on issue #144903, this PR aims to bring the codebase more in line with the [Flutter repo style guide](https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#avoid-using-if-chains-or--or--with-enum-values):

> #### Avoid using `if` chains or `?:` or `==` with enum values

<br>

This change unfortunately increases the total line length, but it also improves readability.
2024-03-11 23:04:57 +00:00
auto-submit[bot] 187ec75eb5
Reverts "Expose build mode in environment of asset transformer processes (#144752)" (#144957)
Reverts: flutter/flutter#144752
Initiated by: andrewkolos
Reason for reverting: compilation issue has turned the tree red
Original PR Author: andrewkolos

Reviewed By: {christopherfujino}

This change reverts the following previous change:
In service of https://github.com/flutter/flutter/issues/143348

When invoking a package to transform an asset, we set `FLUTTER_BUILD_MODE` to the CLI name of the build mode being used. Inspired by https://github.com/flutter/flutter/issues/101077#issuecomment-1890379501:

> Do transformers know whether they get executed in debug or release mode? I kinda imagine that being useful. Ex: There's a transformer that optimizes the file size of images. Depending on the amount and size of the images, that could take a significant amount of time. Therefore, I might want to only execute it in release builds.

Note for the reviewer: the interesting part of this change can be found in the commit [set environment variable to build mode when running asset transformer…](579912d470). The rest of the change is updating call sites with a new argument.
2024-03-11 21:00:17 +00:00
Andrew Kolos 83fad74535
Expose build mode in environment of asset transformer processes (#144752)
In service of https://github.com/flutter/flutter/issues/143348

When invoking a package to transform an asset, we set `FLUTTER_BUILD_MODE` to the CLI name of the build mode being used. Inspired by https://github.com/flutter/flutter/issues/101077#issuecomment-1890379501:

> Do transformers know whether they get executed in debug or release mode? I kinda imagine that being useful. Ex: There's a transformer that optimizes the file size of images. Depending on the amount and size of the images, that could take a significant amount of time. Therefore, I might want to only execute it in release builds.

Note for the reviewer: the interesting part of this change can be found in the commit [set environment variable to build mode when running asset transformer…](579912d470). The rest of the change is updating call sites with a new argument.
2024-03-11 20:39:31 +00:00
victorgalo b9afa60fdd
Skip test temporarily until headingLevel is added in engine (issue 41… (#135077)
The purpose of this PR is to temporarily skip one integration test that is blocking the changes indicated below:

(This change adds a new property in Semantics widget that would take an integer corresponding to the heading levels defined by the ARIA heading role. This is necessary in order to get proper accessibility and usability in a website for users who rely on screen readers and other assistive technologies.)

Issue fixed by this PR:
https://github.com/flutter/flutter/issues/97894

Engine part:
https://github.com/flutter/engine/pull/41435 

Framework part:
https://github.com/flutter/flutter/pull/125771
2024-03-11 16:31:21 +00:00
Ian Hickson dbcce277f3
Rename isAvailableForEnvironment to isForEnvironment (#143176) (#144858)
This is part 4 of a broken down version of the #140101 refactor.

This PR renames isAvailableForEnvironment to isForEnvironment and replaces a regular expression with a simple function. (The latter will change the behaviour for people with branch names like `mainly_refactors` or `chess_master_experiment` or whatever, but I'm pretty sure the old behaviour was not intended.)

----

This is a reland of https://github.com/flutter/flutter/pull/143176 which was speculatively reverted in https://github.com/flutter/flutter/pull/144855 but turned out not to be the cause of the tree redness.
2024-03-10 06:20:38 +00:00
yim f733e3a441
Fix multiple calls to Slider's onChanged. (#143680)
Fixes #143524
2024-03-09 07:50:23 +00:00
Polina Cherkasova a04fe3169a
Upgrade vm_service. (#144845) 2024-03-08 17:09:07 -08:00
Percival cab4a0fb88
Replace dead links (#144827)
I have found that some Apple-related links are no longer accessible, and they have been replaced
2024-03-09 01:08:06 +00:00
auto-submit[bot] 0432a6941d
Reverts "Rename isAvailableForEnvironment to isForEnvironment (#143176)" (#144855)
Reverts: flutter/flutter#143176
Initiated by: QuncCccccc
Reason for reverting: made tree red.
Original PR Author: Hixie

Reviewed By: {Piinks}

This change reverts the following previous change:
This is part 4 of a broken down version of the #140101 refactor.

This PR renames isAvailableForEnvironment to isForEnvironment and replaces a regular expression with a simple function. (The latter will change the behaviour for people with branch names like `mainly_refactors` or `chess_master_experiment` or whatever, but I'm pretty sure the old behaviour was not intended.)
2024-03-08 23:19:15 +00:00
Ian Hickson 5bd34ef541
Rename isAvailableForEnvironment to isForEnvironment (#143176)
This is part 4 of a broken down version of the #140101 refactor.

This PR renames isAvailableForEnvironment to isForEnvironment and replaces a regular expression with a simple function. (The latter will change the behaviour for people with branch names like `mainly_refactors` or `chess_master_experiment` or whatever, but I'm pretty sure the old behaviour was not intended.)
2024-03-08 20:20:13 +00:00
Mitchell Goodwin 2be5084b26
Fixes the transition builder changing the Cupertino transition on Android. (#134790)
Fixes #124850.

Changes the fallback for the builder on Android. Before the error was from the platform being changed mid Cupertino transition to iOS. If a default builder wasn't set for iOS (which a developer developing only for Android might not), then it defaulted to the Zoom transition. Which changing the transition while on the fly caused issues.
2024-03-08 19:00:16 +00:00
Jackson Gardner 074114b85a
Copy over source maps from dart2js target when they are enabled. (#144832)
This fixes https://github.com/flutter/flutter/issues/143703

We need to make sure that when source maps are enabled for the dart2js target, it advertises the sourcemap file as one of its outputs so that the web release bundle can copy it over.
2024-03-08 18:56:18 +00:00
Martin Kustermann 7c89ec8bbc
Remove toString() overrides in dart:ui/package:flutter in profile/release mode on wasm/vm targets (#144763)
The flutter engine & framework can opt out of this optimization for
individual classes / class hierarchies via:

  * `@pragma(flutter:keep-to-string)`
  * `@pragma(flutter:keep-to-string-in-subtypes)`

Or by using the convenience constant `@keepToString` from `dart:ui`.

=> This aligns the build process more with g3 (which already does this)

Closes https://github.com/flutter/flutter/issues/52759
2024-03-08 09:55:02 +01:00
Loïc de Porcaro dde616dbe1
Update documentation of AlertDialog's default TextStyle for Material 3 (#144697)
## Update `AlertDialog` Documentation for Material 3 Defaults

This pull request updates the documentation for `AlertDialog` to accurately reflect the default text styles (`titleTextStyle` and `contentTextStyle`) when using Material 3.
Previously, the documentation suggested default styles (`TextTheme.titleLarge` for titles and `TextTheme.titleMedium` for content) that do not align with Material 3 implementation, which uses `TextTheme.headlineSmall` and `TextTheme.bodyMedium` respectively.

Fixes #144489
2024-03-08 00:21:35 +00:00
Andrew Kolos 06ac042271
Enable asset transformation for flutter run -d <browser> and flutter test (#144734)
Partial implementation of https://github.com/flutter/flutter/issues/143348.

The title says it all. Feel free to experiment with the feature using this project: https://github.com/andrewkolos/asset_transformers_test.
2024-03-07 23:38:40 +00:00
August dc6f94a878
refactor: Remove throwOnPluginPubspecError flag for plugin validation (#144214)
Part of #137040 and #80374

The flag `throwOnPluginPubspecError` never actually was enabled during production in #79669, but only in some dart plugin tests. And in the tests the case of the error when enabling the flag was not explicitly tested. The only thing tested was, that it is not thrown when disabled.

As explained [here](https://github.com/flutter/flutter/pull/142035#discussion_r1484237904) the only case, where this error could be thrown is, when a dart implementation and a native inline implementation are provided simultaneously. But throwing an exception there is a wrong behavior, as both can coexist in a plugin package, thus in the pubspec file.

Disabling the flag means, that the error is not thrown and not shown to the user. This is the case in production (contrary to the dart plugin tests), which acts like these plugin cases of implementations are just skipped. And this is what actually should be done.

In conclusion, I think the case of coexisting dart and native implementation in pubspec was just overlooked and therefore this error validation was introduced, which is not necessary or even valid.

For more discussion, see: https://discord.com/channels/608014603317936148/608022056616853515/1200194937791205436

  - This is tricky: I already added a test in #142035, which finally complies with the other tests, by removing the flag. So I think it falls in the category of "remove dead code".
  - Theoretically this is a breaking change, as removing / altering some tests. But the flag actually was never valid or used, so IDK. But this may not does fall in the category of "contributed tests".
2024-03-07 23:04:08 +00:00
Faisal Ansari 874804e511
Fixed -> DropdownMenu throws exception when it is in any scrollable l… (#140566)
Fixed -> DropdownMenu throws exception when it is in any scrollable list view and scrolls quickly #139871
2024-03-07 20:46:03 +00:00
Christopher Fujino 2dd06d10c9
[flutter_tools] add custom tool analysis to analyze.dart, lint Future.catchError (#140122)
Ensure tool code does not use Future.catchError or Future.onError, because it is not statically safe: https://github.com/dart-lang/sdk/issues/51248.

This was proposed upstream in dart-lang/linter in https://github.com/dart-lang/linter/issues/4071 and https://github.com/dart-lang/linter/pull/4068, but not accepted.
2024-03-07 18:10:07 +00:00
Bruno Leroux 471a82856d
[flutter_test] Use defaultTargetPlatform for key events simulation (#143579)
## Description

This PRs changes the default value for the `platform` parameter used to simulate key events.

With this PR, the default value is "web" on web, otherwise it is the operating system name retrieved from `defaultTargetPlatform`.

Previously, for methods in `WidgetController`, it defaulted to “web” on web, and “android” everywhere else. And for methods in `KeyEventSimulator` it defaulted to “web” on web, and the operating system that the test was running on everywhere else. Because the operating system was based on `Platform.operatingSystem`, it usually differed from the target platform the test was running on.

AFAIK, the `platform` parameter is only meaningful for simulating `RawKeyEvent`. Once `RawKeyboard` will be fully removed, the `platform` parameter won’t be needed. 
@gspencergoog  In the meantime, do you think it is worth merging this fix?

## Related Issue

Fixes to https://github.com/flutter/flutter/issues/133955

## Tests

Adds one test.
2024-03-07 16:08:20 +00:00
Matej Knopp de72832079
Fix frameworks added to bundle multiple times instead of lipo (#144688)
*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-03-07 15:09:15 +00:00
Bruno Leroux 8ade81fb20
[flutter_test] Change KeyEventSimulator default transit mode (#143847)
## Description

This PRs changes the default value transit mode for key event simulation.

The default transit mode for key event simulation is currently `KeyDataTransitMode.rawKeyData` while on the framework side `KeyDataTransitMode.keyDataThenRawKeyData` is the preferred transit mode.

`KeyDataTransitMode.keyDataThenRawKeyData` is more accurate and can help detect issues.

For instance the following test will fail with `KeyDataTransitMode.rawKeyData` because raw keyboard logic for modifier keys is less accurate:

```dart
  testWidgets('Press control left once', (WidgetTester tester) async {
    debugKeyEventSimulatorTransitModeOverride = KeyDataTransitMode.keyDataThenRawKeyData;

    final List<KeyEvent> events = <KeyEvent>[];
    final FocusNode focusNode = FocusNode();
    addTearDown(focusNode.dispose);

    await tester.pumpWidget(
      Focus(
        focusNode: focusNode,
        autofocus: true,
        onKeyEvent: (_, KeyEvent event) {
          events.add(event);
          return KeyEventResult.handled;
        },
        child: Container(),
      ),
    );

    await simulateKeyDownEvent(LogicalKeyboardKey.controlLeft);

    // This will fail when transit mode is KeyDataTransitMode.rawKeyData
    // because a down event for controlRight is synthesized.
    expect(events.length, 1);

    debugKeyEventSimulatorTransitModeOverride = null;
  });
```

And the following this test is ok with `KeyDataTransitMode.rawKeyData` but rightly fails with `KeyDataTransitMode.keyDataThenRawKeyData`:

```dart
  testWidgets('Simulates consecutive key down events', (WidgetTester tester) async {
    debugKeyEventSimulatorTransitModeOverride = KeyDataTransitMode.rawKeyData;

    // Simulating several key down events without key up in between is tolerated
    // when transit mode is KeyDataTransitMode.rawKeyData, it will trigger an
    // assert on KeyDataTransitMode.keyDataThenRawKeyData.
    await simulateKeyDownEvent(LogicalKeyboardKey.arrowDown);
    await simulateKeyDownEvent(LogicalKeyboardKey.arrowDown);

    debugKeyEventSimulatorTransitModeOverride = null;
  });
```

## Related Issue

Related to https://github.com/flutter/flutter/issues/143845

## Tests

Adds two tests.
2024-03-07 07:19:26 +00:00
Valentin Vignal 96dd1984ec
Fix memory leak in editable_gesture_test.dart (#144691) 2024-03-06 17:51:54 -08:00
Martin Kustermann aba7bc3f42
Use wasm-compatible conditional import in timeline.dart, avoid emitting timeline events in SchedulerBinding (#144682) 2024-03-06 23:08:24 +01:00
Qun Cheng f38c5ad441
Remove deprecated errorColor from ThemeData (#144078)
This PR is to remove deprecated `ThemeData.errorColor`.

These parameters are made obsolete in https://github.com/flutter/flutter/pull/110162.
Part of https://github.com/flutter/flutter/issues/143956
2024-03-06 20:41:04 +00:00
Andrew Kolos cc33f44e41
make DevFSContent descendants immutable (#144664)
`DevFSBytesContent` (and it's descendant `DevFSStringContent`) have setters that change the underlying content. These are unused outside of tests, so this PR removes them. Amongst other things, this could help me refactor https://github.com/flutter/flutter/pull/144660 into something that has fewer pitfalls.

This is purely a refactoring.
2024-03-06 20:21:41 +00:00
Jonah Williams 2ebd7f0d55
[Impeller] measure GPU memory usage. (#144575)
Framework side to https://github.com/flutter/engine/pull/51187

Part of https://github.com/flutter/flutter/issues/144617
2024-03-06 20:17:31 +00:00
Gray Mackall 9973771cc3
Update android templates to use target sdk 34 (#144641)
We should always target the newest, and 34 is the newest. This isn't a requirement yet (like it is for 33+) but presumably it will be made required in the nearish future.
2024-03-06 19:15:07 +00:00
Greg Price 6b9d3ea4fc
Fill in SliverConstraints fields missing from ==, hashCode, toString (#143661)
I was doing some debugging on a RenderSliver subclass, and found
that SliverConstraints.toString was missing the precedingScrollExtent
field.

Add that, and add both that field and userScrollDirection to the
`==` and hashCode implementations, which had been skipping them,
so that all three methods now handle all the class's fields.
2024-03-06 03:23:18 +00:00
Victoria Ashworth 7e05bc4b30
Fix embedding FlutterMacOS.framework for macOS add2app via cocoapods (#144248)
Fixes https://github.com/flutter/flutter/issues/144244.
2024-03-05 21:59:49 +00:00
Andrew Kolos ff3b6dc02c
Enable asset transformation feature in hot reload workflow (excluding Web) (#144161)
Partial implementation of https://github.com/flutter/flutter/issues/143348

This enables asset transformation during hot reload (except for web, because that has its own implementation of `DevFS` 🙃). Asset transformers will be reapplied after changing any asset and performing a hot reload during `flutter run`.
2024-03-05 21:54:06 +00:00
Tirth 311c0064d8
Adds missing style to PopupMenuButton (#143392)
Adds missing `style` to `PopupMenuButton`.

Fixes: #114709
2024-03-05 19:42:30 +00:00
Michael Goderbauer 2aa1efcf0a
Add regression test for TabBar crash (#144627)
This is a regression test for https://github.com/flutter/flutter/issues/144087 and https://github.com/flutter/flutter/issues/138588.

To be submitted after https://github.com/flutter/flutter/pull/144579.
2024-03-05 19:24:05 +00:00
Andrew Kolos 4e6de2be33
remove unused firstBuildTime parameter in DevFS::update (#144576)
The title says it all. This parameter is unused and serves no apparent purpose.
2024-03-05 19:14:48 +00:00
Michael Goderbauer d93f24ab93
Revert "_DefaultTabControllerState should dispose all created TabContoller instances. (#136608)" (#144579)
This reverts commit 9fa9fd365c.

Fixes https://github.com/flutter/flutter/issues/144087.
Fixes https://github.com/flutter/flutter/issues/138588.

This crash has been reported previously from a customer in google3 in https://github.com/flutter/flutter/issues/138588, but we weren't able to track it down. Thankfully, a repro was now provided in https://github.com/flutter/flutter/issues/144087#issuecomment-1968257383 which traced the crash down to a change made in #136608. This PR reverts that change to fix that crash for now. I will post a new PR shortly that will add a test to cover the use case that caused the crash with #136608 to make sure we don't re-introduce the crash in the future.
2024-03-05 18:41:56 +00:00
Matej Knopp df2b360453
Do not shorten native assets framework names (#144568)
Previously the name was shortened to 15 characters, which doesn't seem
to be necessary.
[CFBundleName](https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundlename)
documentation mentions 15 character length, but that does not seem to be
relevant to framework bundles.

Flutter plugins already have framework bundles with names longer than 15
characters and it is not causing any issues.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

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

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
[Data Driven Fixes]:
https://github.com/flutter/flutter/wiki/Data-driven-Fixes
2024-03-05 14:58:15 +01:00
Bruno Leroux 67e6cad0cb
Restorable CupertinoTextFormFieldRow (#144541)
## Description

This PR makes `CupertinoTextFormFieldRow` restorable.
The implementation is based on https://github.com/flutter/flutter/pull/78835 which made `FormField` and `TextFormField` restorable.

## Related Issue

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

## Tests

Adds 4 tests.
2024-03-05 10:31:04 +00:00
Jonah Williams 89b5f3a717
Disable super flakey impeller test. (#144573)
Until we figure out why this is unstable on Impeller swiftshader, disable it.
2024-03-05 00:16:21 +00:00
Jenn Magder 9b442b2749
Print warning and exit when iOS device is unpaired (#144551)
Explicitly handle the case where the iOS device is not paired.  On `flutter run` show an error and bail instead of trying and failing to launch on the device.

On this PR:
```
$ flutter run -d 00008110-0009588C2651401E
'iPhone' is not paired. Open Xcode and trust this computer when prompted.
$
```

Fixes https://github.com/flutter/flutter/issues/144447
Closes https://github.com/flutter/flutter/pull/144095
2024-03-04 23:01:11 +00:00
LongCatIsLooong de0ccf39c6
Remove unnecessary (and the only) RenderObject.markParentNeedsLayout override (#144466)
Nobody calls it except for `markNeedsLayout`, and the render object is a guaranteed relayout boundary.
2024-03-04 21:58:17 +00:00
Bruno Leroux 16d122dbe2
Fix text color for default CupertinoContextMenuAction (#144542)
## Description

This PR fix the text color for the default action in a CupertiniContextMenu.
Previously the dynamic color was not resolved which leads to text being blacks when theme brightness was dark.

| Before | After |
|--------|--------|
| ![Capture d’écran 2024-03-04 à 14 58 45](https://github.com/flutter/flutter/assets/840911/6a06715d-b2b8-49e1-b6de-37c03b96b627) |  ![Capture d’écran 2024-03-04 à 15 00 27](https://github.com/flutter/flutter/assets/840911/ed7c71ec-96f2-46ca-a5f6-ba3890732e33) |

## Related Issue

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

## Tests

Adds 1 test, updates 1.
2024-03-04 21:36:03 +00:00
Nate 1a0dc8f1e1
Add missing parameter to TableBorder.symmetric, and improve class constructors (#144279)
Originally, my aim was just to refactor (as per usual), but while messing around with the `TableBorder.symmetric` constructor, I realized that `borderRadius` was missing!

This pull request makes a few class constructors more efficient, and it fixes #144277 by adding the missing parameter.

<br>
2024-03-04 20:20:19 +00:00
Matej Knopp 1d7f4a9afa
Fix build mode not propagated in android native asset build (#144550)
This fixes bug where build mode is hardcoded to debug while building
native assets for Android.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

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

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
[Data Driven Fixes]:
https://github.com/flutter/flutter/wiki/Data-driven-Fixes
2024-03-04 21:11:14 +01:00
Qun Cheng 7c50267fa0
Doc fix for DropdownButtonFormField.value (#144427)
Fixes https://github.com/flutter/flutter/issues/144135

This PR is just a doc fix.
2024-03-04 18:52:20 +00:00
Tirth 35863b753f
Fix Small Typo in Skia_Client Doc Comment (#144490)
Fix Small Typo in Skia_Client Doc Comment.
2024-03-04 18:24:13 +00:00
Loïc Sharma cc740eb503
[Windows] Update keyboard modifiers link (#144426)
Updates link to the new location. No tests as this only changes a comment.
2024-03-04 17:13:49 +00:00
Taha Tesser 9a838455e2
Fix showDateRangePicker is missing dartpad tag and cleanup (#144475)
fixes [`showDateRangePicker` interactive sample not loading](https://github.com/flutter/flutter/issues/144474)

### Description 

This fixes `showDateRangePicker` example not loading in Dartpad.

Similar fix was made for `showDatePicker` in https://github.com/flutter/flutter/pull/99401
2024-03-01 15:36:24 +00:00