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

FlutterError - type 'Null' is not a subtype of type 'Controller' in type cast #3101

Open
andiigtayma opened this issue May 17, 2024 · 0 comments
Assignees

Comments

@andiigtayma
Copy link

Describe the bug
Seems to be frequently thrown 3-4 times over the last week. There are other bottom sheets being used in the fashion but the error has not come up over those.

Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: type 'Null' is not a subtype of type 'OrderDetailsController' in type cast. Error thrown .
       at GetWidget.controller(get_view.dart:56)
       at CODMethodSelectionBottomSheet.build.<fn>(cod_method_selection_bottom_sheet.dart:60)
       at GestureRecognizerFactoryWithHandlers.constructor(gesture_detector.dart:101)
       at RxInterface.notifyChildren(rx_interface.dart:26)
       at ObxState.build(rx_obx_widget.dart:56)
       at StatefulElement.build(framework.dart:5592)
       at ComponentElement.performRebuild(framework.dart:5480)
       at StatefulElement.performRebuild(framework.dart:5643)
       at Element.rebuild(framework.dart:5196)
       at BuildOwner.buildScope(framework.dart:2904)
       at WidgetsBinding.drawFrame(binding.dart:989)

Reproduction code

/// in OrderDetailsController
 await Get.bottomSheet(
      CODMethodSelectionBottomSheet(),
      isDismissible: false,
    );


class CODMethodSelectionBottomSheet extends GetWidget<OrderDetailsController> {
}

To Reproduce
I could not find a way to reliably reproduce this issue.

Expected behavior
The Exception should never come up because the controller is always available when calling the code.

Flutter Version: Channel stable, 3.16.9

Getx Version: 4.6.6

Describe on which device you found the bug:
Multiple Devices produced this issue however it appears most commonly on Android 12.

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