Committed by
GitHub
Merge pull request #534 from Nipodemos/fix-renamed-class
[docs] Change "namedRoutes" for "GetPages" in docs
Showing
9 changed files
with
28 additions
and
28 deletions
| @@ -215,9 +215,9 @@ Now you just need to inform your route, that you will use that binding to make t | @@ -215,9 +215,9 @@ Now you just need to inform your route, that you will use that binding to make t | ||
| 215 | - Using named routes: | 215 | - Using named routes: |
| 216 | 216 | ||
| 217 | ```dart | 217 | ```dart |
| 218 | -namedRoutes: { | ||
| 219 | - '/': GetRoute(Home(), binding: HomeBinding()) | ||
| 220 | -} | 218 | +getPages: [ |
| 219 | + GetPage(name: '/', page: () => Home(), binding: HomeBinding()), | ||
| 220 | +] | ||
| 221 | ``` | 221 | ``` |
| 222 | 222 | ||
| 223 | - Using normal routes: | 223 | - Using normal routes: |
| @@ -221,9 +221,9 @@ Ahora solo necesita informar su ruta, que utilizará ese binding para establecer | @@ -221,9 +221,9 @@ Ahora solo necesita informar su ruta, que utilizará ese binding para establecer | ||
| 221 | - Uso de rutas nombradas: | 221 | - Uso de rutas nombradas: |
| 222 | 222 | ||
| 223 | ```dart | 223 | ```dart |
| 224 | -namedRoutes: { | ||
| 225 | - '/': GetRoute(Home(), binding: HomeBinding()) | ||
| 226 | -} | 224 | +getPages: [ |
| 225 | + GetPage(name: '/', page: () => Home(), binding: HomeBinding()), | ||
| 226 | +] | ||
| 227 | ``` | 227 | ``` |
| 228 | 228 | ||
| 229 | - Usando rutas normales: | 229 | - Usando rutas normales: |
| @@ -215,9 +215,9 @@ Agora você só precisa informar sua rota que você vai usar esse binding para f | @@ -215,9 +215,9 @@ Agora você só precisa informar sua rota que você vai usar esse binding para f | ||
| 215 | Usando rotas nomeadas | 215 | Usando rotas nomeadas |
| 216 | 216 | ||
| 217 | ```dart | 217 | ```dart |
| 218 | -namedRoutes: { | ||
| 219 | - '/': GetRoute(Home(), binding: HomeBinding()) | ||
| 220 | -} | 218 | +getPages: [ |
| 219 | + GetPage(name: '/', page: () => Home(), binding: HomeBinding()), | ||
| 220 | +] | ||
| 221 | ``` | 221 | ``` |
| 222 | 222 | ||
| 223 | Usando rotas normais: | 223 | Usando rotas normais: |
| @@ -237,11 +237,11 @@ void main() { | @@ -237,11 +237,11 @@ void main() { | ||
| 237 | runApp( | 237 | runApp( |
| 238 | GetMaterialApp( | 238 | GetMaterialApp( |
| 239 | initialRoute: '/', | 239 | initialRoute: '/', |
| 240 | - namedRoutes: { | ||
| 241 | - '/': GetRoute(page: MyHomePage()), | ||
| 242 | - '/login': GetRoute(page: Login()), | ||
| 243 | - '/cadastro': GetRoute(page: Cadastro(),transition: Transition.cupertino); | ||
| 244 | - }, | 240 | + getPages: [ |
| 241 | + GetPage(name: '/', page: () => Home()), | ||
| 242 | + GetPage(name: '/login', page: () => Login()), | ||
| 243 | + GetPage(name: '/cadastro', page: () => Cadastro(), transition: Transition.cupertino), | ||
| 244 | + ] | ||
| 245 | ) | 245 | ) |
| 246 | ); | 246 | ); |
| 247 | } | 247 | } |
| @@ -283,15 +283,15 @@ Você também pode receber parâmetros nomeados com o Get facilmente: | @@ -283,15 +283,15 @@ Você também pode receber parâmetros nomeados com o Get facilmente: | ||
| 283 | void main() => runApp( | 283 | void main() => runApp( |
| 284 | GetMaterialApp( | 284 | GetMaterialApp( |
| 285 | initialRoute: '/', | 285 | initialRoute: '/', |
| 286 | - namedRoutes: { | ||
| 287 | - '/': GetRoute(page: MyHomePage()), | 286 | + getPages: [ |
| 287 | + GetPage(name: '/', page: () => Home()), | ||
| 288 | /// Importante! ':user' não é uma nova rota, é somente uma | 288 | /// Importante! ':user' não é uma nova rota, é somente uma |
| 289 | /// especificação do parâmentro. Não use '/segunda/:user/' e '/segunda' | 289 | /// especificação do parâmentro. Não use '/segunda/:user/' e '/segunda' |
| 290 | /// se você precisa de uma nova rota para o user, então | 290 | /// se você precisa de uma nova rota para o user, então |
| 291 | /// use '/segunda/user/:user' se '/segunda' for uma rota | 291 | /// use '/segunda/user/:user' se '/segunda' for uma rota |
| 292 | - '/segunda/:user': GetRoute(page: Segunda()), // recebe a ID | ||
| 293 | - '/terceira': GetRoute(page: Terceira(),transition: Transition.cupertino); | ||
| 294 | - }, | 292 | + GetPage(name: '/segunda/:user', page: () => Segunda()), // recebe a ID |
| 293 | + GetPage(name: '/terceira', page: () => Terceira(), transition: Transition.cupertino), | ||
| 294 | + ] | ||
| 295 | ), | 295 | ), |
| 296 | ); | 296 | ); |
| 297 | ``` | 297 | ``` |
| @@ -489,7 +489,7 @@ Navigator( | @@ -489,7 +489,7 @@ Navigator( | ||
| 489 | initialRoute: '/', | 489 | initialRoute: '/', |
| 490 | onGenerateRoute: (settings) { | 490 | onGenerateRoute: (settings) { |
| 491 | if (settings.name == '/') { | 491 | if (settings.name == '/') { |
| 492 | - return GetRouteBase( | 492 | + return GetPageRoute( |
| 493 | page: Scaffold( | 493 | page: Scaffold( |
| 494 | appBar: AppBar( | 494 | appBar: AppBar( |
| 495 | title: Text("Principal"), | 495 | title: Text("Principal"), |
| @@ -506,7 +506,7 @@ Navigator( | @@ -506,7 +506,7 @@ Navigator( | ||
| 506 | ), | 506 | ), |
| 507 | ); | 507 | ); |
| 508 | } else if (settings.name == '/segunda') { | 508 | } else if (settings.name == '/segunda') { |
| 509 | - return GetRouteBase( | 509 | + return GetPageRoute( |
| 510 | page: Center( | 510 | page: Center( |
| 511 | child: Scaffold( | 511 | child: Scaffold( |
| 512 | appBar: AppBar( | 512 | appBar: AppBar( |
| @@ -11,7 +11,7 @@ void main() { | @@ -11,7 +11,7 @@ void main() { | ||
| 11 | ); | 11 | ); |
| 12 | 12 | ||
| 13 | testWidgets( | 13 | testWidgets( |
| 14 | - "GetRoute maintainState null", | 14 | + "GetPage maintainState null", |
| 15 | (WidgetTester testr) async { | 15 | (WidgetTester testr) async { |
| 16 | expect( | 16 | expect( |
| 17 | () => GetPage(page: () => Scaffold(), maintainState: null, name: '/'), | 17 | () => GetPage(page: () => Scaffold(), maintainState: null, name: '/'), |
| @@ -20,7 +20,7 @@ void main() { | @@ -20,7 +20,7 @@ void main() { | ||
| 20 | ); | 20 | ); |
| 21 | 21 | ||
| 22 | testWidgets( | 22 | testWidgets( |
| 23 | - "GetRoute name null", | 23 | + "GetPage name null", |
| 24 | (WidgetTester testr) async { | 24 | (WidgetTester testr) async { |
| 25 | expect( | 25 | expect( |
| 26 | () => | 26 | () => |
| @@ -30,7 +30,7 @@ void main() { | @@ -30,7 +30,7 @@ void main() { | ||
| 30 | ); | 30 | ); |
| 31 | 31 | ||
| 32 | testWidgets( | 32 | testWidgets( |
| 33 | - "GetRoute fullscreenDialog null", | 33 | + "GetPage fullscreenDialog null", |
| 34 | (WidgetTester testr) async { | 34 | (WidgetTester testr) async { |
| 35 | expect( | 35 | expect( |
| 36 | () => GetPage( | 36 | () => GetPage( |
-
Please register or login to post a comment