23777 Commits

Author SHA1 Message Date
Jason Simmons
31c3d0927b
Do not cancel the VmService's subscription to the isolate event stream in FlutterVmService.findExtensionIsolate (#153607)
The stream subscriptions in the device's VmService are used by other parts of FlutterVmService and other components throughout flutter_tools.  Components that listen to streams should not call VmService.streamCancel because that will interfere with other users who still want the events.

See https://github.com/flutter/flutter/issues/153049
See https://github.com/flutter/flutter/issues/153563
2024-08-19 17:40:07 +00:00
kzrnm
ea477d5981
[gen_l10n] isCustomDateFormat accepts an actual boolean (#153439)
Fixes #153420

## 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.
- [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
2024-08-18 08:57:30 -07:00
flutter-pub-roller-bot
55b9c5a571
Roll pub packages (#153581)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-08-17 00:44:08 +00:00
Michael Goderbauer
d9dbefc949
fix some unintended HTML tags in docs (#153507)
I used the `unintended_html_in_doc_comment` to find these, but sadly the lint is not ready to be enabled yet due to https://github.com/dart-lang/linter/issues/5065.
2024-08-16 23:17:14 +00:00
Andrew Kolos
080928dda3
add HttpException to the list of handled exceptions within ResidentWebRunner::run (#153527)
Resolves https://github.com/flutter/flutter/issues/153298, a major crasher of the flutter tool. I plan on cherry-picking this change.

In `ResidentWebRunner::run`, many connection-related exceptions are caught, logged, and have `ToolExit`s thrown in their place ([code](d23be7a07d/packages/flutter_tools/lib/src/isolated/resident_web_runner.dart (L370-L385)), [PR that introduced this](https://github.com/flutter/flutter/pull/50895)). However, `HttpException` is not included in this list. See https://github.com/flutter/flutter/issues/153298#issuecomment-2290900158 for details if interested.
2024-08-16 16:40:19 +00:00
Loïc Sharma
15876ff6ea
[Swift Package Manager] Test removing the last Flutter plugin (#153519)
The Flutter tool has a bug where removing the last Flutter plugin does not correctly update the CocoaPods integration.

This adds a test to ensure  that the generated Swift package is properly updated when the last Flutter plugin is removed.

See: https://github.com/flutter/flutter/issues/11819#issuecomment-2289782626
2024-08-16 14:03:13 +00:00
Joe Kawai
5d59f8bb1a
Add TextHeightBehavior argument for DefaultTextStyle.merge (#153178)
Addresses an issue where `DefaultTextStyle.merge` is missing the `textHeightBehavior` argument. The argument is present in the `DefaultTextStyle` constructor.

Resolves #120176
2024-08-15 23:00:15 +00:00
RamonFarizel
81ee230f49
Update TextTheme with the M3 Typography tokens (#153131)
This PR adds a new table with[ Material 3 typography tokens](https://m3.material.io/styles/typography/type-scale-tokens).

Issue:
https://github.com/flutter/flutter/issues/148429
2024-08-15 22:48:58 +00:00
Greg Spencer
1633c47dda
Improve asserts on Element.mount (#153477)
## Description

In debugging an issue with mount, I hit one of these asserts, and I thought it would be a much better assert with some context.

## Tests
 - No test changes because the change is only to the output string of an assert.
2024-08-15 21:30:03 +00:00
Bernardo Ferrari
ce63c029c5
Fix anti-aliasing when painting borders with solid colors. (#153365)
Trying to reland https://github.com/flutter/flutter/pull/122317 in 2024. Let's see if we can.

<img width="666" alt="image" src="https://user-images.githubusercontent.com/351125/182002867-03d55bbb-163d-48b9-ba3c-ed32dbef2680.png">

Side effect: shapes with border will be rounder:
![Frame 6](https://github.com/user-attachments/assets/95324ebc-8db5-4365-817f-bc62304b9044)

Close https://github.com/flutter/flutter/issues/13675.
2024-08-15 19:02:23 +00:00
flutter-pub-roller-bot
70460854d1
Roll pub packages (#153479)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-08-15 16:39:28 +00:00
Qun Cheng
108a355453
Update tokens to 5.0.0 (#153385)
This PR is to
* Update the Material Design tokens to 5.0.0
* 4 color roles in **Light mode** have different default values
   `onPrimaryContainer`: Primary10  -> Primary30 
   `onSecondaryContainer`: Secondary10 -> Secondary30
   `onTertiaryContainer`: Tertiary10 -> Tertiary30
   `onErrorContainer`: Error10 -> Error30
    
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;![Screenshot 2024-08-13 at 12 53 03 PM](https://github.com/user-attachments/assets/bfa863d9-03d3-4557-8676-d56febdb2be5)

* new tokens added in list.json
* `md.comp.menu.list-item.*` tokens are deprecated and should be replaced by tokens in list.json and we've done the migration last year:)!(#122388)
2024-08-14 22:53:36 +00:00
Denis Bowen
51c640297f
Slider shows visual label of value on focus (#152960)
Fixed issue to where value indicator label is not shown to user when initially focused.

Before:  [Screen recording 2024-08-05 12.16.24 PM.webm](https://github.com/user-attachments/assets/806e94d7-7c6c-40e5-93af-dbf2fb9e0dd4)
After: https://screencast.googleplex.com/cast/NTY5NzIzMTYxNjIxMjk5MnxkY2IyMGNkYi1iZA

Fixes https://github.com/flutter/flutter/issues/113538
2024-08-14 18:27:14 +00:00
Taha Tesser
ed40925bb1
Add Row and Column widgets specific spacing tests (#153353)
Fixes [Missing `Row` and `Column` widgets specific `spacing` tests](https://github.com/flutter/flutter/issues/153352)
2024-08-14 18:19:17 +00:00
PurplePolyhedron
b5847d364a
Delay DropdownMenu filtering until text input (#152368)
fixes https://github.com/flutter/flutter/issues/152055

Disabling filtering in `DropdownMenu` at start and after a selection has been made, and re-enable it (if `widget.enableFilter` is true) after text input.
This way it doesn't hide all other options when there is an existing selection.

Note: currently this may crush due to issue https://github.com/flutter/flutter/issues/151878 . Which is not directly related to this PR
2024-08-14 18:06:14 +00:00
Martin Kustermann
354902f7ca
[web] Pass --no-source-maps instead of --extra-compiler-option=--no-source-maps to dart compile wasm (#153417) 2024-08-14 12:00:24 +02:00
PurplePolyhedron
593729165d
Move @_debugOnly documentation in framework.dart to be more visible to IDE. (#153134)
Change the location of the documentation of `@_debugOnly` following the style of `@override` so it is visible to IDE where the annotation is used.
2024-08-14 01:13:34 +00:00
flutter-pub-roller-bot
5f99d5782a
Roll pub packages (#153380)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-08-13 19:12:24 +00:00
Victor Sanni
cc5d08bc79
Make CupertinoButton interactive by keyboard shortcuts (#153126)
This should have been added with https://github.com/flutter/flutter/pull/150721.
2024-08-12 23:14:05 +00:00
Jason Simmons
5a04b4dda9
Disable DevTools when running the hot restart integration test in flutter_tools (#153247)
When DevTools is active HotRunner.attach makes a deferred RPC to a DevTools service.  That RPC appears to cause issues if it executes at the wrong time during the hot restart.

Passing the --no-devtools flag works around this by disabling the RPC.

See https://github.com/flutter/flutter/issues/153049
2024-08-12 19:57:22 +00:00
Jamie Kerber
dae3a87d93
Implemented CupertinoButton new styles/sizes (fixes #92525) (#152845)
This PR fixes #92525 and introduces the following changes according to [latest iOS HIG](https://developer.apple.com/design/human-interface-guidelines/buttons#iOS-iPadOS):

- `CupertinoButton` now has a `size` property (type `enum CupertinoButtonSize`, values sm/md/lg, default `lg`) that allows the devs to apply new iOS 15+ button styles
- Previously `CupertinoButton` had a larger padding when no background color was specified. With the new HIG, that is no longer the case
- `CupertinoButton` now has a `.tinted` constructor that renders a translucent background (transparency % is brightness-dependent) and uses a different foreground color compared to `.filled`
- `CupertinoButton` now uses the `actionTextStyle` TextStyle from the given theme
- `CupertinoButton`'s child IconTheme's size will always be x1.2 the given TextStyle's size
- `CupertinoTextThemeData` now has a `actionSmallTextStyle` property to use with small buttons (including a default `_kDefaultActionSmallTextStyle` TextStyle)

Preview & example:

![image](https://github.com/user-attachments/assets/0985eb19-c091-41f5-bd98-0de196b7e403)

> **NOTE**: there is a discrepancy in dark mode button foreground color between the default CupertinoTheme and the HIG. A separate issue will be opened for this.

~EDIT: issue reported here https://github.com/flutter/flutter/issues/152846~
EDIT2: fixed by #153039 !

![image](https://github.com/user-attachments/assets/d671d7b4-bb2f-4b38-9464-ee1b04927304)

## Example
```dart
import 'package:flutter/cupertino.dart';

const Widget body = Row(
  mainAxisSize: MainAxisSize.min,
  mainAxisAlignment: MainAxisAlignment.center,
  children: <Widget>[
    Icon(
      CupertinoIcons.play_fill,
    ),
    Text("Play"),
  ],
);

void main() =>
  runApp(
    CupertinoApp(
      home: Container(
        child: Wrap(
        direction: Axis.horizontal,
        children: <Widget>[
          // header
          Text(''),
          Text('Plain'),
          Text('Grey'),
          Text('Tinted'),
          Text('Filled'),
          // small
          Text('Small'),
          CupertinoButton(
            child: body,
            onPressed: () {},
            size: CupertinoButtonSize.small,
          ),
          CupertinoButton.tinted(
            child: body,
            onPressed: () {},
            size: CupertinoButtonSize.small,
            color: CupertinoColors.systemGrey,
          ),
          CupertinoButton.tinted(
            child: body,
            onPressed: () {},
            size: CupertinoButtonSize.small,
          ),
          CupertinoButton.filled(
            child: body,
            onPressed: () {},
            size: CupertinoButtonSize.small,
          ),
          // medium
          Text('Medium'),
          CupertinoButton(
            child: body,
            onPressed: () {},
            size: CupertinoButtonSize.medium,
          ),
          CupertinoButton.tinted(
            child: body,
            onPressed: () {},
            size: CupertinoButtonSize.medium,
            color: CupertinoColors.systemGrey,
          ),
          CupertinoButton.tinted(
            child: body,
            onPressed: () {},
            size: CupertinoButtonSize.medium,
          ),
          CupertinoButton.filled(
            child: body,
            onPressed: () {},
            size: CupertinoButtonSize.medium,
          ),
          // large
          Text('Large'),
          CupertinoButton(
            child: body,
            onPressed: () {},
            size: CupertinoButtonSize.large,
          ),
          CupertinoButton.tinted(
            child: body,
            onPressed: () {},
            color: CupertinoColors.systemGrey,
            size: CupertinoButtonSize.large,
          ),
          CupertinoButton.tinted(
            child: body,
            onPressed: () {},
            size: CupertinoButtonSize.large,
          ),
          CupertinoButton.filled(
            child: body,
            onPressed: () {},
            size: CupertinoButtonSize.large,
          ),
        ].map((Widget w) => SizedBox(width: 110, height: 70, child: Center(child: w))).toList(),
      ),
      )
    ),
  );

```

*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-08-12 19:26:39 +00:00
flutter-pub-roller-bot
2f0415f37b
Roll pub packages (#153297)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-08-12 18:41:58 +00:00
Kishan Rathore
33c05da7a0
Refactor: Deprecate inactiveColor from cupertino checkbox (#152981)
Refactor: Deprecate `inactiveColor` from cupertino checkbox
Fixes #151252
2024-08-12 18:29:07 +00:00
Gray Mackall
814e49be49
Upgrade module template AGP version (#151675)
Follow up to https://github.com/flutter/flutter/pull/151433.
2024-08-12 18:17:41 +00:00
Chris Bracken
c375dd8d72
[iOS] Copy Flutter.framework.dSYM into app archive (#153215)
As of Xcode 16, App Store validation now requires that apps uploaded to the App store bundle dSYM debug information bundles for each Framework they embed.

dSYM bundles are packaged in the Flutter.xcframework shipped in the `ios-release` tools archive as of engine patches:
* https://github.com/flutter/engine/pull/54414
* https://github.com/flutter/engine/pull/54458

This copies the Flutter.framework.dSYM bundle from the tools cache to the app archive produced by `flutter build ipa`.

Issue: https://github.com/flutter/flutter/issues/116493
2024-08-10 16:39:04 +00:00
Bruno Leroux
5609019500
Expose affixes icon constraints in InputDecorationTheme (#153089)
## Description

This PR makes the existing `InputDecoration.prefixIconConstraints` and `InputDecoration.suffixIconConstraints` configurable from an `InputDecorationTheme`.

## Related Issue

Related to https://github.com/flutter/flutter/issues/138691 (this is needed before providing a fix or a workaround for it).

## Tests

Update and split one existing test into two different tests.
Update the existing test related to debugFillDescription by adding all the non tested properties.
2024-08-09 22:04:56 +00:00
Justin McCandless
ed47c4bb1f
Spell check range error (#153055)
Fixed a bug in spell checkers, especially custom ones, where deleting characters rapidly threw an error.
2024-08-09 13:52:06 -07:00
Victor Sanni
0c9b2e5832
Move Cupertino focus constants to cupertino/constants.dart (#153115) 2024-08-09 17:34:11 +00:00
Alexander Aprelev
22e6af6b81
Fix tests expectations regarding new lines. (#153174)
Fixes https://github.com/flutter/flutter/issues/153163

Dart sdk change that affected tests is
e8c035308b
2024-08-09 10:31:48 -07:00
Martin Kustermann
493c453d57
Make ios_deploy_test.dart more robust (#153147)
The test should not assume that a stream of bytes delivers them in a
certain chunked order (e.g. all bytes of a line are delivered in one
chunk and the newline comes in another chunk).

Instead it should use a line splitter to obtain individual lines and can
match those against expectations.

This fragile test is broken after [0] which combines writing a string
together with the newline instead of seperately.

[0] https://dart-review.googlesource.com/c/sdk/+/378024
2024-08-09 12:53:15 +02:00
Jenn Magder
6c3677c6e9
Remove -sdk for watchOS simulator in tool (#152992)
Fix the xcodebuild flags mixing up the iOS and watchOS simulators.

Confirmed this passed in CI on Xcode 16 beta 5: https://github.com/flutter/flutter/pull/152408

Fixes https://github.com/flutter/flutter/issues/152983
See also https://github.com/flutter/flutter/pull/152347
2024-08-08 19:34:20 +00:00
Kevin Moore
a04ecb2b72
Roll pub packages [manual] (#153066) 2024-08-08 17:08:07 +00:00
Jason Simmons
d23be7a07d
[web] Fix reading of the --local-web-sdk flag and remove the copy of useLocalWebSdk in DebuggingOptions (#152642) 2024-08-08 16:27:21 +00:00
yim
14cd5fa30a
The PopupMenuButton should not steal focus from the TextField when it appears. (#150568)
Fixes: #24843
Fixes: #50567
2024-08-08 16:09:18 +00:00
LouiseHsu
51606f99a4
Fix flutter build ipa --export-method not accepting enterprise flag (#153047)
When implementing the fix for https://github.com/flutter/flutter/issues/149369, I missed accounting for the `enterprise` flag for `flutter build ipa` 😬

Fixes https://github.com/flutter/flutter/issues/153000
2024-08-08 16:07:27 +00:00
Bruno Leroux
64b373b1f2
Clean up MenuAnchor (#152946)
## Description

This PR cleans up some typos and formatting issues in the `material/menu_anchor.dart` file and associated tests.
2024-08-07 23:39:24 +00:00
James Kerber
dc4d64c9c2
Set default Cupertino primaryContrastingColor to white (#153039)
**Fixes #152846 in accordance with iOS HIG**

Previously the `_CupertinoThemeDefaults _kDefaultTheme` would set the `primaryContrastingColor` to `CupertinoColors.systemBackground`, which was white-ish in light mode, and black-ish in dark mode. That was in accordance with Apple Design Resources from 5 years ago.

> Before:
> <img width="594" alt="image" src="https://github.com/user-attachments/assets/63e88abb-6933-446f-a7ba-55109d0f353c">

As of now, iOS HIG suggests that the `primaryContrastingColor` (in combination with the currently default `primaryColor: CupertinoColors.systemBlue`) be white (regardless of light/dark modes, contrast, elevation, etc.)

> After:
> <img width="594" alt="image" src="https://github.com/user-attachments/assets/2a48f22b-a886-46dd-aada-6d157cb4ac06">

Example code:
```dart
import 'package:flutter/cupertino.dart';
import 'package:flutter/widgets.dart';

void main() =>
  runApp(
    CupertinoApp(
      theme: CupertinoThemeData(
        brightness: Brightness.dark,
      ),
      home: Center(child:
        CupertinoButton.filled(
          onPressed: () {},
          child: Row(
            mainAxisSize: MainAxisSize.min,
            children: <Widget>[
              Icon(CupertinoIcons.add),
              Text('Add'),
            ],
          ),
          )
      )
    )
  );

```
2024-08-07 23:33:23 +00:00
Tyler Holland
88fa6210ad
Allow dropdown_menu to accept any EdgeInsetsGeometry (#153053)
Allow dropdown_menu to accept any EdgeInsetsGeometry instead of just strictly EdgeInsets.

This follows normal Flutter widget practices when accepting a padding parameter, like Container: https://github.com/flutter/flutter/blob/main/packages/flutter/lib/src/widgets/container.dart#L307C9-L307C27

Fixes https://github.com/flutter/flutter/issues/151769
2024-08-07 21:38:34 +00:00
Jenn Magder
715e476545
Add xcresulttool --legacy flag for deprecated usage (#152988)
Workaround to add the `--legacy` flag until https://github.com/flutter/flutter/issues/151502 can adopt the non-deprecated usage.

This will allow Xcode errors to be parseable again.

Fixes https://github.com/flutter/flutter/issues/152989
2024-08-07 19:59:11 +00:00
Yegor
e8d2e5814e
[web] hide the --web-renderer option in the tool (#152683)
Hide the `--web-renderer` option in the Flutter Tool. The defaults already cover all fully supported modes:

- `flutter build web` provides canvaskit + dart2js
- `flutter build web --wasm` provides skwasm + dart2wasm

We do not want to encourage production usage of any other permutations (e.g. `auto` or `html`), in particular those that simply do not work (e.g. `skwasm` + dart2js).

Fixes https://github.com/flutter/flutter/issues/140096
Fixes https://github.com/flutter/flutter/issues/151786
2024-08-07 18:40:58 +00:00
Michael Goderbauer
7c8feb94a5
Doc imports again (#152958)
https://github.com/flutter/flutter/issues/150800

The only remaining reports of `comment_references` are now because of the known issues listed in https://github.com/flutter/flutter/issues/150800.
2024-08-07 18:32:37 +00:00
davidhicks980
1f4c6ebc97
MenuAnchor hover traversal fixes (#150914)
Fixes https://github.com/flutter/flutter/issues/150910 and https://github.com/flutter/flutter/issues/150911. 

https://github.com/flutter/flutter/issues/150910 is fixed by invalidating the focus scope whenever a hover occurs. I'm interested to hear of better fixes -- it feels a bit extreme to invalidate the focus scope so often.

https://github.com/flutter/flutter/issues/150911 is fixed by replacing TextButton.onHover with MouseRegion.onHover and MouseRegion.onExit. The issue appears to be that MouseRegion.onEnter is called on scroll, whereas MouseRegion.onHover is not. I'm not confident this is a great solution, so please let me know if you all have any suggestions!

@Piinks @dkwingsmt
2024-08-07 17:43:00 +00:00
Kishan Rathore
0f7bceb9c4
Style: Rename CupertinoSwitch activeColor and trackColor to activeTrackColor and InactiveTrackColor (#151367)
Style: Rename CupertinoSwitch `activeColor` and `trackColor` to `activeTrackColor` and `InactiveTrackColor`

Resolves #151256
2024-08-07 17:42:57 +00:00
Bruno Leroux
d595e98d85
Fix PageController throws when changing page before viewPortDimensions are set (#153017)
## Description

This PR fixes `PageController` throwing when using `jumpToPage` or `animateToPage` to switch page before the viewport dimensions were retrieved.

Solution based on https://github.com/flutter/flutter/pull/152947#discussion_r1706203170.

## Related Issue

Fixes https://github.com/flutter/flutter/issues/86222.
Fixes https://github.com/flutter/flutter/issues/152079

## Tests

Adds 2 tests.
2024-08-07 16:45:53 +00:00
auto-submit[bot]
72432c3f15
Reverts "[tool] Guard process writes to frontend server in ResidentCompiler (#152358)" (#153028)
Reverts: flutter/flutter#152358
Initiated by: zanderso
Reason for reverting: Speculative revert to determine whether this PR is related to https://github.com/flutter/flutter/issues/153026
Original PR Author: andrewkolos

Reviewed By: {christopherfujino}

This change reverts the following previous change:
Contributes to fixing https://github.com/flutter/flutter/issues/137184.
Cleaned up version of earlier PR, https://github.com/flutter/flutter/pull/152187.

This PR guards all the writes to `Process::stdin` by wrapping them with `ProcessUtils.writelnToStdinUnsafe`. This way, if any writes fail, we should at least get a stacktrace in our crash reporting.
2024-08-07 16:11:26 +00:00
Renzo Olivares
0a7f8af6d1
Support clearing selection programmatically through SelectableRegionState (#152882)
This change exposes:
* `SelectableRegionState.clearSelection()` to allow a user to programmatically clear the selection.
* `SelectionAreaState`/`SelectionAreaState.selectableRegion` to allow a user to access public API in `SelectableRegion` from `SelectionArea`.

Fixes #126980
2024-08-06 23:05:03 +00:00
Andrew Kolos
d848262fc4
[tool] Guard process writes to frontend server in ResidentCompiler (#152358)
Contributes to fixing https://github.com/flutter/flutter/issues/137184.
Cleaned up version of earlier PR, https://github.com/flutter/flutter/pull/152187.

This PR guards all the writes to `Process::stdin` by wrapping them with `ProcessUtils.writelnToStdinUnsafe`. This way, if any writes fail, we should at least get a stacktrace in our crash reporting.
2024-08-06 21:51:48 +00:00
Zachary Anderson
c4e19962bb
Fix Linux_android_emu tests late initialization errors (#152932)
This does not fix the issue underlying
https://github.com/flutter/flutter/issues/152684, but may prevent `adb
logcat` from ending before we've captured the logs that explain why the
app or emulator are potentially crashing.

Fixes Fixes https://github.com/flutter/flutter/issues/152899
2024-08-06 14:48:50 -07:00
davidhicks980
faabe3af72
[material/menu_anchor.dart] MenuAnchor focus refactoring for RawMenuAnchor (#150950)
This PR is aimed at (1) reducing the private API surface of _MenuAnchorState to make migration into RawMenuAnchor simpler, and (2) fixing focus-related bugs. 

Directional focus handling was moved from MenuAnchor (_MenuDirectionalFocusAction, _MenuNextFocusAction, and _MenuPreviousFocusAction) into SubmenuButton (_SubmenuDirectionalFocusAction). MenuAnchor now behaves similarly to a flat FocusScope, which makes it easier to customize. A future PR will ideally expose or remove the remaining internals (_lastItemFocusNode, _firstItemFocusNode, _isRoot, etc). All previous framework tests are passing, and additional tests were added for fixes (MenuAnchor tab traversal, reopened menus not being focusable), and to test MenuAnchor focus behavior separately from MenuBar. 

However, [one example test](https://github.com/flutter/flutter/pull/150950/files#diff-a33fa01b59d280784e7c8ed6b704bd005cde95b7d3b649dc82fd58530061a09d) had to be changed. I'm not sure why the previous example test was working to begin with, as submenu buttons are supposed to open on focus, but this behavior was not observed in the original test. 

Fixes https://github.com/flutter/flutter/issues/144381, https://github.com/flutter/flutter/issues/150334.

One added feature is the ability to move between top-level horizontal submenus if a horizontal movement is made on a vertical menu item that has no children in the movement direction. This behavior was observed on Google Docs, MacOS, and various other menu systems I encountered.

https://github.com/flutter/flutter/assets/59215665/04a42b8a-cc9e-4a50-9d0c-6f2d784cfc78
2024-08-06 19:04:11 +00:00
Gazal
6f98b485ec
fix: add parameter to maintainState of SearchDelegate (#152444)
Add parameter to `showSearch`, which is passed to `_SearchPageRoute` to maintain the state of the SearchDelegate.

- fix #43582

_Just contributed this change to start the conversation on how the #43582 can be addressed. Have not added tests yet._
2024-08-06 17:53:03 +00:00