mirror of
https://github.com/flutter/flutter.git
synced 2026-01-09 07:51:35 +08:00
26298 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
a6bcce63f5
|
Make sure that an EditableText doesn't crash in 0x0 environment (#180457)
This is my attempt to handle https://github.com/flutter/flutter/issues/6537 for the EditableText widget. Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com> |
||
|
|
e064e75676
|
Implementation of tooltip windows for win32 (#179147)
## What's new? - Implemented tooltip windows for the Win32 platform - Implemented size-to-content on Win32 - Wired up the window metrics event with constraints - Updated the example application to demonstrate tooltips - Wrote a bunch of unit tests ## 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: Matej Knopp <matej.knopp@gmail.com> |
||
|
|
40d28b0e9c
|
[web] Don't serve files outside of project (#180699)
Fixes internal bug: b/463611148 |
||
|
|
3892c57dd6
|
Add new motion accessibility features to iOS. (#178102)
Closes https://github.com/flutter/flutter/issues/177330 Contributes to https://github.com/flutter/flutter/issues/175878 ### Description This PR implements support for three new iOS accessibility motion features. - `Auto-Play Animated Images`: Informs the app when the user has chosen to pause automatically playing GIFs and other animated content. - `Auto-Play Video Previews`: Informs the app when the user has disabled the automatic playback of video previews. - `Prefer Non-Blinking Cursor`: Informs the app that the user prefers a non-blinking text insertion indicator in editable text fields. The original issue requested seven features. I was able to find and implement features with clear, public, and general-purpose APIs. The remaining features were not included for the following reasons: - `Vehicle Motion Cues`: No public API found. - `Auto-Play Message Effects`: No public API found. This is likely a feature exclusive to the Messages framework. - `Limit Frame Rate`: No public API found. - `Dim Flashing Lights`: There is a public API available [MADimFlashingLightsEnabled](https://developer.apple.com/documentation/mediaaccessibility/madimflashinglightsenabled()). It is intended for media playback frameworks. It's unclear if exposing this feature is necessary or actionable for a general-purpose application UI. | Feature Name | API | Flutter AccessibilityFeatures | | :-: | :-: | :-: | | Vehicle Motion Cues | - | - | | Dim Flashing Lights | [MADimFlashingLightsEnabled](https://developer.apple.com/documentation/mediaaccessibility/madimflashinglightsenabled()) | - | | Auto-Play Animated Images | [animatedImagesEnabled](https://developer.apple.com/documentation/accessibility/accessibilitysettings/animatedimagesenabled) | autoPlayAnimatedImages | | Auto-Play Video Previews | [isVideoAutoplayEnabled](https://developer.apple.com/documentation/uikit/uiaccessibility/isvideoautoplayenabled) | autoPlayVideos | | Auto-Play Message Effects | - | - | | Prefer Non-Blinking Cursor | [prefersNonBlinkingTextInsertionIndicator](https://developer.apple.com/documentation/accessibility/accessibilitysettings/prefersnonblinkingtextinsertionindicator) | deterministicCursor | | Limit Frame Rate | - | - | The `AccessibilityFeatures.swift` was introduced to refactor all native iOS accessibility logic into a single, dedicated class. This change moves the responsibility of querying settings and observing notifications out of `FlutterViewController.mm`, which cleans up the controller, simplifies future maintenance, and makes logic unit-testable. ### Demo https://github.com/user-attachments/assets/1b3e7a2f-03b4-4716-959e-dbeea938e4d2 <details closed><summary>Code sample</summary> ```dart import 'package:flutter/material.dart'; void main() { runApp( MaterialApp( debugShowCheckedModeBanner: false, home: Screen(), ), ); } class Screen extends StatefulWidget { @override State<Screen> createState() => _ScreenState(); } class _ScreenState extends State<Screen> with WidgetsBindingObserver { @override void initState() { super.initState(); WidgetsBinding.instance.addObserver(this); } @override void didChangeAccessibilityFeatures() { super.didChangeAccessibilityFeatures(); if (mounted) { setState(() {}); } } @override void dispose() { WidgetsBinding.instance.removeObserver(this); super.dispose(); } @override Widget build(BuildContext context) { final accessibilityFeatures = View.of( context, ).platformDispatcher.accessibilityFeatures; return Scaffold( body: Center( child: Column( spacing: 10, mainAxisAlignment: MainAxisAlignment.center, children: [ for (final feature in [ 'accessibleNavigation: ${accessibilityFeatures.accessibleNavigation}', 'invertColors: ${accessibilityFeatures.invertColors}', 'disableAnimations: ${accessibilityFeatures.disableAnimations}', 'boldText: ${accessibilityFeatures.boldText}', 'reduceMotion: ${accessibilityFeatures.reduceMotion}', 'highContrast: ${accessibilityFeatures.highContrast}', 'onOffSwitchLabels: ${accessibilityFeatures.onOffSwitchLabels}', 'supportsAnnounce: ${accessibilityFeatures.supportsAnnounce}', 'autoPlayAnimatedImages: ${accessibilityFeatures.autoPlayAnimatedImages}', 'autoPlayVideos: ${accessibilityFeatures.autoPlayVideos}', 'deterministicCursor: ${accessibilityFeatures.deterministicCursor}', ]) Text(feature), ], ), ), ); } } ``` </details> ## 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. <!-- 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: chunhtai <47866232+chunhtai@users.noreply.github.com> |
||
|
|
f004160865
|
Fix iOS xattr removal to clear all extended attributes (#180355)
Fixed iOS code signing failures caused by extended attributes like com.apple.provenance. Problem: On macOS 15+ with Xcode 26.1+, iOS builds fail during code signing with: resource fork, Finder information, or similar detritus not allowed This happens because com.apple.provenance (added by cloud storage services, Finder, or file downloads) was not being removed - only com.apple.FinderInfo was cleared. Fix: Changed xattr -r -d com.apple.FinderInfo to xattr -cr to remove ALL extended attributes recursively. Fixes #180351 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. |
||
|
|
8cb340cd7a
|
[ Widget Preview ] Move widget_preview_scaffold tests to dev/integration_tests/widget_preview_scaffold (#180658)
Removes Flutter code from the flutter_tools test suite, which otherwise only contains non-Flutter code. Fixes https://github.com/flutter/flutter/issues/180080 |
||
|
|
8812db3594
|
[ Tool ] Fix flake in overall_experience_test.dart (#180655)
The diagnostics string builder responsible for building diagnostics messages can sometimes wrap lines that are too long. This caused the expectation for the 'flutter error messages include a DevTools links' to sometimes be incorrect when run on systems where the absolute file path of the file referenced in the diagnostic was too long. This change updates the test expectation to allow for both wrapping and non-wrapping scenarios to be accepted. Fixes https://github.com/flutter/flutter/issues/174502 |
||
|
|
93cba59cee
|
flutter_tools: Auto-generate ExportOptions.plist for manual iOS code signing (#177888)
# flutter_tools: Auto-generate ExportOptions.plist for manual iOS code signing ## Summary Enhance `flutter build ipa` to automatically generate a complete ExportOptions.plist for manual code signing configurations, eliminating the need for users to create and maintain one manually. **Fixes:** #177853 ## Problem When using manual code signing (`CODE_SIGN_STYLE=Manual`) with `flutter build ipa` for Release/Profile builds, the archive succeeds but the export step fails with: ``` error: exportArchive: "Runner.app" requires a provisioning profile with the Push Notifications and Sign in with Apple features. ``` **Root cause:** Flutter generated an incomplete ExportOptions.plist that only included `method` and `uploadBitcode`. When using manual signing, `xcodebuild -exportArchive` requires: - `teamID` (from project's `DEVELOPMENT_TEAM`) - `signingStyle=manual` - `provisioningProfiles` (mapping bundle ID to provisioning profile UUID) Without these, Xcode cannot resolve the provisioning profile for export, even if the profile is correctly configured and contains the required entitlements. ## Solution Enhanced `_createExportPlist()` in `BuildIOSArchiveCommand` to automatically generate a complete ExportOptions.plist when: 1. `CODE_SIGN_STYLE=Manual` is detected for the main app target 2. Build mode is Release or Profile (production builds only) 3. A valid provisioning profile can be located and parsed The generated plist includes: - `method` (app-store, ad-hoc, enterprise, etc. - respects user's `--export-method` flag) - `teamID` (from `DEVELOPMENT_TEAM` build setting) - `signingStyle=manual` - `provisioningProfiles` mapping main app bundle ID to provisioning profile UUID **Fallback behavior:** - If profile lookup fails: silently fall back to simple plist (no regression) - For Automatic signing: unchanged behavior - For Debug builds: unchanged behavior (not App Store export) - For multi-target apps (extensions): falls back to simple plist today (see TODO below) ## Changes ### Core Implementation - Added `ProfileData` class to encapsulate provisioning profile info (UUID and name) - Refactored profile handling into reusable static methods for testability - Enhanced `_createExportPlist()` with manual signing detection and profile lookup - Added `_findProvisioningProfileUuid()` to locate provisioning profiles by specifier - Added `_parseProvisioningProfileInfo()` to decode provisioning profile data once - Added comprehensive trace logging for debugging ### Testing - Created `build_ipa_export_plist_test.dart` with 7 unit tests covering: - Manual signing with profile found → enhanced plist generated ✓ - Automatic signing → simple plist (unchanged behavior) ✓ - Debug builds → simple plist (unchanged behavior) ✓ - Different export methods → respected in generated plist ✓ - Profile lookup failures → fallback to simple plist ✓ - Null codeSignStyle → handled gracefully ✓ - All existing flutter_tools tests continue to pass ## Documentation Added extensive inline comments explaining: - Enhancement conditions and fallback behavior - Provisioning profile search strategy and error handling - Performance and security considerations - Future enhancements (multi-target support) ## Safety & Scope ### What This Fixes - ✅ Manual signing export failures for apps with Push Notifications / Sign in with Apple - ✅ Auto-generates correct plist for **any** entitlements covered by provisioning profile - ✅ Unblocks users from manual `--export-options-plist` workaround - ✅ Improves iOS build UX for enterprise teams doing manual signing ### What This Does NOT Change - ✅ Automatic signing behavior (unchanged) - ✅ Debug builds (unchanged) - ✅ CLI interface (no new flags) - ✅ Ad-hoc / enterprise distributions (unchanged if not using manual signing) ### Known Limitations (Future Enhancements) - Currently only supports single-target apps (main app bundle ID only) - TODO: Multi-target apps with extensions (notification service, widgets, watch, etc.) - each extension target bundle ID may need separate entry in provisioningProfiles dict - TODO: Support for multiple provisioning profiles if app uses multiple signing identities --- ## Pre-merge Checklist - [x] I have signed the CLA - [x] I read the Contributor Guide and Tree Hygiene docs - [x] I linked the issue this fixes (#177853) and explained the failure scenario - [x] I added documentation and trace logs so developers understand what changed - [x] I added comprehensive unit tests for the new behavior - [x] All existing and new tests pass locally (`flutter test packages/flutter_tools`) - [x] Code passes linting (`dart analyze`) ## Safety Notes - [x] This code only runs for manual code signing in `flutter build ipa` for Release/Profile builds - [x] Debug builds and automatic signing behavior are completely unchanged - [x] If no provisioning profile UUID is found, we silently fall back to the old exportOptions.plist logic instead of failing - [x] Added trace-level logging explaining success/fallback scenarios for debugging - [x] No breaking changes - existing workarounds continue to work - [x] Minimal blast radius - only affects manual signing export path ## Verification Users can verify the fix by: 1. Creating an iOS app with `CODE_SIGN_STYLE=Manual`, `DEVELOPMENT_TEAM` set, and Push Notifications entitlements 2. Running `flutter build ipa --release --verbose` 3. Confirming the trace log shows "Generated ExportOptions.plist with teamID, signingStyle=manual, and provisioningProfiles" 4. Verifying the IPA is successfully created without needing `--export-options-plist` --- ## Related Issues - #106612 - Support `flutter build ipa` with manual signing and provisioning profiles - #113977 - Flutter build IPA with --export-options-plist not working --------- Co-authored-by: Elijah Okoroh <okorohelijah@google.com> |
||
|
|
c2b3ae1bfe
|
Do not dispose CupertinoSheetTransition animation on update and throw ticker error (#180609)
<!-- Thanks for filing a pull request! Reviewers are typically assigned within a week of filing a request. To learn more about code review, see our documentation on Tree Hygiene: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md --> Fixes #179337 by moving the disposal of an animation controller outside of the didUpdate method flow. It was unnecessary to rebuild this controller on update, and was originally put there to follow the pattern of the other animations. However, unlike the other animations, this one is not chained to animations from outside of the transition's place in the tree, and was throwing exceptions from the ticker mixin in some cases. ## 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]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- 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 |
||
|
|
1a86af3ff0
|
Add drag handle to CupertinoSheet (#179962)
Fixes #179358. Adds the option to add a native styled drag handle to the top of a Cupertino sheet through the `showDragHandle` property. By default this is false, the same way it is for the native SwiftUI sheet. Styling for the handle is based off of native versions of the handle, and Apple's Figma files. From this PR: <img width="412" height="293" alt="Screenshot 2025-12-16 at 12 53 06 PM" src="https://github.com/user-attachments/assets/b8f48179-775c-4f90-8930-0ca526e62d33" /> From the iOS Maps app (this sheet has a slight transparency) <img width="401" height="132" alt="Screenshot 2025-12-16 at 12 53 15 PM" src="https://github.com/user-attachments/assets/640b0736-0fe2-4713-81c9-b89c1c1ac41d" /> From the Figma files: <img width="636" height="371" alt="Screenshot 2025-12-16 at 12 53 36 PM" src="https://github.com/user-attachments/assets/a6fb7853-84f9-4728-85eb-ffdd6e1167cd" /> ## 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. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- 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 |
||
|
|
6679464ef2
|
Raw tooltip with smaller API surface that exposes tooltip widget (#177678)
The raw widget used to make a [Tooltip](https://api.flutter.dev/flutter/material/Tooltip-class.html). Design doc: flutter.dev/go/codeshare-tooltip ## Constructor ```dart class RawTooltip extends StatefulWidget { const RawTooltip({ super.key, required this.semanticsTooltip, required this.tooltipBuilder, this.enableTapToDismiss = true, this.triggerMode = TooltipTriggerMode.longPress, this.enableFeedback = true, this.onTriggered, this.hoverDelay = Duration.zero, this.touchDelay = const Duration(milliseconds: 1500), this.dismissDelay = const Duration(milliseconds: 100), this.animationStyle = _kDefaultAnimationStyle, this.positionDelegate, required this.child, }); ``` ## Properties ```dart final String semanticsTooltip; final TooltipComponentBuilder tooltipBuilder; final Duration hoverDelay; final Duration touchDelay; final Duration dismissDelay; final bool enableTapToDismiss; final TooltipTriggerMode triggerMode; final bool enableFeedback; final TooltipTriggeredCallback? onTriggered; final AnimationStyle animationStyle; final TooltipPositionDelegate? positionDelegate; final Widget child; ``` Part of [☂️ Reinforcement: Add more basic components to the core framework](https://github.com/flutter/flutter/issues/97496) Part of [☂️ Reinforcement: Refactor widgets from design into the core before decoupling](https://github.com/flutter/flutter/issues/53059) Fixes [Custom Overlay for Tooltip Widget ](https://github.com/flutter/flutter/issues/45034) --------- Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com> Co-authored-by: chunhtai <47866232+chunhtai@users.noreply.github.com> |
||
|
|
78f49c6529
|
Fix Drawer.child docstring to say ListView instead of SliverList (#180326)
## Description The docstring says "Typically a [SliverList]" but the class example uses `ListView`. `SliverList` is used inside `CustomScrollView`, not as a direct child of `Drawer`. ## Related Issue Fixes #100268 |
||
|
|
5d46d0f0f7
|
New isSemantics and deprecate containsSemantics (#180538)
Fix #180534 ## 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. |
||
|
|
941130b9f1
|
Revert "Directly generate a Mach-O dynamic library using gen_snapshot [reland] (#174870) (#180639)
This reverts commit 4b6e0bdcfacd39f01fad4529217188db3ce516c8. Fixes https://github.com/flutter/flutter/issues/178602. ## 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]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- 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 |
||
|
|
a5b3c4bd69
|
Run hook_user_defines and link_hook integration tests on CI (#180622)
Fixes https://github.com/flutter/flutter/issues/180575. As per the [readme](https://github.com/flutter/flutter/blob/master/dev/integration_tests/README.md#:~:text=Adding%20code%20to%20this%20directory%20will%20not%20automatically%20cause%20it%20to%20be%20run%20by%20any%20already%20existing%20ci%20tooling.), tests in dev/integration_tests are not automatically run on CI: > Adding code to this directory will not automatically cause it to be run by any already existing ci tooling. This PR fixes the problem by running the `hook_user_defines` and `link_hook` integration tests as part of the tools integration test shard. One of the tests actually broke while it wasn't running on CI. This is fixed by removing it from the workspace to ensure the local user-defines in its pubspec are applied. |
||
|
|
b2d157623e
|
Fix division by zero in RenderTable intrinsic size methods (#178217)
## Description This PR fixes a division by zero crash in `RenderTable` when intrinsic size methods are called on empty tables (0 rows × 0 columns) with non-zero constraints. ### The Problem When `RenderTable` has 0 columns and intrinsic size methods (`computeMinIntrinsicHeight`, `computeMaxIntrinsicHeight`, `computeMinIntrinsicWidth`, `computeMaxIntrinsicWidth`) are called with non-zero width constraints, the code calls `_computeColumnWidths()` without checking if the table is empty. This leads to division by zero at line 1140: ```dart final double delta = (minWidthConstraint - tableWidth) / columns; // When columns = 0, this crashes with division by zero ``` ### The Solution Added early return checks `if (rows * columns == 0) return 0.0;` to all four intrinsic size methods, matching the pattern already used by other methods that call `_computeColumnWidths()`: - `computeDryBaseline` (line 1242) - already has the check - `computeDryLayout` (line 1274) - already has the check - `performLayout` (line 1318) - already has the check - `paint` (line 1461) - already has the check Now all four intrinsic methods are consistent with the rest of the codebase. ### Testing Added comprehensive test coverage (`Empty table intrinsic dimensions should not crash`) that: - Creates an empty table (0×0) - Calls all four intrinsic size methods with various constraints - Verifies they return 0.0 without crashing ### Changes Made **packages/flutter/lib/src/rendering/table.dart:** - Added empty table check to `computeMinIntrinsicWidth` (line 963-965) - Added empty table check to `computeMaxIntrinsicWidth` (line 978-980) - Added empty table check to `computeMinIntrinsicHeight` (line 995-997) - Added empty table check to `computeMaxIntrinsicHeight` (line 1016-1019) **packages/flutter/test/rendering/table_test.dart:** - Added test case `Empty table intrinsic dimensions should not crash` - Tests all four intrinsic methods with both finite and infinite constraints ## Related Issues This fix addresses a potential crash when using `RenderTable` with intrinsic sizing widgets (like `IntrinsicHeight`, `IntrinsicWidth`) on empty tables. ## Checklist Before you create this PR, confirm all the requirements listed below by checking the relevant checkboxes (`[x]`). This will ensure a smooth review process. - [x] I have read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I have read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I have read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I have signed the [CLA]. - [x] I have listed at least one issue that this PR fixes (defensive programming for edge case). - [x] I have updated/added relevant documentation (doc comments with `///`). - [x] I have added new tests that verify the fix works. - [x] All existing and new tests are passing (`flutter analyze` shows no issues). - [x] I have followed the [breaking change policy] and added [Data Driven Fixes] where applicable (no breaking changes in this PR). [Contributor Guide]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md [Flutter Style Guide]: https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [breaking change policy]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Data Driven Fixes]: https://github.com/flutter/flutter/blob/master/docs/contributing/Data-driven-Fixes.md --------- Co-authored-by: Kate Lovett <katelovett@google.com> |
||
|
|
af63b5e8c3
|
Fix TabBar.image does not render at initialIndex for the first time (#179616)
- Fix https://github.com/flutter/flutter/issues/59143 - The investigation is at https://github.com/flutter/flutter/issues/59143#issuecomment-3626318406 - Describe the fix: - Make `_IndicatorPainter` listen to both the controller animation and a new painter notifier triggered when the indicator image finishes fetching. - Added some regression tests <details open> <summary>Demo</summary> | before | after | | --------------- | --------------- | <video src="https://github.com/user-attachments/assets/10bb68f7-1c65-422b-b87f-c2b2dd602e70"/> | <video src="https://github.com/user-attachments/assets/bd5a9d8a-97c8-4a8d-ba43-44242f50ec94"/> </details> ## 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]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- 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 --------- Signed-off-by: huycozy <huy@nevercode.io> |
||
|
|
55b609466f
|
Unpin DDS (#180571)
Fly-by clean-up: My understanding from the [changelog](https://pub.dev/packages/dds/changelog) is that the change causing the bug in 5.0.4 has been reverted in 5.0.5. Therefore, the pin should be no longer necessary? Unpinning to find out... > 5.0.5 [DAP] The change in DDS 5.0.4 to individually add/remove breakpoints has been reverted and may be restored in a future version. > >5.0.4 [DAP] Breakpoints are now added/removed individually instead of all being cleared and re-added during a setBreakpoints request. This improves performance and can avoid breakpoints flickering between unresolved/resolved when adding new breakpoints in the same file. |
||
|
|
7d9198a83d
|
Fix DropdownMenuEntry.style not resolved when entry is highlighted (#178873)
## Description This PR adds logic to resolve `DropdownMenuEntry.style` properties with the correct `WidgetState` when an item is highlighted. When `MenuItemButton` are highlighted the focused state is not added automatically because the focus does not move to the items (it stays on the `TextField` in order to let the user enters text to filter the items list). This PR sets the `MenuItemButton.statesController` with a forced focused state to let `MenuItemButton` know that the focused state should be use to resolve the properties. ## Related Issue Fixes [DropdownMenuEntry style's text style is not resolving with states](https://github.com/flutter/flutter/issues/177363) ## Tests - Adds 1 tests. |
||
|
|
15c48f2922
|
[ Widget Preview ] Add support for dart:ffi imports (#180586)
Adds logic to pass `--include-unsupported-platform-library-stubs` to the CFE when launched via `flutter widget-preview start`, as well as logic to ensure the flag can't be passed as an extra frontend option to bypass compile time errors due to imports of unsupported libraries. Fixes https://github.com/flutter/flutter/issues/166431 |
||
|
|
9766a97c54
|
Add --web-define flag for template variable injection in Flutter web builds (#175805)
<!-- Thanks for filing a pull request! Reviewers are typically assigned within a week of filing a request. To learn more about code review, see our documentation on Tree Hygiene: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md --> ## Add --web-define option for runtime variable injection in Flutter web templates This PR adds support for injecting environment-specific variables into Flutter web templates during development and build processes through a new `--web-define` command-line option. ### What this changes **Before**: Developers had to manually edit HTML templates or use build-time workarounds to inject environment-specific values (API URLs, feature flags, etc.) into Flutter web applications. **After**: Developers can now use `--web-define KEY=VALUE` to inject variables directly into web templates using `{{VARIABLE_NAME}}` placeholders. ### Key features - **Template variable substitution**: Support for `{{VARIABLE_NAME}}` placeholders in `index.html` and `flutter_bootstrap.js` - **Runtime validation**: Throws clear errors when required variables are missing with helpful suggestions - **Command-line integration**: Works with both `flutter run` and `flutter build web` commands - **Multiple variable support**: Can define multiple variables in a single command - **Built-in variable protection**: Ignores Flutter's built-in template variables during validation ### Usage examples ```bash # Development with API configuration flutter run -d chrome --web-define=API_URL=https://dev-api.example.com --web-define=DEBUG_MODE=true # Production build with environment variables flutter build web --web-define=API_URL=https://api.example.com --web-define=ANALYTICS_ID=GA-123456 --web-define=DEBUG_MODE=false # Multiple environments flutter run -d chrome --web-define=ENV=staging --web-define=FEATURE_X=enabled ``` ### Template usage In your `web/index.html`: ```html <script> window.config = { apiUrl: '{{API_URL}}', environment: '{{ENV}}', debugMode: {{DEBUG_MODE}} }; </script> ``` ### Error handling If a variable is missing, the tool provides clear feedback: ``` Missing web-define variable: API_URL Please provide the missing variable using: flutter run --web-define=API_URL=VALUE or flutter build web --web-define=API_URL=VALUE ``` ## Issues fixed Fixes https://github.com/flutter/flutter/issues/127853 ## Additional Usage Examples ### Environment-Specific Configurations (Flavors) ```bash # Development flutter run -d chrome --web-define=ENV=dev --web-define=API_URL=http://localhost:3000 --web-define=DEBUG=true # Production flutter build web --web-define=ENV=prod --web-define=API_URL=https://api.example.com --web-define=DEBUG=false ``` **Template:** ```html <script> window.config = { environment: '{{ENV}}', apiUrl: '{{API_URL}}', debugMode: {{DEBUG}} }; </script> ``` ### Dynamic Asset Loading ```bash flutter build web --web-define=CDN_URL=https://cdn.example.com --web-define=LOGO_PATH=/assets/logo.png ``` **Template:** ```html <link rel="icon" href="{{CDN_URL}}{{LOGO_PATH}}"> <link rel="stylesheet" href="{{CDN_URL}}/styles/theme.css"> ``` ### Analytics Integration ```bash flutter build web --web-define=GA_ID=G-XXXXXXXXXX --web-define=SENTRY_DSN=https://xxx@sentry.io/123 ``` **Template:** ```html <script async src="https://www.googletagmanager.com/gtag/js?id={{GA_ID}}"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', '{{GA_ID}}'); </script> ``` ### Feature Flags ```bash flutter run -d chrome --web-define=FEATURE_X=true --web-define=FEATURE_Y=false ``` **Template:** ```html <script> window.features = { featureX: {{FEATURE_X}}, featureY: {{FEATURE_Y}} }; </script> ``` ### Multi-Tenant/White-Label Apps ```bash flutter build web --web-define=TENANT=acme --web-define=PRIMARY_COLOR=#FF5733 --web-define=LOGO_URL=https://cdn.acme.com/logo.png ``` **Template:** ```html <head> <title>{{TENANT}} Portal</title> <link rel="icon" href="{{LOGO_URL}}"> <style>:root { --primary: {{PRIMARY_COLOR}}; }</style> </head> ``` ### Backend Service URLs ```bash flutter build web \ --web-define=API_URL=https://api.example.com \ --web-define=WS_URL=wss://ws.example.com \ --web-define=AUTH_DOMAIN=auth.example.com ``` **Template:** ```html <script> window.services = { api: '{{API_URL}}', websocket: '{{WS_URL}}', auth: '{{AUTH_DOMAIN}}' }; </script> ``` ### SEO & Meta Tags ```bash flutter build web --web-define=APP_TITLE="My App" --web-define=APP_DESC="Description" --web-define=OG_IMAGE=https://example.com/og.png ``` **Template:** ```html <head> <title>{{APP_TITLE}}</title> <meta name="description" content="{{APP_DESC}}"> <meta property="og:title" content="{{APP_TITLE}}"> <meta property="og:image" content="{{OG_IMAGE}}"> </head> ``` ### Build Automation ```json { "scripts": { "dev": "flutter run -d chrome --web-define=ENV=dev --web-define=API_URL=http://localhost:3000", "prod": "flutter build web --web-define=ENV=prod --web-define=API_URL=https://api.example.com" } } ``` ### Important Notes - **Security**: Never expose secrets via `--web-define` (client-side only) ## 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]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- 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: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Ben Konyi <bkonyi@google.com> Co-authored-by: Mouad Debbar <mdebbar@google.com> |
||
|
|
26788b4a22
|
Forward proxy 404 responses to client (#179858)
## Description Forward 404 responses from proxied backend to client instead of serving index.html fallback. Fixes https://github.com/flutter/flutter/issues/178754 ## 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]. - [x] I listed at least one issue that this PR fixes in the description above. - [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. [Contributor Guide]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md Contribution by talabat: <img src="https://talabat-flutterstream.web.app/assets/assets/flutterstream.png" width=60 /> Co-authored-by: Ben Konyi <bkonyi@google.com> |
||
|
|
fb865310c1
|
Restore CLI precedence for web headers and HTTPS over web_dev_config.yaml (#179639)
This PR restores the correct precedence behavior for web development server configuration. Since Flutter 3.38, CLI arguments were being ignored when `web_dev_config.yaml` was present — specifically for HTTPS and headers. According to the design and documentation, the precedence should be: 1. Command-line arguments (highest priority) 2. `web_dev_config.yaml` 3. Built-in defaults (lowest priority) ## Root Cause The regression affected: * **HTTP headers** — merge order was reversed, causing file config to override CLI * **HTTPS config** — CLI TLS arguments were ignored under certain conditions Note: `--web-port` and `--web-hostname` were already working correctly due to the `host ?? this.host` and `port ?? this.port` pattern. The observed issue was due to headers + HTTPS only. ## Changes Made * Fixed header merge order so CLI takes precedence * Corrected HTTPS config resolution and precedence logic * Unified logic across `run` and `drive` commands * Simplified HTTPS handling using `HttpsConfig.parse()` * Added tests for CLI precedence behavior ## Before (broken) ``` flutter run -d chrome --web-tls-cert-path cert.pem ``` ❌ CLI TLS args ignored when config file existed ❌ headers overridden by file config ## After (fixed) ``` flutter run -d chrome --web-tls-cert-path cert.pem ``` ✅ CLI TLS args respected ✅ headers override config as expected ## Tests * Added tests verifying CLI takes precedence * All existing and new tests pass * No breaking changes introduced ## Fixes Fixes: #179014 --------- Co-authored-by: Kevin Moore <kevmoo@google.com> Co-authored-by: Kevin Moore <kevmoo@users.noreply.github.com> Co-authored-by: Ben Konyi <bkonyi@google.com> |
||
|
|
cc8a4de40f
|
Enable misc leak tracking (#176992)
This PR adds a new subshard that runs leak tracking tests on flutter/misc. This is used to address a problem faced by PR https://github.com/flutter/flutter/pull/176519, which fixes a leak in `WidgetTester` but is unable to write a unit test. I'm not certain this is the best approach so I'm open to other suggestions. ## 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]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- 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 |
||
|
|
a0a27839c6
|
[hooks] Don't require NDK for Android targets (#180594)
When targeting Android, don't fail in Flutter tools if the NDK is not installed. Instead, pass a `null` c compiler config to the hooks. The hooks can then decide to fail if they need the NDK. If no hook happened to require the NDK, Flutter for Android apps can be built without the NDK installed. Bug: https://github.com/flutter/flutter/issues/180163 ## 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. |
||
|
|
eb7fb9a3d7
|
Fix/ios share context menu (#176199)
This PR fixes https://github.com/flutter/flutter/issues/173491 by adding the missing 'Share' option to the default iOS SystemContextMenu when shareEnabled is true. Changes: Added IOSSystemContextMenuItemShare to getDefaultItems in system_context_menu.dart. Added a widget test to ensure Share is present in the default items for non-empty selections on iOS. Rationale: This aligns Flutter's default iOS text selection context menu with native iOS behavior, ensuring users see the expected 'Share' option when selecting text. Demo: Video showing Share option in iOS context menu: https://github.com/user-attachments/assets/e04cd1f9-7d92-4147-a09b-719f03d9c625 |
||
|
|
fb2fc34ca1
|
Manually bump dependencies (#180509)
Fly-by clean-up: It's unclear why these aren't getting picked up by the autoroller, see https://github.com/flutter/flutter/issues/180503. |
||
|
|
be03f0d3b1
|
Add tooltip support to PlatformMenuItem and PlatformMenu. (#180069)
Closes https://github.com/flutter/flutter/issues/180031 ### Description - Adds `tooltip` support to `PlatformMenuItem` and `PlatformMenu` - Updates `platform_menu_bar_test.dart` to cover `tooltip` related changes and makes test-specific code private - Updates `FlutterMenuPlugin.mm` to support `tooltip` - Updates `FlutterMenuPluginTest.mm` to cover `tooltip` related changes https://github.com/user-attachments/assets/abafc1ec-dc2f-45ae-a3b5-1e88759dac37 <details closed><summary>Code sample</summary> ```dart // THIS SAMPLE ONLY WORKS ON MACOS. import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; /// Flutter code sample for [PlatformMenuBar]. void main() => runApp(const ExampleApp()); enum MenuSelection { about, showMessage } class ExampleApp extends StatelessWidget { const ExampleApp({super.key}); @override Widget build(BuildContext context) { return const MaterialApp(home: Scaffold(body: PlatformMenuBarExample())); } } class PlatformMenuBarExample extends StatefulWidget { const PlatformMenuBarExample({super.key}); @override State<PlatformMenuBarExample> createState() => _PlatformMenuBarExampleState(); } class _PlatformMenuBarExampleState extends State<PlatformMenuBarExample> { String _message = 'Hello'; bool _showMessage = false; void _handleMenuSelection(MenuSelection value) { switch (value) { case MenuSelection.about: showAboutDialog( context: context, applicationName: 'MenuBar Sample', applicationVersion: '1.0.0', ); case MenuSelection.showMessage: setState(() { _showMessage = !_showMessage; }); } } @override Widget build(BuildContext context) { //////////////////////////////////// // THIS SAMPLE ONLY WORKS ON MACOS. //////////////////////////////////// // This builds a menu hierarchy that looks like this: // Flutter API Sample // ├ About // ├ ──────── (group divider) // ├ Hide/Show Message // ├ Messages // │ ├ I am not throwing away my shot. // │ └ There's a million things I haven't done, but just you wait. // └ Quit return PlatformMenuBar( menus: <PlatformMenuItem>[ PlatformMenu( label: 'Flutter API Sample', menus: <PlatformMenuItem>[ PlatformMenuItemGroup( members: <PlatformMenuItem>[ PlatformMenuItem( label: 'About', tooltip: 'Show information about APP_NAME', onSelected: () { _handleMenuSelection(MenuSelection.about); }, ), ], ), PlatformMenuItemGroup( members: <PlatformMenuItem>[ PlatformMenuItem( onSelected: () { _handleMenuSelection(MenuSelection.showMessage); }, shortcut: const CharacterActivator('m'), label: _showMessage ? 'Hide Message' : 'Show Message', tooltip: _showMessage ? 'The message will be hidden.' : 'The message will be shown.', ), PlatformMenu( label: 'Messages', menus: <PlatformMenuItem>[ PlatformMenuItem( label: 'I am not throwing away my shot.', shortcut: const SingleActivator( LogicalKeyboardKey.digit1, meta: true, ), onSelected: () { setState(() { _message = 'I am not throwing away my shot.'; }); }, ), PlatformMenuItem( label: "There's a million things I haven't done, but just you wait.", shortcut: const SingleActivator( LogicalKeyboardKey.digit2, meta: true, ), onSelected: () { setState(() { _message = "There's a million things I haven't done, but just you wait."; }); }, ), ], ), ], ), if (PlatformProvidedMenuItem.hasMenu( PlatformProvidedMenuItemType.quit, )) const PlatformProvidedMenuItem( type: PlatformProvidedMenuItemType.quit, ), ], ), ], child: Center( child: Text( _showMessage ? _message : 'This space intentionally left blank.\n' 'Show a message here using the menu.', ), ), ); } } ``` </details> ## 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. <!-- 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 |
||
|
|
d5424a5bf2
|
Add DropdownMenuFormField.errorBuilder (#179345)
## Description This PR adds the `DropdownMenuFormField.errorBuilder` property which makes it possible to customize the widget used to display the error message. This is a follow-up to https://github.com/flutter/flutter/pull/162255 which added the `errorBuilder` property to other form fields. ## Related Issue Fixes [DropdownMenuFormField is missing an errorBuilder property](https://github.com/flutter/flutter/issues/172416) ## Tests Updates 5 tests. Adds 1 test. |
||
|
|
4c3f603a41
|
Don't embed unreferenced assets (#179251)
When a Flutter app depends on a package using hooks to add code assets, those get built to `build/native_assets/$platform`, where `$platform` is something like `ios` or `macos`. Crucially, there's no difference between simulator or release builds here, all native assets for a platform end up in that directory. To embed those frameworks with the app, the "sign and embed" stage of an XCode build invokes `xcode_backend.dart`, which then copies all frameworks from `build/native_assets/$targetPlatform` into `$build/Runner.app/Frameworks`. This is a problem when a developer runs a simulator build followed by a release build without clearing the build folder in between, since both assets would be in `build/native_assets/ios` at that point. This fixes the issue by: 1. Reading the `native_assets.json` file emitted by the main build. 2. Only copying frameworks referenced in that file. This still needs an integration test. Closes https://github.com/flutter/flutter/issues/178602. ## 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 `///`). - [ ] 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]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- 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: Victoria Ashworth <15619084+vashworth@users.noreply.github.com> |
||
|
|
7190244dd8
|
Improve documentation about ValueNotifier's behavior (#179870)
fixes #142418 ## 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 followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- 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 |
||
|
|
b659d5fec6
|
Make sure that a ColorFiltered doesn't crash 0x0 environment (#180307)
This is my attempt to handle https://github.com/flutter/flutter/issues/6537 for the ColorFiltered widget. Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com> |
||
|
|
e7f1721a09
|
Make sure that a FadeInImage doesn't crash in 0x0 environment (#180495)
This is my attempt to handle https://github.com/flutter/flutter/issues/6537 for the FadeInImage widget. Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com> |
||
|
|
a397a24f6c
|
Replace semantic announcements in expansion tile for Android (#179917)
fixes: https://github.com/flutter/flutter/issues/177785 ## 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]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- 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 |
||
|
|
03d6c1d479
|
Bump ffigen in templates (#180513) | ||
|
|
68d3d7b421
|
Add accessibilityAnnouncement matcher (#180058)
Fix #180057 ## 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. <!-- 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 |
||
|
|
afb13d8bb7
|
[ Widget Preview ] Add UUID to registered DTD streams and services (#180140)
DTD only supports a single instance of a registered service with a given name. For widget preview development, we sometimes want to use a DTD instance that's attached to an IDE to test IDE integration. However, IDEs frequently spawn their own widget preview instances which register services with DTD. In the case where `flutter widget-preview start --dtd-url=<dtd-url>` is run and `dtd-url` points to a DTD instance with another widget preview service running, the process simply crashes. This change adds a unique identifier to the widget preview DTD service and stream names that allows for each `flutter widget-preview start` instance to register its own unique widget preview DTD services, even if other widget preview instances are using the same DTD instance. Fixes https://github.com/flutter/flutter/issues/179883 |
||
|
|
4333b7722c
|
Implement popup windows in the API and test code (#179757)
## What's new? - Add `PopupWindowController`, `PopupWindowControllerDelegate`, and `PopupWindow` - Implement reference logic for popup windows in the test bindings - Add tests for the popup windows API ## 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. |
||
|
|
c4aca4f7df
|
Roll pub packages (#180510)
This PR was generated by `flutter update-packages --force-upgrade`. |
||
|
|
46c8606b88
|
Fix Gradient.scale not preserving transformation. (#179493)
Fixes https://github.com/flutter/flutter/issues/163972 ### Description - Fixes `Gradient.scale` methods to not lose transform | BEFORE | AFTER | | - | - | | <img width="481" height="515" alt="before" src="https://github.com/user-attachments/assets/c9644fed-4016-4dea-9e39-c5c5fa311cee" /> | <img width="481" height="515" alt="after" src="https://github.com/user-attachments/assets/f77629e3-4d7e-49fb-9e8f-d044e3dd348c" /> | <details closed><summary>Code sample</summary> ```dart import 'package:flutter/material.dart'; void main() => runApp(const GradientScaleBug()); class GradientScaleBug extends StatelessWidget { const GradientScaleBug({super.key}); @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, home: Scaffold( body: Padding( padding: const EdgeInsets.all(10), child: Column( spacing: 10, children: [ Expanded( child: Row( spacing: 10, children: [ _buildGradientContainer( LinearGradient( colors: [ Color(0xFFCC5555), Color(0xFF55BB55), Color(0xFF5555CC), ], transform: GradientRotation(0.7853981634), ), ), _buildGradientContainer( LinearGradient( colors: [ Color(0xFFCC5555), Color(0xFF55BB55), Color(0xFF5555CC), ], transform: GradientRotation(0.7853981634), ).scale(0.5), ), ], ), ), Expanded( child: Row( spacing: 10, children: [ _buildGradientContainer( RadialGradient( colors: [ Color(0xFFCC5555), Color(0xFF55BB55), Color(0xFF5555CC), ], center: Alignment.topCenter, transform: GradientRotation(0.7853981634), ), ), _buildGradientContainer( RadialGradient( colors: [ Color(0xFFCC5555), Color(0xFF55BB55), Color(0xFF5555CC), ], center: Alignment.topCenter, transform: GradientRotation(0.7853981634), ).scale(0.5), ), ], ), ), Expanded( child: Row( spacing: 10, children: [ _buildGradientContainer( SweepGradient( colors: [ Color(0xFFCC5555), Color(0xFF55BB55), Color(0xFF5555CC), Color(0xFFCC5555), ], center: Alignment.topCenter, transform: GradientRotation(0.7853981634), ), ), _buildGradientContainer( SweepGradient( colors: [ Color(0xFFCC5555), Color(0xFF55BB55), Color(0xFF5555CC), Color(0xFFCC5555), ], center: Alignment.topCenter, transform: GradientRotation(0.7853981634), ).scale(0.5), ), ], ), ), ], ), ), ), ); } Widget _buildGradientContainer(Gradient gradient) { return Expanded( child: DecoratedBox( decoration: BoxDecoration(gradient: gradient), child: const SizedBox.expand(), ), ); } } ``` </details> ## 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. <!-- 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 |
||
|
|
423a30323c
|
Relands "Feat: Add a11y for loading indicators (#165173)" (#178402)
This reverts commit ef29db350f0951ab976e2fdb5d092e65578329e5. <!-- Thanks for filing a pull request! Reviewers are typically assigned within a week of filing a request. To learn more about code review, see our documentation on Tree Hygiene: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md --> reland https://github.com/flutter/flutter/pull/165173 ## 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]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- 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 |
||
|
|
bef11d207f
|
Some cleanup of cross library test imports (#177029)
There is a lot of cross-library importing in the framework unit tests that I'd like to clean up, see the design doc for more: https://docs.google.com/document/d/1UHxALQqCbmgjnM1RNV9xE2pK3IGyx-UktGX1D7hYCjs/edit?tab=t.0 This PR cleans up a few obvious instances and adds TODOs for others. I created this while doing an investigation for the design doc linked above. I hope that we'll be able to follow up with fixes for all of the problematic tests (tracked in the issue below). Part of https://github.com/flutter/flutter/issues/177028 |
||
|
|
0f2514a61d
|
Remove @override annotations from things which are not overrides (#180417)
These annotations are applied to top-level elements, which override nothing. A new warning from the Analyzer will start to report these. |
||
|
|
6954931bb8
|
Make sure that a DecoratedBox doesn't crash in 0x0 environment (#180329)
This is my attempt to handle https://github.com/flutter/flutter/issues/6537 for the DecoratedBox widget. |
||
|
|
a634f089ab
|
Improve Container color/decoration error message clarity (#178823)
## Description This PR improves the clarity of the error message shown when developers provide both `color` and `decoration` parameters to a `Container` widget. ### Problem The previous assertion message was confusing and contradictory: ``` Cannot provide both a color and a decoration To provide both, use "decoration: BoxDecoration(color: color)". ``` This message stated "Cannot provide **both**" but then suggested "To provide **both**, use...", which confused developers about the actual requirement. The suggestion appeared to offer a workaround to use both parameters together, when in fact it was explaining how to migrate from using `color` to using `decoration` exclusively. ### Solution Updated the assertion message to clearly explain: - The `color` parameter is a shorthand for `decoration: BoxDecoration(color: color)` - Developers should use **either** `color` OR `decoration`, not both - To use both a color and other decoration properties (like borders, shadows, etc.), set the color within the `BoxDecoration` instead **New message:** ``` Cannot provide both a color and a decoration. The color argument is just a shorthand for "decoration: BoxDecoration(color: color)". To use both a color and other decoration properties, set the color in the BoxDecoration instead. ``` ## Related Issues Fixes #119484 ## 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. <!-- 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> |
||
|
|
8d5a463f58
|
Make sure that a CheckedModeBanner doesn't crash in 0x0 environment (#180280)
This is my attempt to handle https://github.com/flutter/flutter/issues/6537 for the CheckedModeBanner widget. |
||
|
|
0015d2b6bf
|
[Framework] iOS style blurring and ImageFilterConfig (#175473)
This PR adds the framework support for a new iOS-style blur. The new
style, which I call "bounded blur", works by adding parameters to the
blur filter that specify the bounds for the region that the filter
sources pixels from.
As discussed in design doc
[flutter.dev/go/ios-style-blur-support](http://flutter.dev/go/ios-style-blur-support),
it's impossible to pass layout information to filters with the current
`ImageFilter` design. Therefore this PR creates a new class
`ImageFilterConfig`.
This PR also applies bounded blur to `CupertinoPopupSurface`. The
following images show the different looks of a dialog in front of
background with abrupt color changes just outside of the border. Notice
how the abrupt color changes no longer bleed in.
<img width="639" height="411" alt="image"
src="https://github.com/user-attachments/assets/4ceb9620-1056-45c3-b5fa-2ed16d90aace"
/>
<img width="639" height="411" alt="image"
src="https://github.com/user-attachments/assets/abe564f7-ea60-4d07-ad58-063c0e3794a5"
/>
This feature continues to matter for iOS 26, since the liquid glass
design also heavily features blurring.
### API changes
* `BackdropFilter`: Add `filterConfig`
* `RenderBackdropFilter`: Add `filterConfig`. Deprecate `filter`.
* `ImageFilter`: Add `debugShortDescription` (previously private
property `_shortDescription`)
### Demo
The following video compares the effect of a bounded blur and an
unbounded blur.
https://github.com/user-attachments/assets/f715db44-c0a0-4ac8-a163-6b859665b032
<details>
<summary>
Demo source
</summary>
```
// Add to pubspec.yaml:
//
// assets:
// - assets/kalimba.jpg
//
// and download the image from
//
|
||
|
|
8fe208e520
|
Add support for Shift-Delete, Ctrl-Insert and Shift-Insert (#178561)
This PR adds `SingleActivator` mappings for IBM CUA style clipboard accessors, with which Shift-Delete, Ctrl-Insert and Shift-Insert are equivalent to ^X ^C ^V. These mappings are natively supported on Windows and Linux (but not OS X). ~Not sure what to do about:~ - ~Documentation: Are ^X ^C ^V already documented?~ - ~Tests: Are there existing tests for ^X ^C ^V already? Is it possible to mock out the clipboard so that a test of this functionality doesn't hit the actual system clipboard?~ - ~OS X: Is it a problem that, with this change, Flutter will accept these additional shortcuts even though they aren't a part of the platform paradigm?~ UPDATE: I'm not aware of existing documentation of clipboard shortcuts. I have added tests, both of the existing ^X ^C ^V and of the IBM CUA style mappings added by this PR, and in the current iteration the changes do not add IBM CUA style mappings on OS X. Fixes: #178483 ## 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: Loïc Sharma <737941+loic-sharma@users.noreply.github.com> |
||
|
|
10cfc003c3
|
Make sure that a WidgetsApp doesn't crash in 0x0 environment (#180224)
This is my attempt to handle https://github.com/flutter/flutter/issues/6537 for the WidgetsApp widget. Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com> |
||
|
|
935eda8b48
|
Make sure that an AnimatedSize doesn't crash in 0x0 environment (#180174)
This is my attempt to handle https://github.com/flutter/flutter/issues/6537 for the AnimatedSize widget. Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com> |