Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A platform implementation for webview_flutter has not been set. #15

Open
MojtabaTavakkoli opened this issue Nov 22, 2023 · 3 comments
Open

Comments

@MojtabaTavakkoli
Copy link

I'm getting the following error when running the example project on flutter web :

image
selectable content:


══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following assertion was thrown building Container(constraints: BoxConstraints(0.0<=w<=Infinity,
h=250.0)):
Assertion failed:
file:///C:/Users/mojta/AppData/Local/Pub/Cache/hosted/pub.dev/webview_flutter_platform_interface-2.6.0/lib/src/platform_webview_controller.dart:26:7
WebViewPlatform.instance != null
"A platform implementation for `webview_flutter` has not been set. Please ensure that an
implementation of `WebViewPlatform` has been set to `WebViewPlatform.instance` before use. For unit
testing, `WebViewPlatform.instance` can be set with your own test implementation."

The relevant error-causing widget was:
  Container
  Container:file:///C:/Users/mojta/Downloads/Compressed/vimeo_player-master/vimeo_player-master/example/lib/main.dart:42:13

When the exception was thrown, this was the stack:
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 294:49            throw_
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 35:3              assertFailed
packages/webview_flutter_platform_interface/src/platform_webview_controller.dart 26:32  new
packages/webview_flutter/src/webview_controller.dart 101:11                             fromPlatformCreationParams
packages/vimeo_player_flutter/vimeo_player_flutter.dart 28:23                           new
packages/vimeo_player_flutter/vimeo_player_flutter.dart 24:39                           createState
packages/flutter/src/widgets/framework.dart 5381:24                                     new

flutter doctor:
image

@MojtabaTavakkoli
Copy link
Author

I know that the package doesn't currently support web but I was wondering if there is any temporary approach for it

@milanagile
Copy link

The following assertion was thrown building Container(constraints: BoxConstraints(0.0<=w<=Infinity, h=250.0)):
Assertion failed: file:///Users/agilemac49/.pub-cache/hosted/pub.dev/webview_flutter_platform_interface-2.10.0/lib/src/platform_webview_controller.dart:26:7
WebViewPlatform.instance != null
"A platform implementation for webview_flutter has not been set. Please ensure that an implementation of WebViewPlatform has been set to WebViewPlatform.instance before use. For unit testing, WebViewPlatform.instance can be set with your own test implementation."

The relevant error-causing widget was:
Container Container:file:///Users/agilemac49/milan/demo/flutter/project/vemio/lib/main.dart:61:13
When the exception was thrown, this was the stack:
dart-sdk/lib/internal/js_dev_runtime/private/ddc_runtime/errors.dart 296:3 throw
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 29:3 assertFailed
packages/webview_flutter_platform_interface/src/platform_webview_controller.dart 26:32 new
packages/webview_flutter/src/webview_controller.dart 101:11 fromPlatformCreationParams
packages/vimeo_player_flutter/vimeo_player_flutter.dart 28:23 new
packages/vimeo_player_flutter/vimeo_player_flutter.dart 24:39 createState
packages/flutter/src/widgets/framework.dart 5701:24 new
packages/flutter/src/widgets/framework.dart 776:38 createElement
packages/flutter/src/widgets/framework.dart 4463:41 inflateWidget
packages/flutter/src/widgets/framework.dart 3963:18 updateChild
packages/flutter/src/widgets/framework.dart 6900:14 mount

@milanagile
Copy link

======== Exception caught by rendering library =====================================================
The following assertion was thrown during layout:
A RenderFlex overflowed by 99716 pixels on the bottom.

The relevant error-causing widget was:
Column Column:file:///Users/agilemac49/milan/demo/flutter/project/vemio/lib/main.dart:59:16
The overflowing RenderFlex has an orientation of Axis.vertical.
The edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and black striped pattern. This is usually caused by the contents being too big for the RenderFlex.

Consider applying a flex factor (e.g. using an Expanded widget) to force the children of the RenderFlex to fit within the available space instead of being sized to their natural size.
This is considered an error condition because it indicates that there is content that cannot be seen. If the content is legitimately bigger than the available space, consider clipping it with a ClipRect widget before putting it in the flex, or using a scrollable container rather than a Flex, like a ListView.

The specific RenderFlex in question is: RenderFlex#07ebe relayoutBoundary=up2 OVERFLOWING
... parentData: offset=Offset(0.0, 0.0) (can use size)
... constraints: BoxConstraints(0.0<=w<=1200.0, 0.0<=h<=784.0)
... size: Size(1200.0, 784.0)
... direction: vertical
... mainAxisAlignment: start
... mainAxisSize: max
... crossAxisAlignment: center
... verticalDirection: down
child 1: RenderErrorBox#6285e
parentData: offset=Offset(0.0, 0.0); flex=null; fit=null (can use size)
constraints: BoxConstraints(0.0<=w<=1200.0, 0.0<=h<=Infinity)
size: Size(1200.0, 100000.0)
child 2: RenderConstrainedBox#02dfd relayoutBoundary=up3
parentData: offset=Offset(600.0, 100000.0); flex=null; fit=null (can use size)
constraints: BoxConstraints(0.0<=w<=1200.0, 0.0<=h<=Infinity)
size: Size(0.0, 250.0)
additionalConstraints: BoxConstraints(0.0<=w<=Infinity, h=250.0)
child 3: RenderConstrainedBox#6cb6d relayoutBoundary=up3
parentData: offset=Offset(600.0, 100250.0); flex=null; fit=null (can use size)
constraints: BoxConstraints(0.0<=w<=1200.0, 0.0<=h<=Infinity)
size: Size(0.0, 250.0)
additionalConstraints: BoxConstraints(0.0<=w<=Infinity, h=250.0)
◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤

Finished with error: the Dart compiler exited unexpectedly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants