-
Notifications
You must be signed in to change notification settings - Fork 30.2k
Proposal to add shrinkWrap property for platform views #77416
Copy link
Copy link
Open
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projecta: platform-viewsEmbedding Android/iOS views in Flutter appsEmbedding Android/iOS views in Flutter appsc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
Use case
Currently, when using a platform view, it's necessary to give it a size using a SizedBox or a Container. It'd be great if we could introduce it to the tree without needing to give it a size. For example, using the plugin native_admob_flutter, it's necessary to give the ad a size. The same with google_mobile_ads with Native Ads
Proposal
I'd like to be able to just set shrinkWrap to true in a PlatformView and insert it in the Widget tree without problems:
// For android:
AndroidView(
shrinkWrap: true,
viewType: widget.viewType,
creationParamsCodec: StandardMessageCodec(),
creationParams: widget.params,
);
// For iOS:
UiKitView(
shrinkWrap: true,
viewType: _viewType,
creationParamsCodec: StandardMessageCodec(),
creationParams: params,
)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projecta: platform-viewsEmbedding Android/iOS views in Flutter appsEmbedding Android/iOS views in Flutter appsc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team