[docs]: HOw to achive this MaterialRoute(page: StartupView, initial: true, path: '/:uiD?', ), // Optional parameter route
Describe the missing piece of documentation
Hi,
I want to implement url like like https://exy.com/jdhdydhst where 'jdhdydhst' is uiDor id which is optional if uiDexist then load data from api using uiD if it is not exist then load without is . I have tried many ways to do this but not succussed plz help me how to setupup route
@StackedApp( routes: [ // MaterialRoute(page: StartupView), MaterialRoute( page: StartupView, initial: true, path: '/:uiD?', ), // Optional parameter route MaterialRoute(page: HomeView), // @stacked-route ],
Help me how to implement it
Thanks in advance
You'll have to remove the initialRoute part and just use path instead.
You can also remove the ? after the optional path param
And in addition to that you can add a redirect for / to go to /[yourDefaultUid[