How to pass argument using getx?

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

Get.arguments <= It makes null.

How can I solve this problem?

2 Answers

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

Send arguments

  Map<String, dynamic> parameter = {
      'name': "pradeep",
      'object': SomeObject,
     
    };

Get.rootDelegate.toNamed(Routes.nextpage, arguments: parameter );

Recieve arguments

var someObject= Get.rootDelegate.arguments()['object'];
Related