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

Unsupported operation: Platform._operatingSystem #85

Closed
YueYongDev opened this issue Jan 8, 2021 · 10 comments
Closed

Unsupported operation: Platform._operatingSystem #85

YueYongDev opened this issue Jan 8, 2021 · 10 comments

Comments

@YueYongDev
Copy link

Describe the bug
when I use this plugin on flutter web, it crashes, the bug description is "Unsupported operation: Platform._operatingSystem
The relevant error-causing widget was: ", it says "flutter_easyloading-2.2.2/lib/src/widgets/loading.dart:62:14", the code as follow

@override
  Widget build(BuildContext context) {
    return Material(
      child: Overlay(
        initialEntries: [
          EasyLoadingOverlayEntry(
            builder: (BuildContext context) => widget.child,
          ),
          _overlayEntry,
        ],
      ),
    );
  }

Screenshots

@github-actions
Copy link

github-actions bot commented Jan 8, 2021

Thanks for taking the time to open an issue. I will have a look and answer as soon as possible.

@syleishere
Copy link

I am getting following for web when trying to display a toast:

Error: Unsupported operation: Platform.operatingSystem
at Object.throw
[as throw] (http://localhost:56903/dart_sdk.js:5347:11)
at Function._operatingSystem (http://localhost:56903/dart_sdk.js:56279:17)
at Function.get operatingSystem [as operatingSystem] (http://localhost:56903/dart_sdk.js:56325:27)
at get _operatingSystem (http://localhost:56903/dart_sdk.js:56238:27)
at Function.desc.get [as _operatingSystem] (http://localhost:56903/dart_sdk.js:5852:17)
at Function.get operatingSystem [as operatingSystem] (http://localhost:56903/dart_sdk.js:56191:26)
at flashlight_off (http://localhost:56903/packages/musicplayer/fourthpage.dart.lib.js:1763:73)
at flashlight_off.next ()
at runBody (http://localhost:56903/dart_sdk.js:39187:34)
at Object._async [as async] (http://localhost:56903/dart_sdk.js:39218:7)
at fourthpage.FourthPage.new.flashlight_off (http://localhost:56903/packages/musicplayer/fourthpage.dart.lib.js:1753:20)
at fourthpage.FourthPage.new. (http://localhost:56903/packages/musicplayer/fourthpage.dart.lib.js:1806:77)
at Generator.next ()
at runBody (http://localhost:56903/dart_sdk.js:39187:34)
at Object._async [as async] (http://localhost:56903/dart_sdk.js:39218:7)
at http://localhost:56903/packages/musicplayer/fourthpage.dart.lib.js:1805:427
at ink_well._InkResponseState.new.[_handleTap] (http://localhost:56903/packages/flutter/src/material/icon_button.dart.lib.js:50329:42)
at tap.TapGestureRecognizer.new.invokeCallback (http://localhost:56903/packages/flutter/src/gestures/recognizer.dart.lib.js:203:18)
at tap.TapGestureRecognizer.new.handleTapUp (http://localhost:56903/packages/flutter/src/gestures/tap.dart.lib.js:417:40)
at tap.TapGestureRecognizer.new.[_checkUp] (http://localhost:56903/packages/flutter/src/gestures/tap.dart.lib.js:223:12)
at tap.TapGestureRecognizer.new.acceptGesture (http://localhost:56903/packages/flutter/src/gestures/tap.dart.lib.js:199:23)
at arena.GestureArenaManager.new.sweep (http://localhost:56903/packages/flutter/src/gestures/arena.dart.lib.js:222:31)
at binding$5.WidgetsFlutterBinding.new.handleEvent (http://localhost:56903/packages/flutter/src/gestures/binding.dart.lib.js:402:27)
at binding$5.WidgetsFlutterBinding.new.dispatchEvent (http://localhost:56903/packages/flutter/src/gestures/binding.dart.lib.js:381:24)
at binding$5.WidgetsFlutterBinding.new.dispatchEvent (http://localhost:56903/packages/flutter/src/rendering/layer.dart.lib.js:6107:13)
at binding$5.WidgetsFlutterBinding.new.[_handlePointerEventImmediately] (http://localhost:56903/packages/flutter/src/gestures/binding.dart.lib.js:352:14)
at binding$5.WidgetsFlutterBinding.new.handlePointerEvent (http://localhost:56903/packages/flutter/src/gestures/binding.dart.lib.js:325:43)
at binding$5.WidgetsFlutterBinding.new.[_flushPointerEventQueue] (http://localhost:56903/packages/flutter/src/gestures/binding.dart.lib.js:314:14)
at binding$5.WidgetsFlutterBinding.new.[_handlePointerDataPacket] (http://localhost:56903/packages/flutter/src/gestures/binding.dart.lib.js:304:65)
at Object.invoke1 (http://localhost:56903/dart_sdk.js:185349:7)
at _engine.EnginePlatformDispatcher..invokeOnPointerDataPacket (http://localhost:56903/dart_sdk.js:165680:15)
at _engine.PointerBinding.
.[_onPointerData] (http://localhost:56903/dart_sdk.js:166338:49)
at http://localhost:56903/dart_sdk.js:166795:28
at http://localhost:56903/dart_sdk.js:166748:16
at http://localhost:56903/dart_sdk.js:166442:11

@ufukhawk
Copy link

same issue

@syleishere
Copy link

There is a dart native operating system plugin

@nslogx
Copy link
Owner

nslogx commented Mar 24, 2021

same issue

sorry, I can not reproduce the problem, it will be helpfull if you can upload a demo project

@ufukhawk
Copy link

same issue

sorry, I can not reproduce the problem, it will be helpfull if you can upload a demo project

Flutter web also generally gives this error. Can you give a sample working with Flutter web?

@nslogx
Copy link
Owner

nslogx commented Mar 24, 2021

image

@ufukhawk example is OK

https://github.com/kokohuang/flutter_easyloading/tree/develop/example

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.3, on macOS 11.0.1 20B29 darwin-x64, locale
    zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.0)
[✓] IntelliJ IDEA Ultimate Edition (version 2020.3.2)
[✓] VS Code (version 1.54.3)
[✓] Connected device (3 available)

@ufukhawk
Copy link

Okay, thank you! worked.

@syleishere
Copy link

Your plugin is awesome, been using it for quite sometime, always loved it and I am so sad to drop it this week. Flutter is so much simpler with "Get" framework plugin, also rates #3 on plugins worldwide, goodbye bloc thankgod. Their built-in snack bar is good enough for my purposes, but some options on it crash web plugin. I really hope you can include this in their project, I really liked look and feel of this, just no point in me using it now that I have built-in support with GetX.

Awesome job, I really hope you submit a pull request on their project.

@nslogx
Copy link
Owner

nslogx commented Mar 25, 2021

@syleishere thanks

@nslogx nslogx closed this as completed Mar 25, 2021
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

4 participants