ساختن روت 404 در فلاتر | In Flutter, Getx package unknownRoute
I'm starting to learn Getx in flutter, and using navigation.
I want to set unknownRoute, in case that there is a typo etc in the namedroute, so the app should go to a default page.
I found a simple way that you can skip the main page in "getPage:" because of "initialRoute:" implemented.
return GetMaterialApp(
title: 'Named navigation',
unknownRoute: GetPage(name: '/notfound', page: () => UnknownRoutePage()),
initialRoute: '/',
getPages: [
GetPage(name: '/second', page: () => SecondScreenNamed()),
GetPage(name: '/third', page: () => ThirdParametersScreenNamed()),
GetPage(
name: '/third_with_built_param/:someValue',
page: () => ThirdParametersScreenNamed()),
],
Try it.
+ Date: Sun 22 Jan 2023 | Time: | By: Javad Nasrollahi
|