24332 Commits

Author SHA1 Message Date
aniq
c83cf967cf
Allow customizing entry mode icons in TimePicker (#157151)
This PR adds two new properties to the Material Design `TimePicker`: `switchToInputEntryModeIcon` and `switchToTimerEntryModeIcon`. These allow developers to customize the icons for toggling between dial and input modes, with default icons (`Icons.keyboard_outlined` and `Icons.access_time`) used if none are provided.

Fixes #156942
2024-10-29 10:25:20 +00:00
yim
04bcfe9281
Fix Scaffold extend body (#157441)
Fixes: #157316
2024-10-27 04:54:30 +00:00
Matan Lurey
3af8b0a4df
Tighten up throwToolExit, explain when to use it. (#157561)
Documents when to use `throwToolExit` and how to use it.

Replaces every invocation of `throw ToolExit` with `throwToolExit` and makes the former impossible; this is so that every user will at least (hypothetically) have the chance to read the documentation attached to `throwToolExit` (and if we change parameters in the future they will all flow through one place).
2024-10-26 03:17:24 +00:00
Matan Lurey
82a20e407e
Remove extraneous throw. (#157658)
h/t to @tvolkert for noticing this one!
2024-10-26 02:49:20 +00:00
Polina Cherkasova
9cf98f7273
Create flutter specific leak troubleshooting guidance. (#157396) 2024-10-25 13:25:34 -07:00
Kate Lovett
2c20325af4
Update CupertinoNavigationBar to support large layout (#157133)
Fixes https://github.com/flutter/flutter/issues/149625

This adds a new constructor CupertinoNavigationBar.large for the large style navigation bar. CupertinoSliverNavigationBar enables dynamically changing between the smaller and larger layouts for native iOS headers in response to scrolling, this change makes it possible to configure the static navigation bar in one style or the other.
2024-10-25 19:08:12 +00:00
Jonah Williams
c4c545215a
Support backdrop key in flutter framework. (#157278)
The backdrop key functionality allows multiple backdrop filters to share the same input filter, dramatically improving raster performance. This is only supported on the Impeller backend.

The backdrop key class allocates a new int from a static and passes this to the engine layer. with 64 bit integers, we can allocate many backdrop filter ids per frame and never run out.

See also: https://github.com/flutter/flutter/issues/156455

```dart
import 'dart:math';
import 'dart:ui';

import 'package:flutter/material.dart';

final _random = Random();

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

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

  static final listKey = BackdropKey();
  static final overlayKey = BackdropKey();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        backgroundColor: Colors.white,
        body: Stack(
          children: [
            ListView.builder(
              itemCount: 120, // 60 pairs of red and blue containers
              itemBuilder: (context, index) {
                return Container(
                  height: 100,
                  color: index % 2 == 0 ? Colors.red : Colors.blue,
                );
              },
            ),
            Center(
              child: Container(
                width: 400,
                height: 400,
                decoration: BoxDecoration(
                  border: Border.all(color: Colors.black),
                ),
                child: Image.network('https://picsum.photos/400'),
              ),
            ),
            ListView.separated(
              separatorBuilder: (_, __) => const SizedBox(height: 8),
              itemBuilder: (context, index) => BlurEffect(
                backdropKey: listKey,
                child: SizedBox(
                  height: 50,
                  child: Center(
                    child: Text(index.toString(),
                        style: const TextStyle(color: Colors.white)),
                  ),
                ),
              ),
              itemCount: 200,
            ),
            Positioned.fill(
              bottom: null,
              child: BlurEffect(
                backdropKey: overlayKey,
                child: Padding(
                  padding: EdgeInsets.only(
                    top: MediaQuery.of(context).viewPadding.top,
                  ),
                  child: const SizedBox(height: 45),
                ),
              ),
            ),
            Positioned.fill(
              top: null,
              child: BlurEffect(
                backdropKey: overlayKey,
                child: Padding(
                  padding: EdgeInsets.only(
                    top: MediaQuery.of(context).viewPadding.bottom,
                  ),
                  child: const SizedBox(height: 50),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}

class BlurEffect extends StatelessWidget {
  final Widget child;

  const BlurEffect({
    required this.child,
    required this.backdropKey,
    super.key,
  });

  final BackdropKey backdropKey;

  @override
  Widget build(BuildContext context) {
    return ClipRect(
      child: BackdropFilter(
        backdropKey: backdropKey,
        filter: ImageFilter.blur(
          sigmaX: 40,
          sigmaY: 40,
          // tileMode: TileMode.mirror,
        ),
        child: DecoratedBox(
          decoration: BoxDecoration(color: Colors.black.withOpacity(.65)),
          child: child,
        ),
      ),
    );
  }
}
```

### Skia

<img src="https://github.com/user-attachments/assets/4c08e92d-f0ba-42b2-a4c4-fc44efbcfae0" width="200"/>

### Impeller

<img src="https://github.com/user-attachments/assets/21e95efd-5e0c-4f41-8f84-af3f0e47d1aa" width="200"/>
2024-10-25 16:27:51 +00:00
Mohellebi abdessalem
7e2a06657c
Update flutter.groovy to catch unknown task exception when finding api task (#157282)
see #147122 for context
and [this](https://github.com/flutter/flutter/pull/157221) for more
2024-10-25 14:51:12 +00:00
Matan Lurey
a4167b7cf2
Remove unused PubDependenciesProjectValidator. (#157516)
Closes https://github.com/flutter/flutter/issues/157479.

This came up while I was looking at parsing the results of `dart pub deps --json`, turns out it isn't used.
2024-10-24 22:05:50 +00:00
auto-submit[bot]
b98d9a37ac
Reverts "Upgrade tests to AGP 8.7/Gradle 8.10.2/Kotlin 1.8.10 (#157032)" (#157559)
Reverts: flutter/flutter#157032
Initiated by: gmackall
Reason for reverting: https://github.com/flutter/flutter/pull/157032#issuecomment-2436336078
Original PR Author: gmackall

Reviewed By: {reidbaker, bartekpacia}

This change reverts the following previous change:
I recently noticed the following log when building an app in verbose mode:
```
This Android Gradle plugin (8.1.0) was tested up to compileSdk = 33 (and compileSdkPreview = "UpsideDownCakePrivacySandbox").
You are strongly encouraged to update your project to use a newer
Android Gradle plugin that has been tested with compileSdk = 35.
```

It looks like AGP would like us to use a newer AGP version if we want to use compileSdk 35 (which we do). This pr upgrades the tests, in advance of updating the templates.
2024-10-24 21:06:16 +00:00
Taha Tesser
cdf4a2d109
Deprecate ThemeData.dialogBackgroundColor in favor of DialogThemeData.backgroundColor (#155072)
Related to [☂️ Material Theme System Updates](https://github.com/flutter/flutter/issues/91772)
2024-10-24 20:12:21 +00:00
Gray Mackall
5ca6350a06
Upgrade tests to AGP 8.7/Gradle 8.10.2/Kotlin 1.8.10 (#157032)
I recently noticed the following log when building an app in verbose mode:
```
This Android Gradle plugin (8.1.0) was tested up to compileSdk = 33 (and compileSdkPreview = "UpsideDownCakePrivacySandbox").
You are strongly encouraged to update your project to use a newer
Android Gradle plugin that has been tested with compileSdk = 35.
```

It looks like AGP would like us to use a newer AGP version if we want to use compileSdk 35 (which we do). This pr upgrades the tests, in advance of updating the templates.
2024-10-24 20:08:45 +00:00
Matan Lurey
dc13c3bfb7
Allow opting out of .flutter-plugins, opt-out in refreshPluginsList. (#157527)
Work towards https://github.com/flutter/flutter/issues/48918.

Workaround for https://github.com/flutter/flutter/issues/157391 (see https://github.com/flutter/flutter/pull/157393#issuecomment-2434336047).

I'll run all post-submit tasks as well on this PR using `test: all`.
2024-10-24 20:01:45 +00:00
auto-submit[bot]
73f66a7ea4
Reverts "Reverts "Added a warning if flutter.groovy uses a .flutter-plugins file. (#157388)" (#157541)" (#157549)
Reverts: flutter/flutter#157541
Initiated by: matanlurey
Reason for reverting: Was _not_ the cause of failure, see https://github.com/flutter/flutter/issues/157542.
Original PR Author: auto-submit[bot]

Reviewed By: {fluttergithubbot}

This change reverts the following previous change:
Reverts: flutter/flutter#157388
Initiated by: matanlurey
Reason for reverting: We have `--fatal-warnings` on postsubmit and this breaks the tree.
Original PR Author: matanlurey

Reviewed By: {reidbaker}

This change reverts the following previous change:
Work towards https://github.com/flutter/flutter/issues/48918.

This file was soft deprecated in _2020_, but the code was never removed. This warning message will serve as a warning and we'll rip out support for `flutter-plugins` after the _next_ stable release (i.e. after the mid-November branch cut).
2024-10-24 19:52:25 +00:00
Mairramer
8cc862c727
Changes the offset computation to first item for RenderSliverMainAxisGroup (#154688)
Fixes https://github.com/flutter/flutter/issues/154615
When scrolling back to the top, the position of the first visible item should have its scrollExtent subtracted. Otherwise, the accumulated position may be retained, which may result in the first visible item being hidden in some cases.
2024-10-24 19:23:07 +00:00
Loïc Sharma
bf319d6213
Add partial test for flutter build ios-framework on non-module (#157482)
Add a partial test for running `flutter build ios-framework` on a regular app project (not a module).

Follow-up to this conversation: https://github.com/flutter/flutter/pull/157393/files#r1811810540

Part of https://github.com/flutter/flutter/issues/146957
2024-10-24 18:53:09 +00:00
Loïc Sharma
fe95b2e225
Add example to SafeArea docs (#157228) 2024-10-24 18:53:07 +00:00
auto-submit[bot]
ef99fcbd60
Reverts "Added a warning if flutter.groovy uses a .flutter-plugins file. (#157388)" (#157541)
Reverts: flutter/flutter#157388
Initiated by: matanlurey
Reason for reverting: We have `--fatal-warnings` on postsubmit and this breaks the tree.
Original PR Author: matanlurey

Reviewed By: {reidbaker}

This change reverts the following previous change:
Work towards https://github.com/flutter/flutter/issues/48918.

This file was soft deprecated in _2020_, but the code was never removed. This warning message will serve as a warning and we'll rip out support for `flutter-plugins` after the _next_ stable release (i.e. after the mid-November branch cut).
2024-10-24 18:20:47 +00:00
Matan Lurey
25b55b9f2d
Added a warning if flutter.groovy uses a .flutter-plugins file. (#157388)
Work towards https://github.com/flutter/flutter/issues/48918.

This file was soft deprecated in _2020_, but the code was never removed. This warning message will serve as a warning and we'll rip out support for `flutter-plugins` after the _next_ stable release (i.e. after the mid-November branch cut).
2024-10-24 16:25:09 +00:00
Huy
fa5254331f
Add ability to disable CupertinoSegmentedControl (#152813)
### Summary

Add the ability to configure enabled or disabled segments in CupertinoSegmentedControl. The idea is to pass a `segmentStates` map, where the user can set the state according to segment key. User can also set background and text colors when the segment is disabled.

### Demo

https://github.com/user-attachments/assets/4a02da02-a0fb-4ded-a271-033a8dc79ac3

### Related issue
Fixes https://github.com/flutter/flutter/issues/52105
2024-10-24 12:05:35 +00:00
Taha Tesser
0167f02e90
Update Tab.height parameter doc for tab height lower than default (#157443)
Fixes [TabBar.height adds a gap between the AppBar.toolbar and AppBar.bottom](https://github.com/flutter/flutter/issues/156200)
2024-10-24 09:43:36 +00:00
LouiseHsu
bade5591bf
Prevent flutter build ios-framework --xcframework from copying Flutter.xcframework.dSYM into the App.framework folder. (#157394)
Fixes https://github.com/flutter/flutter/issues/157359

Prevents Flutter.xcframework.dSYM from being copied into the App.framework folder. I am not 100% positive if there are cases where it's valid to have multiple dSYMs in that folder, so I'm just string matching and filtering out `Flutter.xcframework.dSYM`
2024-10-23 23:35:10 +00:00
LongCatIsLooong
2d3697216b
Turn brieflyShowPassword back on on iOS (#157466)
Fixes https://github.com/flutter/flutter/issues/115359

This patch should restore the `brieflyShowPassword` behavior on iOS before https://github.com/flutter/flutter/pull/104335.

On iOS new characters are still temporarily revealed if the user is entering using the software keyboard (potentially because it's easy to fat finger using on screen keyboards?).
2024-10-23 23:22:15 +00:00
Mohellebi abdessalem
c155e30467
small update in regex in flutter.groovy (#156484)
see #147122 for more context
`/(\\ |[^\s])+/ ` and `/(\\ |\S)+/` are basically equivalant but the
last one won't trigger android Studio warnings
## 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.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

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

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#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/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

Co-authored-by: Andrew Kolos <andrewrkolos@gmail.com>
2024-10-23 16:31:07 -04:00
Elliott Brooks
802bae0111
Allow requesting a reduced widget tree with getRootWidgetTree service extension (#157309) 2024-10-23 12:30:55 -07:00
Bruno Leroux
b9c889d7d0
Reland "Fix TextField selects all content after the application is resumed" (#157399)
## Description

Relands https://github.com/flutter/flutter/pull/156968 wich was reverted in https://github.com/flutter/flutter/pull/157378 

This PR makes `EditableText` aware of the lifecycle 'resumed' state to let the current selection unchanged when the application is resumed (on web and desktop, 'resumed' means the Flutter app window regained focus).

Before this PR, on web and desktop, the whole content of a `TextField` was selected whenever a `TextField` gained focus. This is the correct behavior when tabbing between fields but it is not when a field regains focus after the application is resumed 

## Related Issue

Fixes [When switching to another browser tab or window and then going back, all text on TextField is selected automatically](https://github.com/flutter/flutter/issues/156078).

## Tests

Adds 1 test.
2024-10-23 15:13:35 +00:00
Polina Cherkasova
9441f8f6c8
Upgrade leak tracker. (#157369) 2024-10-23 00:42:28 +00:00
Nate Wilson
ea0fda51ef
WidgetStateInputBorder (#157190)
**Changes**
- Add `WidgetStateInputBorder` class, with `.resolveWith()` and `.fromMap()` constructors
- Deprecate `MaterialStateOutlineInputBorder` and `MaterialStateUnderlineInputBorder` and provide data-driven fixes

<br>

**Other changes** based on https://github.com/flutter/flutter/pull/154972#pullrequestreview-2344092821
- Fix documentation copy-paste typo ("OutlinedBorder" → "InputBorder")
- Add test to ensure borders are painted correctly
- Add DartPad sample & relevant test
2024-10-22 23:45:41 +00:00
Loïc Sharma
b2026572db
Add example to Directionality docs (#157230) 2024-10-22 22:20:02 +00:00
Loïc Sharma
bfdb366b50
Add example to ClipOval docs (#157227) 2024-10-22 22:20:00 +00:00
Matan Lurey
5a1ae9779d
Remove the only reference to settings.gradle.legacy_versions. (#157380)
Code references:
https://github.com/search?q=repo%3Aflutter%2Fflutter%20%22legacy_versions%22&type=code.

Closes https://github.com/flutter/flutter/issues/87922.

Work towards https://github.com/flutter/flutter/issues/48918.
2024-10-22 14:03:50 -07:00
Loïc Sharma
945067ae91
Remove duplicated widget of the week video embed (#157299)
The `ScaffoldMessenger` widget embeds its widget of the week video twice: https://main-api.flutter.dev/flutter/material/ScaffoldMessenger-class.html
2024-10-22 20:34:24 +00:00
auto-submit[bot]
60d4c9b741
Reverts "Fix TextField selects all content after the application is resumed (#156968)" (#157378)
Reverts: flutter/flutter#156968
Initiated by: jacobsimionato
Reason for reverting: Google3 roll failing - see b/375019489
Original PR Author: bleroux

Reviewed By: {justinmc, gspencergoog}

This change reverts the following previous change:
## Description

This PR makes `EditableText` aware of the lifecycle 'resumed' state to let the current selection unchanged when the application is resumed (on web and desktop, 'resumed' means the Flutter app window regained focus).

Before this PR, on web and desktop, the whole content of a `TextField` was selected whenever a `TextField` gained focus. This is the correct behavior when tabbing between fields but it is not when a field regains focus after the application is resumed 

## Related Issue

Fixes [When switching to another browser tab or window and then going back, all text on TextField is selected automatically](https://github.com/flutter/flutter/issues/156078).

## Tests

Adds 1 test.
2024-10-22 19:59:22 +00:00
René Kilczan
48149781f2
Add windows build version detection (#154797)
With this PR flutter doctor will report the actual Windows version. This
resolves #154796

<!-- *If you had to change anything in the [flutter/tests] repo, include
a link to the migration guide as per the [breaking change policy].* -->

The flutter doctor result is with this patch like this:
```
[√] Flutter (Channel stable, 3.24.2, on Microsoft Windows [Version 10.0.22631.4037], locale de-DE)
[√] Windows Version (Windows 11 - 23H2)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.8.3)
[√] Android Studio (version 2024.1)
[√] Connected device (3 available)
[√] Network resources

• No issues found!
```

## 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/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#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/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Andrew Kolos <andrewrkolos@gmail.com>
2024-10-22 15:53:08 -04:00
Jenn Magder
e38eb756bc
Test alternate correct macOS framework xcprivacy manifest location (#157318)
Cherry-pick the beta branch test https://github.com/flutter/flutter/pull/157136 back to master  so this doesn't regress in the next beta.

This is the framework test for https://github.com/flutter/flutter/issues/157016 on master.  Engine fix can be merged once this merges.
2024-10-22 19:41:14 +00:00
João Victor Schramm
1d5087eb30
fix: CupertinoDatePicker.DateAndTime using showDayOfWeek (#155260)
As mentioned in the issue https://github.com/flutter/flutter/issues/153576, even if we declare the 'showDayOfWeek' value as false, when using the mode CupertinoDatePickerMode.dateAndTime, the days of week still shows in the screen.

This PR is about making an assert that prevent developers from using `DateTimePicker.DateAndTime` with `showDayOfWeek` as false (because it only works on date mode) as suggested by @Piinks.
2024-10-22 19:37:19 +00:00
romain.gyh
21814805c1
fix: Considers strokeAlign to compute border dimensions (#155495)
Fixes #155491 

## 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.
- [ ] 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.
- [ ] All existing and new tests are passing.

There are 3 golden tests that don't pass on my computer, but they were
already not passing before my changes.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#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/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
2024-10-22 12:02:02 -07:00
Bruno Leroux
260bee4d08
Fix MenuController.isOpen throws when unattached (#157331)
## Description

This PR change `MenuController.isOpen` to return false when the `MenuController` is not attached.
Previously `MenuController.isOpen` thrown an assert error when the menu controller was unattached.
With this PR, it is now possible to have some widgets outside the `MenuAnchor` body depending on the menu controller state.

## Related Issue

Fixes [Querying isOpen state for a menu controller that was never attached throws an assertion error](https://github.com/flutter/flutter/issues/157329).

## Tests

Adds 1 test.
2024-10-22 18:49:15 +00:00
Mouad Debbar
e9fb545c05
[web] Allow control of hitTestBehavior of Platform Views (#157189)
Hit testing behavior is currently hardcoded to `opaque`  in `HtmlElementView` which causes the platform view to swallow pointer events when it's a descendant of a `GestureDetector` (see this [example](https://dartpad.dev/?id=5348fbf82be5eeb7d995f953437f0ce6)).

In order to fix this, we need to make `hitTestBehavior` configurable in `HtmlElementView`. This way users can decide to make their platform views `transparent` for hit testing purposes.

**_Note_**: this specific case isn't fixable by `PointerInterceptor` because the framework is already receiving the pointer events, so there's nothing that `PointerInterceptor` can do. This issue is all happening on the framework side since it treats the rectangle occupied by the platform view as an opaque rectangle for hit testing.

**_Workaround_**: in the meantime, users can work around this limitation by surrounding the `HtmlElementView` with an `IgnorePointer` widget.
2024-10-22 17:53:17 +00:00
Jiten Patel
5fa5a64842
[#155269] Platform adaptive showAboutDialog and AboutDialog feature c… (#155377)
This PR introduces a new `showAdaptiveAboutDialog` function, ensuring that the About dialog matches the platform’s design (Material for Android, Fuchsia, Linux, Windows, and, Cupertino for iOS & macOS), providing a more consistent user experience across platforms.

Fixes #155269 

- [] I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
2024-10-22 17:32:05 +00:00
Bartek Pacia
eb5ef69d6b
Use Gradle KTS in new Android app projects by default (2nd try) (#157195)
This PR resolves #151166

This PR relands #154061
2024-10-22 17:28:31 +00:00
Polina Cherkasova
9edd1ae008
Fix leaks in some image tests and explain hackyness of opted-out. (#154481) 2024-10-22 10:22:01 -07:00
Jiten Patel
3e9901dac9
Fix: showDatePicker should have a simple example in the docs (#156196)
This PR introduces a basic example of how to use the `showDatePicker` function. The purpose of this PR is to simplify the onboarding process for new Flutter developers by providing a straightforward demonstration of handling the asynchronous Future returned by the showDatePicker. This will help users unfamiliar with the intricacies of asynchronous operations in Flutter.

Fixes #156157
2024-10-22 17:04:23 +00:00
Bruno Leroux
383a221cf3
Fix TextField selects all content after the application is resumed (#156968)
## Description

This PR makes `EditableText` aware of the lifecycle 'resumed' state to let the current selection unchanged when the application is resumed (on web and desktop, 'resumed' means the Flutter app window regained focus).

Before this PR, on web and desktop, the whole content of a `TextField` was selected whenever a `TextField` gained focus. This is the correct behavior when tabbing between fields but it is not when a field regains focus after the application is resumed 

## Related Issue

Fixes to [When switching to another browser tab or window and then going back, all text on TextField is selected automatically](https://github.com/flutter/flutter/issues/156078).

## Tests

To be done
2024-10-22 04:41:31 +00:00
Jason Simmons
8b4d48715b
Ensure that the build system checks for updates of locally built flutter_web_sdk artifacts (#156534)
The SourceVisitor uses the engineVersion parameter to determine whether it needs to check for changes to artifacts or if it can assume that artifacts are unmodified from a versioned build of the engine.  engineVersion is set based on whether the Artifacts instance sets the isLocalEngine property.

CachedLocalWebSdkArtifacts (instantiated when the --local-web-sdk flag is used) was only setting isLocalEngine if --local-engine was also used.  This caused the build system to ignore changes to the files in the locally built flutter_web_sdk when using --local-web-sdk alone.

This PR renames Artifacts.isLocalEngine to usesLocalArtifacts in order to clarify what it means.  It also changes CachedLocalWebSdkArtifacts to always enable usesLocalArtifacts.
2024-10-21 22:52:29 +00:00
Polina Cherkasova
4b169a81ea
Fix some leaky tests. (#157294) 2024-10-21 21:29:05 +00:00
Mohellebi abdessalem
fba8c5770f
fix Consider using 'named' to avoid unnecessary configuration inside flutter.groovy (#157221)
see #147122 for context
[gradle docs](https://docs.gradle.org/current/userguide/task_configuration_avoidance.html) for reference(scroll until [this)](https://docs.gradle.org/current/userguide/task_configuration_avoidance.html#eager_apis_to_avoid)

also this the lint : 
![Capture d’écran 2024-10-19 094417](https://github.com/user-attachments/assets/8278c72e-068e-4596-b1ce-7888161bfcc8)
2024-10-21 19:56:18 +00:00
Parker Lougheed
2336329baf
Resolve pupup menu test TODO (#157251)
Flutter no longer supports versions of Dart that will output the non-reified version.
2024-10-21 19:52:30 +00:00
Parker Lougheed
1995a6cba1
Migrate away from deprecated whereNotNull (#157250) 2024-10-21 19:25:54 +00:00
Parker Lougheed
a0a82f2821
Fix a few typos in framework code and doc comments (#157248) 2024-10-21 19:25:52 +00:00