in my flutter application, I have 4 types of items to display. Each item has its own View/Pages. Based on which type of item the user clicks, the app needs to load the corresponding page. I am using getx pattern in the app. The routes are defined in app_pages.dart. I have a module for each of the 4 different type pages.
The simplest way I know is to put a condition check on the item's onPressed. But I need to get a proper way of implementing this. Another method I have tried is by adding the condition in the app_pages.dart based on the Ger.arguments. But there the problem is the whole widgets in the stack get rebuild on screen resizing due to the keyboard showing up and all. So at that time, the condition fails because the Get.argument is null.