For example:
child: Row(
children: [
const Expanded(child: AndroidNativeView()),
ElevatedButton(
child: const Text("PLUS"))
],
)
In layouts without parent constraints like Flex(Row/Column), The AndroidNativeView (a PlatformViewLink) cannot determine its size thus an exception will be thrown. So the instant solutions are wrapping it inside an Expanded/Flexible, or a Container-like widget with width/height hardcoded. Both solutions are not flexible for the layout.
From the current Dart-side implementations' perspective, I know the sizedByParent function of PlatformViewRenderBox is overridden to true. So it takes the constraint from parent, without measuring itself, and fill up whatever space it gets.
What I don't understand is, since there is "WRAP_CONTENT" on Android side, what's the reason that they didn't make it possible to shrink a PlatformView to its own size in Flutter? What are the technical difficulties/tradeups?