jonataslaw / getx

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

Get default dialog null on flutter 3 #2505

Open yogithesymbian opened 2 years ago

yogithesymbian commented 2 years ago
[VERBOSE-2:ui_dart_state.cc(198)] Unhandled Exception: Null check operator used on a null value
#0      ExtensionDialog.dialog
package:get/…/src/extension_navigation.dart:81
#1      ExtensionDialog.defaultDialog
package:get/…/src/extension_navigation.dart:262
#2      _UserPageState.build.<anonymous closure>.<anonymous closure>
package:flutter_indonesia_2021/…/user/user_page.dart:31
#3      _UserPageState.build.<anonymous closure>.<anonymous closure>
package:flutter_indonesia_2021/…/user/user_page.dart:22
#4      _InkResponseState._handleTap
package:flutter/…/material/ink_well.dart:1005
#5      GestureRecognizer.invokeCallback
package:flutter/…/gestures/recognizer.dart:198
#6      TapGestureRecognizer.handleTapUp
package:flutter/…/gestures/tap.dart:613
#7      BaseTapGestureRecognizer._checkUp
package:flutter/…/gestures/tap.dart:298
#8      BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/g<…>

my code

floatingActionButton: FloatingActionButton(
            onPressed: () async {
              Get.defaultDialog(
                title: "Welcome to Flutter Dev'S",
              );
            },
            child: Text('Add'),
          ),

get: ^4.6.1

flutter doctor -v [✓] Flutter (Channel stable, 3.0.5, on macOS 12.4 21F79 darwin-arm, locale en-ID) • Flutter version 3.0.5 at /Users/yogiarifwidodo/dev/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision f1875d570e (5 weeks ago), 2022-07-13 11:24:16 -0700 • Engine revision e85ea0e79c • Dart version 2.17.6 • DevTools version 2.12.2 [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /Users/yogiarifwidodo/Library/Android/sdk • Platform android-32, build-tools 30.0.3 • ANDROID_HOME = /Users/yogiarifwidodo/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 13.3) • Xcode at /Applications/Xcode.app/Contents/Developer • CocoaPods version 1.11.0 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2021.2) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) [✓] VS Code (version 1.71.0-insider) • VS Code at /Applications/Visual Studio Code - Insiders.app/Contents • Flutter extension version 3.46.0 [✓] Connected device (3 available) • iPhone 13 Pro Max (mobile) • 1E5AA71E-4BAC-4B5B-93F7-2C9D3E7A97BC • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-4 (simulator) • macOS (desktop) • macos • darwin-arm64 • macOS 12.4 21F79 darwin-arm • Chrome (web) • chrome • web-javascript • Google Chrome 104.0.5112.79 [✓] HTTP Host Availability • All required HTTP hosts are available • No issues found!
GujjuFlutterGuy commented 1 year ago

I faced the same issue while calling Get.defaultDialog(), @yogithesymbian @jonataslaw

Can you guys update anything on this issue?

I have used

get: 4.6.5

flutter doctor -v

[✓] Flutter (Channel stable, 3.3.4, on macOS 12.5.1 21G83 darwin-arm (Rosetta), locale en-IN)
    • Flutter version 3.3.4 on channel stable at /Users/mac-mini-6/Documents/Flutter_sdk/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision eb6d86ee27 (3 months ago), 2022-10-04 22:31:45 -0700
    • Engine revision c08d7d5efc
    • Dart version 2.18.2
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /Users/mac-mini-6/Library/Android/sdk
    • Platform android-33, build-tools 33.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 13F100
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] VS Code (version 1.67.2)
    • VS Code at /Users/mac-mini-6/Downloads/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
                                                                                                                                                                                                                                       Scanning for devices is taking a long time...[✓] Connected device (3 available)
    • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64  • Android 13 (API 33) (emulator)
    • macOS (desktop)             • macos         • darwin-arm64   • macOS 12.5.1 21G83 darwin-arm (Rosetta)
    • Chrome (web)                • chrome        • web-javascript • Google Chrome 108.0.5359.124

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
alaattinbedir commented 1 year ago

I also faced the same issue.

jonataslaw commented 1 year ago

I am on it now

altafkhan8719 commented 1 year ago

i am also facing same issue

Kskz commented 3 months ago

Hi @jonataslaw, any updates?

Kskz commented 3 months ago

I solved the problem by replacing MaterialApp with GetMaterialApp