jonataslaw / getx

Open screens/snackbars/dialogs/bottomSheets without context, manage states and inject dependencies easily with Get.
MIT License
10.4k stars 1.63k forks source link

kindly solved this issue of websocket #2746

Open baigsapp opened 1 year ago

baigsapp commented 1 year ago

Launching lib\main.dart on sdk gphone64 x86 64 in debug mode... /C:/Users/Lenovo%20Ideapad/AppData/Local/Pub/Cache/hosted/pub.dev/get-4.6.5/lib/get_connect/sockets/src/sockets_html.dart:3:8: Error: Dart library 'dart:html' is not available on this platform. import 'dart:html'; ^ Context: The unavailable library 'dart:html' is imported through these packages:

package:woocommerce_app => package:get => dart:html

Detailed import paths for (some of) the these imports:

package:woocommerce_app/main.dart => package:woocommerce_app/screen/home.dart => package:woocommerce_app/screen/dashboard_page.dart => package:woocommerce_app/widgets/widget_home_categories.dart => package:woocommerce_app/screen/product_page.dart => package:woocommerce_app/widgets/widget_product_card.dart => package:woocommerce_app/screen/product_details.dart => package:get/get_connect/sockets/src/sockets_html.dart => dart:html

package:woocommerce_app/main.dart => package:woocommerce_app/screen/home.dart => package:woocommerce_app/screen/dashboard_page.dart => package:woocommerce_app/widgets/widget_home_products.dart => package:woocommerce_app/screen/product_details.dart => package:get/get_connect/sockets/src/sockets_html.dart => dart:html package:woocommerce_app/main.dart => package:woocommerce_app/screen/product_page.dart => package:woocommerce_app/widgets/widget_product_card.dart => package:woocommerce_app/screen/product_details.dart => package:get/get_connect/sockets/src/sockets_html.dart => dart:html

/C:/Users/Lenovo%20Ideapad/AppData/Local/Pub/Cache/hosted/pub.dev/get-4.6.5/lib/get_connect/sockets/src/sockets_html.dart:10:3: Error: Type 'WebSocket' not found. WebSocket socket; ^^^^^^^^^ /C:/Users/Lenovo%20Ideapad/AppData/Local/Pub/Cache/hosted/pub.dev/get-4.6.5/lib/get_connect/sockets/src/sockets_html.dart:10:3: Error: 'WebSocket' isn't a type. WebSocket socket; ^^^^^^^^^ /C:/Users/Lenovo%20Ideapad/AppData/Local/Pub/Cache/hosted/pub.dev/get-4.6.5/lib/get_connect/sockets/src/sockets_html.dart:36:16: Error: The method 'WebSocket' isn't defined for the class 'BaseWebSocket'.

Try correcting the name to the name of an existing getter, or defining a getter or field named 'WebSocket'. if (socket != null && socket!.readyState == WebSocket.OPEN) { ^^^^^^^^^ Unhandled exception: FileSystemException(uri=org-dartlang-untranslatable-uri:dart%3Ahtml; message=StandardFileSystem only supports file: and data: URIs)

0 StandardFileSystem.entityForUri (package:front_end/src/api_prototype/standard_file_system.dart:34:7)

1 asFileUri (package:vm/kernel_front_end.dart:654:37)

2 writeDepfile (package:vm/kernel_front_end.dart:794:21)

#3 FrontendCompiler.compile (package:frontend_server/frontend_server.dart:629:9) #4 starter (package:frontend_server/starter.dart:99:12) #5 main (file:///C:/b/s/w/ir/x/w/sdk/pkg/frontend_server/bin/frontend_server_starter.dart:13:14) Target kernel_snapshot failed: Exception FAILURE: Build failed with an exception. * Where: Script 'D:\Development\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1151 * What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'. > Process 'command 'D:\Development\flutter\bin\flutter.bat'' finished with non-zero exit value 1 * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 57s Exception: Gradle task assembleDebug failed with exit code 1 Exited (sigterm)
jonataslaw commented 1 year ago

Are you using the stable version of Flutter?

Does it happen on android build?

baigsapp commented 1 year ago

After two days of hard work and finding the bug I finally modified this file and commented out all the data in this file and now I have it working properly.

/AppData/Local/Pub/Cache/hosted/pub.dev/get-4.6.5/lib/get_connect/sockets/src/sockets_html.dart
sayori1 commented 1 year ago

You saved me a lot of time. Thanks!