flutterflutter-getx

How to pass argument using getx?


Get.rootDelegate.toNamed('/note', arguments: 'test_data');

Get.arguments <= It makes null.

How can I solve this problem?


Solution

  • I think you migh be missing something. While you're setting this parameters using the rootDelegate

    onPressed: () => Get.rootDelegate.toNamed(Routes.RECEIVER, arguments: true, parameters: {'bool': 'true'}),
    

    You try to retrieve them from the Get context:

    Get.arguments
    

    You should be using:

    Get.rootDelegate.parameters
    

    Get.rootDelegate.parameters will work