Skip to content

Commit

Permalink
fix: give widget small height to fix flutter requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
Remon committed Dec 22, 2024
1 parent ffcba78 commit aa09c10
Showing 1 changed file with 34 additions and 30 deletions.
64 changes: 34 additions & 30 deletions packages/stripe/lib/src/widgets/adress_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,35 +77,39 @@ class _AddressSheetState extends State<_AddressSheet> {

@override
Widget build(BuildContext context) {
return defaultTargetPlatform == TargetPlatform.iOS
? UiKitView(
viewType: _viewType,
creationParamsCodec: const StandardMessageCodec(),
creationParams: widget.addressSheetParams.toJson(),
onPlatformViewCreated: onPlatformViewCreated,
)
: PlatformViewLink(
surfaceFactory: (context, controller) {
return AndroidViewSurface(
controller: controller as AndroidViewController,
hitTestBehavior: PlatformViewHitTestBehavior.opaque,
gestureRecognizers: const <Factory<
OneSequenceGestureRecognizer>>{},
);
},
onCreatePlatformView: (params) {
onPlatformViewCreated(params.id);
return PlatformViewsService.initExpensiveAndroidView(
id: params.id,
viewType: _viewType,
layoutDirection: TextDirection.ltr,
creationParams: widget.addressSheetParams.toJson(),
creationParamsCodec: const StandardMessageCodec(),
)
..addOnPlatformViewCreatedListener(params.onPlatformViewCreated)
..create();
},
viewType: _viewType,
);
return SizedBox(
height: 10,
child: defaultTargetPlatform == TargetPlatform.iOS
? UiKitView(
viewType: _viewType,
creationParamsCodec: const StandardMessageCodec(),
creationParams: widget.addressSheetParams.toJson(),
onPlatformViewCreated: onPlatformViewCreated,
)
: PlatformViewLink(
surfaceFactory: (context, controller) {
return AndroidViewSurface(
controller: controller as AndroidViewController,
hitTestBehavior: PlatformViewHitTestBehavior.opaque,
gestureRecognizers: const <Factory<
OneSequenceGestureRecognizer>>{},
);
},
onCreatePlatformView: (params) {
onPlatformViewCreated(params.id);
return PlatformViewsService.initExpensiveAndroidView(
id: params.id,
viewType: _viewType,
layoutDirection: TextDirection.ltr,
creationParams: widget.addressSheetParams.toJson(),
creationParamsCodec: const StandardMessageCodec(),
)
..addOnPlatformViewCreatedListener(
params.onPlatformViewCreated)
..create();
},
viewType: _viewType,
),
);
}
}

0 comments on commit aa09c10

Please sign in to comment.