| commit | bd443987a20e6cd5eebc8596ec9d66a069c13254 | [log] [tgz] |
|---|---|---|
| author | BottlePumpkin <61003485+BottlePumpkin@users.noreply.github.com> | Wed Dec 10 15:14:22 2025 |
| committer | GitHub <noreply@github.com> | Wed Dec 10 15:14:22 2025 |
| tree | a99254d286e1ea9c08f10995d76f2b7bdd562f5a | |
| parent | cfe2fe286e41b4c7389e9020ef96b295bf48c1c9 [diff] |
[rfw] Add Flexible widget support to core widgets (#9750) # [rfw] Add Flexible widget support This PR adds support for the `Flexible` widget to Remote Flutter Widgets (RFW), allowing developers to create flexible layouts with both loose and tight fitting behavior. Fixes [#173313](https://github.com/flutter/flutter/issues/173313) The `Flexible` widget provides more granular control over flex layouts compared to the existing `Expanded` widget: - **FlexFit.loose**: Widget takes only the space it needs (default) - **FlexFit.tight**: Widget takes all available space (same as Expanded) **Implementation:** - Added `Flexible` widget to `lib/src/flutter/core_widgets.dart` - Supports `flex` (default: 1) and `fit` parameters (loose/tight, default: loose) - Uses existing `ArgumentDecoders.enumValue` pattern for FlexFit parsing - Maintains alphabetical ordering and follows existing RFW patterns - Added comprehensive test coverage in `test/core_widgets_test.dart` - Refactored tests based on code review feedback to reduce duplication **Usage Example:** ```rfwtxt import core.widgets; widget FlexibleDemo = Column( children: [ Flexible( flex: 1, fit: "loose", child: Text(text: "Takes needed space"), ), Flexible( flex: 2, fit: "tight", child: Text(text: "Takes all available space"), ), ], ); ``` **API Compatibility:** Follows Flutter's `Flexible` widget API exactly: - `flex: int` (default: 1) - `fit: FlexFit` (loose/tight, default: loose) - `child: Widget` (required) ## Pre-Review Checklist
This repo is a companion repo to the main flutter repo. It contains the source code for Flutter's first-party packages (i.e., packages developed by the core Flutter team). Check the packages directory to see all packages.
These packages are also available on pub.
Please file any issues, bugs, or feature requests in the main flutter repo. Issues pertaining to this repository are labeled “package”.
If you wish to contribute a new package to the Flutter ecosystem, please see the documentation for developing packages. You can store your package source code in any GitHub repository (the present repo is only intended for packages developed by the core Flutter team). Once your package is ready you can publish to the pub repository.
If you wish to contribute a change to any of the existing packages in this repo, please review our contribution guide, and send a pull request.
These are the packages hosted in this repository: