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

Unhandled Exception: type 'Transition' is not a subtype of type 'bool' #32

Closed
mahmoudalaa97 opened this issue Apr 7, 2020 · 5 comments

Comments

@mahmoudalaa97
Copy link

mahmoudalaa97 commented Apr 7, 2020

When i use this version in master channel show this error and not show next page.

pubspec.yml:

get: ^1.14.0-dev

Screen:

Screenshot

Code:
Get.to(FirstLoginScreen(),transition: Transition.fade,duration: Duration(milliseconds: 100));


Flutter doctor:

[√] Flutter (Channel master, v1.18.1-pre.3, on Microsoft Windows [Version 10.0.17134.1365], locale en-US)
    • Flutter version 1.18.1-pre.3 at D:\java\flutter\flutter
    • Framework revision e3e189219b (19 hours ago), 2020-04-06 14:31:38 -0700
    • Engine revision df257e59c2
    • Dart version 2.8.0 (build 2.8.0-dev.20.0 1210d27678)


[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at E:\Android\sdk
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = E:\Android\sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    • All Android licenses accepted.

[√] Android Studio (version 3.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 31.3.1
    • Dart plugin version 181.5656
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[√] IntelliJ IDEA Community Edition (version 2018.2)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.2.4
    • Flutter plugin version 34.0.1
    • Dart plugin version 182.5215

[√] VS Code, 64-bit edition (version 1.28.2)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 2.21.1

[√] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 7.0 (API 24) (emulator)

• No issues found!


Error:

ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: type 'Transition' is not a subtype of type 'bool'
E/flutter (25785): #0      Get.to (package:get/src/get_main.dart:59:32)
E/flutter (25785): #1      _SplashScreenState.goToNextPage.<anonymous closure> (package:amack_v4_backend/ui/screens/splash_screen.dart:57:9)
E/flutter (25785): #2      _rootRun (dart:async/zone.dart:1180:38)
E/flutter (25785): #3      _CustomZone.run (dart:async/zone.dart:1077:19)
E/flutter (25785): #4      _CustomZone.runGuarded (dart:async/zone.dart:979:7)
E/flutter (25785): #5      _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1019:23)
E/flutter (25785): #6      _rootRun (dart:async/zone.dart:1184:13)
E/flutter (25785): #7      _CustomZone.run (dart:async/zone.dart:1077:19)
E/flutter (25785): #8      _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:1003:23)
E/flutter (25785): #9      Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:23:15)
E/flutter (25785): #10     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
E/flutter (25785): #11     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
E/flutter (25785): #12     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
E/flutter (25785): 
@jonataslaw
Copy link
Owner

When i use this version in master channel show this error and not show next page.

pubspec.yml:

get: ^1.14.0-dev

Screen:

Screenshot

Code:
Get.to(FirstLoginScreen(),transition: Transition.fade,duration: Duration(milliseconds: 100));

Flutter doctor:

[√] Flutter (Channel master, v1.18.1-pre.3, on Microsoft Windows [Version 10.0.17134.1365], locale en-US)
    • Flutter version 1.18.1-pre.3 at D:\java\flutter\flutter
    • Framework revision e3e189219b (19 hours ago), 2020-04-06 14:31:38 -0700
    • Engine revision df257e59c2
    • Dart version 2.8.0 (build 2.8.0-dev.20.0 1210d27678)


[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at E:\Android\sdk
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = E:\Android\sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    • All Android licenses accepted.

[√] Android Studio (version 3.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 31.3.1
    • Dart plugin version 181.5656
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[√] IntelliJ IDEA Community Edition (version 2018.2)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.2.4
    • Flutter plugin version 34.0.1
    • Dart plugin version 182.5215

[√] VS Code, 64-bit edition (version 1.28.2)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 2.21.1

[√] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 7.0 (API 24) (emulator)

• No issues found!

Error:

ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: type 'Transition' is not a subtype of type 'bool'
E/flutter (25785): #0      Get.to (package:get/src/get_main.dart:59:32)
E/flutter (25785): #1      _SplashScreenState.goToNextPage.<anonymous closure> (package:amack_v4_backend/ui/screens/splash_screen.dart:57:9)
E/flutter (25785): #2      _rootRun (dart:async/zone.dart:1180:38)
E/flutter (25785): #3      _CustomZone.run (dart:async/zone.dart:1077:19)
E/flutter (25785): #4      _CustomZone.runGuarded (dart:async/zone.dart:979:7)
E/flutter (25785): #5      _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1019:23)
E/flutter (25785): #6      _rootRun (dart:async/zone.dart:1184:13)
E/flutter (25785): #7      _CustomZone.run (dart:async/zone.dart:1077:19)
E/flutter (25785): #8      _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:1003:23)
E/flutter (25785): #9      Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:23:15)
E/flutter (25785): #10     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
E/flutter (25785): #11     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
E/flutter (25785): #12     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
E/flutter (25785): 

Thanks for your issue, I checked this out this morning.

This is a problem with the latest version of Dart and ternaries.
transition: GetPlatform.isIOS? Transition.cupertino: Transition.fade,
In any programming language in the universe, upon finding a Boolean, the instruction checks that there is nothing in front of it before treating the response as a Boolean. A Boolean is only a Boolean if at the end of the line (with a comma or semicolon) it still remains a Boolean.
It turns out that when it finds GetPlatform.isIOS, the compiler just stops, and treats it as an answer instead of checking if it is a ternary.
It's a behavior that shouldn't happen in any language, it didn't happen in Dart until the last development version, but I'll fix it on my own now, and I'll open an issue in dart: lang.

@jonataslaw
Copy link
Owner

fix on version 1.14.1-dev

@mahmoudalaa97
Copy link
Author

Firstly Thank you very much for this awesome plugin , thank you for replying very fast in this issue.

i see this problem in dart in this line :

   transition: transition ?? GetPlatform.isIOS
            ? Transition.cupertino
            : Transition.fade,

@mahmoudalaa97
Copy link
Author

fix on version 1.14.1-dev

I will check it nw and tell you 👍

@mahmoudalaa97
Copy link
Author

fix on version 1.14.1-dev

I Test it nw and its work very good Thank you for fast fix. ❤️

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