Showing
1 changed file
with
37 additions
and
38 deletions
1 | - [Gestion de route](#gestion-de-route) | 1 | - [Gestion de route](#gestion-de-route) |
2 | - [Utilisation](#utilisation) | 2 | - [Utilisation](#utilisation) |
3 | - - [xNavigation sans routes nommées](#navigation-sans-routes-nommees) | 3 | + - [Navigation sans nom](#navigation-sans-nom) |
4 | - [Navigation par nom](#navigation-par-nom) | 4 | - [Navigation par nom](#navigation-par-nom) |
5 | - - [Send data to named Routes](#send-data-to-named-routes) | ||
6 | - - [Dynamic urls links](#dynamic-urls-links) | 5 | + - [Envoyer des données aux routes nommées](#envoyer-des-donnes-aux-routes-nommes) |
6 | + - [Liens URL dynamiques](#liens-url-dynamiques) | ||
7 | - [Middleware](#middleware) | 7 | - [Middleware](#middleware) |
8 | - - [Navigation without context](#navigation-without-context) | 8 | + - [Navigation sans context](#navigation-sans-context) |
9 | - [SnackBars](#snackbars) | 9 | - [SnackBars](#snackbars) |
10 | - [Dialogs](#dialogs) | 10 | - [Dialogs](#dialogs) |
11 | - [BottomSheets](#bottomsheets) | 11 | - [BottomSheets](#bottomsheets) |
@@ -247,11 +247,11 @@ print(Get.parameters['user']); | @@ -247,11 +247,11 @@ print(Get.parameters['user']); | ||
247 | // donne: 34954 | 247 | // donne: 34954 |
248 | ``` | 248 | ``` |
249 | 249 | ||
250 | -Et maintenant, tout ce que vous avez à faire est d'utiliser Get.toNamed () pour parcourir vos routes nommées, sans aucun contexte (vous pouvez appeler vos routes directement à partir de votre classe BLoC ou Controller), et lorsque votre application est compilée sur le Web, vos routes apparaîtront dans l'url <3 | 250 | +Et maintenant, tout ce que vous avez à faire est d'utiliser Get.toNamed() pour parcourir vos routes nommées, sans aucun contexte (vous pouvez appeler vos routes directement à partir de votre classe BLoC ou Controller), et lorsque votre application est compilée sur le Web, vos routes apparaîtront dans l'url <3 |
251 | 251 | ||
252 | ### Middleware | 252 | ### Middleware |
253 | 253 | ||
254 | -If you want listen Get events to trigger actions, you can to use routingCallback to it | 254 | +Si vous souhaitez écouter les événements Get pour déclencher des actions, vous pouvez utiliser routingCallback pour le faire: |
255 | 255 | ||
256 | ```dart | 256 | ```dart |
257 | GetMaterialApp( | 257 | GetMaterialApp( |
@@ -263,7 +263,7 @@ GetMaterialApp( | @@ -263,7 +263,7 @@ GetMaterialApp( | ||
263 | ) | 263 | ) |
264 | ``` | 264 | ``` |
265 | 265 | ||
266 | -If you are not using GetMaterialApp, you can use the manual API to attach Middleware observer. | 266 | +Si vous n'utilisez pas GetMaterialApp, vous pouvez utiliser l'API manuelle pour attacher l'observateur Middleware. |
267 | 267 | ||
268 | ```dart | 268 | ```dart |
269 | void main() { | 269 | void main() { |
@@ -273,31 +273,31 @@ void main() { | @@ -273,31 +273,31 @@ void main() { | ||
273 | initialRoute: "/", | 273 | initialRoute: "/", |
274 | navigatorKey: Get.key, | 274 | navigatorKey: Get.key, |
275 | navigatorObservers: [ | 275 | navigatorObservers: [ |
276 | - GetObserver(MiddleWare.observer), // HERE !!! | 276 | + GetObserver(MiddleWare.observer), // ICI !!! |
277 | ], | 277 | ], |
278 | ), | 278 | ), |
279 | ); | 279 | ); |
280 | } | 280 | } |
281 | ``` | 281 | ``` |
282 | 282 | ||
283 | -Create a MiddleWare class | 283 | +Créez une classe MiddleWare |
284 | 284 | ||
285 | ```dart | 285 | ```dart |
286 | class MiddleWare { | 286 | class MiddleWare { |
287 | static observer(Routing routing) { | 287 | static observer(Routing routing) { |
288 | - /// You can listen in addition to the routes, the snackbars, dialogs and bottomsheets on each screen. | ||
289 | - ///If you need to enter any of these 3 events directly here, | ||
290 | - ///you must specify that the event is != Than you are trying to do. | 288 | + /// Vous pouvez écouter en plus des routes, des snackbars, des dialogs et des bottomsheets sur chaque écran. |
289 | + /// Si vous devez saisir l'un de ces 3 événements directement ici, | ||
290 | + /// vous devez spécifier que l'événement est != Ce que vous essayez de faire. | ||
291 | if (routing.current == '/second' && !routing.isSnackbar) { | 291 | if (routing.current == '/second' && !routing.isSnackbar) { |
292 | Get.snackbar("Hi", "You are on second route"); | 292 | Get.snackbar("Hi", "You are on second route"); |
293 | } else if (routing.current =='/third'){ | 293 | } else if (routing.current =='/third'){ |
294 | - print('last route called'); | 294 | + print('dernière route'); |
295 | } | 295 | } |
296 | } | 296 | } |
297 | } | 297 | } |
298 | ``` | 298 | ``` |
299 | 299 | ||
300 | -Now, use Get on your code: | 300 | +Maintenant, utilisez Get sur votre code: |
301 | 301 | ||
302 | ```dart | 302 | ```dart |
303 | class First extends StatelessWidget { | 303 | class First extends StatelessWidget { |
@@ -370,11 +370,11 @@ class Third extends StatelessWidget { | @@ -370,11 +370,11 @@ class Third extends StatelessWidget { | ||
370 | } | 370 | } |
371 | ``` | 371 | ``` |
372 | 372 | ||
373 | -## Navigation without context | 373 | +## Navigation sans context |
374 | 374 | ||
375 | ### SnackBars | 375 | ### SnackBars |
376 | 376 | ||
377 | -To have a simple SnackBar with Flutter, you must get the context of Scaffold, or you must use a GlobalKey attached to your Scaffold | 377 | +Pour avoir un simple SnackBar avec Flutter, vous devez obtenir le 'context' de Scaffold, ou vous devez utiliser un GlobalKey attaché à votre Scaffold |
378 | 378 | ||
379 | ```dart | 379 | ```dart |
380 | final snackBar = SnackBar( | 380 | final snackBar = SnackBar( |
@@ -384,23 +384,22 @@ final snackBar = SnackBar( | @@ -384,23 +384,22 @@ final snackBar = SnackBar( | ||
384 | onPressed: (){} | 384 | onPressed: (){} |
385 | ), | 385 | ), |
386 | ); | 386 | ); |
387 | -// Find the Scaffold in the widget tree and use | ||
388 | -// it to show a SnackBar. | 387 | +// Trouvez le scaffold dans l'arborescence des widgets et utilisez-le pour afficher un SnackBar. |
389 | Scaffold.of(context).showSnackBar(snackBar); | 388 | Scaffold.of(context).showSnackBar(snackBar); |
390 | ``` | 389 | ``` |
391 | 390 | ||
392 | -With Get: | 391 | +Avec Get: |
393 | 392 | ||
394 | ```dart | 393 | ```dart |
395 | Get.snackbar('Hi', 'i am a modern snackbar'); | 394 | Get.snackbar('Hi', 'i am a modern snackbar'); |
396 | ``` | 395 | ``` |
397 | 396 | ||
398 | -With Get, all you have to do is call your Get.snackbar from anywhere in your code or customize it however you want! | 397 | +Avec Get, tout ce que vous avez à faire est d'appeler votre Get.snackbar à partir de n'importe où dans votre code ou de le personnaliser comme vous le souhaitez! |
399 | 398 | ||
400 | ```dart | 399 | ```dart |
401 | Get.snackbar( | 400 | Get.snackbar( |
402 | "Hey i'm a Get SnackBar!", // title | 401 | "Hey i'm a Get SnackBar!", // title |
403 | - "It's unbelievable! I'm using SnackBar without context, without boilerplate, without Scaffold, it is something truly amazing!", // message | 402 | + "C'est incroyable! J'utilise SnackBar sans context, sans code standard, sans Scaffold, c'est quelque chose de vraiment incroyable!", // message |
404 | icon: Icon(Icons.alarm), | 403 | icon: Icon(Icons.alarm), |
405 | shouldIconPulse: true, | 404 | shouldIconPulse: true, |
406 | onTap:(){}, | 405 | onTap:(){}, |
@@ -410,7 +409,7 @@ Get.snackbar( | @@ -410,7 +409,7 @@ Get.snackbar( | ||
410 | ); | 409 | ); |
411 | 410 | ||
412 | 411 | ||
413 | - ////////// ALL FEATURES ////////// | 412 | + ////////// TOUTES LES FONCTIONNALITÉS ////////// |
414 | // Color colorText, | 413 | // Color colorText, |
415 | // Duration duration, | 414 | // Duration duration, |
416 | // SnackPosition snackPosition, | 415 | // SnackPosition snackPosition, |
@@ -447,18 +446,18 @@ Get.snackbar( | @@ -447,18 +446,18 @@ Get.snackbar( | ||
447 | /////////////////////////////////// | 446 | /////////////////////////////////// |
448 | ``` | 447 | ``` |
449 | 448 | ||
450 | -If you prefer the traditional snackbar, or want to customize it from scratch, including adding just one line (Get.snackbar makes use of a mandatory title and message), you can use | ||
451 | -`Get.rawSnackbar();` which provides the RAW API on which Get.snackbar was built. | 449 | +Si vous préférez le snack-bar traditionnel, ou souhaitez le personnaliser à partir de zéro, y compris en ajoutant une seule ligne (Get.snackbar utilise un titre et un message obligatoires), vous pouvez utiliser |
450 | +`Get.rawSnackbar ();` qui fournit l'API brute sur laquelle Get.snackbar a été construit. | ||
452 | 451 | ||
453 | ### Dialogs | 452 | ### Dialogs |
454 | 453 | ||
455 | -To open dialog: | 454 | +Pour ouvrir un 'dialog': |
456 | 455 | ||
457 | ```dart | 456 | ```dart |
458 | -Get.dialog(YourDialogWidget()); | 457 | +Get.dialog(VotreDialogWidget()); |
459 | ``` | 458 | ``` |
460 | 459 | ||
461 | -To open default dialog: | 460 | +Pour ouvrir le 'dialog' par défaut: |
462 | 461 | ||
463 | ```dart | 462 | ```dart |
464 | Get.defaultDialog( | 463 | Get.defaultDialog( |
@@ -467,15 +466,15 @@ Get.defaultDialog( | @@ -467,15 +466,15 @@ Get.defaultDialog( | ||
467 | ); | 466 | ); |
468 | ``` | 467 | ``` |
469 | 468 | ||
470 | -You can also use Get.generalDialog instead of showGeneralDialog. | 469 | +Vous pouvez également utiliser Get.generalDialog au lieu de showGeneralDialog. |
471 | 470 | ||
472 | -For all other Flutter dialog widgets, including cupertinos, you can use Get.overlayContext instead of context, and open it anywhere in your code. | ||
473 | -For widgets that don't use Overlay, you can use Get.context. | ||
474 | -These two contexts will work in 99% of cases to replace the context of your UI, except for cases where inheritedWidget is used without a navigation context. | 471 | +Pour tous les autres widgets de la boîte de dialogue Flutter, y compris cupertinos, vous pouvez utiliser Get.overlayContext au lieu du context et l'ouvrir n'importe où dans votre code. |
472 | +Pour les widgets qui n'utilisent pas Overlay, vous pouvez utiliser Get.context. | ||
473 | +Ces deux contextes fonctionneront dans 99% des cas pour remplacer le context de votre interface utilisateur, sauf dans les cas où inheritedWidget est utilisé sans context de navigation. | ||
475 | 474 | ||
476 | ### BottomSheets | 475 | ### BottomSheets |
477 | 476 | ||
478 | -Get.bottomSheet is like showModalBottomSheet, but don't need of context. | 477 | +Get.bottomSheet est comme showModalBottomSheet, mais n'a pas besoin de 'context'. |
479 | 478 | ||
480 | ```dart | 479 | ```dart |
481 | Get.bottomSheet( | 480 | Get.bottomSheet( |
@@ -500,16 +499,16 @@ Get.bottomSheet( | @@ -500,16 +499,16 @@ Get.bottomSheet( | ||
500 | 499 | ||
501 | ## Nested Navigation | 500 | ## Nested Navigation |
502 | 501 | ||
503 | -Get made Flutter's nested navigation even easier. | ||
504 | -You don't need the context, and you will find your navigation stack by Id. | 502 | +Getx a rendu la navigation imbriquée de Flutter encore plus facile. |
503 | +Vous n'avez pas besoin de 'context' et vous trouverez votre stack de navigation par ID. | ||
505 | 504 | ||
506 | -- NOTE: Creating parallel navigation stacks can be dangerous. The ideal is not to use NestedNavigators, or to use sparingly. If your project requires it, go ahead, but keep in mind that keeping multiple navigation stacks in memory may not be a good idea for RAM consumption. | 505 | +- NOTE: La création de stacks de navigation parallèles peut être dangereuse. L'idéal est de ne pas utiliser NestedNavigators, ou de l'utiliser avec parcimonie. Si votre projet l'exige, allez-y, mais gardez à l'esprit que conserver plusieurs stacks de navigation en mémoire n'est peut-être pas une bonne idée pour la consommation de RAM. |
507 | 506 | ||
508 | -See how simple it is: | 507 | +Voyez comme c'est simple: |
509 | 508 | ||
510 | ```dart | 509 | ```dart |
511 | Navigator( | 510 | Navigator( |
512 | - key: Get.nestedKey(1), // create a key by index | 511 | + key: Get.nestedKey(1), // créez une clé par index |
513 | initialRoute: '/', | 512 | initialRoute: '/', |
514 | onGenerateRoute: (settings) { | 513 | onGenerateRoute: (settings) { |
515 | if (settings.name == '/') { | 514 | if (settings.name == '/') { |
@@ -522,7 +521,7 @@ Navigator( | @@ -522,7 +521,7 @@ Navigator( | ||
522 | child: FlatButton( | 521 | child: FlatButton( |
523 | color: Colors.blue, | 522 | color: Colors.blue, |
524 | onPressed: () { | 523 | onPressed: () { |
525 | - Get.toNamed('/second', id:1); // navigate by your nested route by index | 524 | + Get.toNamed('/second', id:1); // naviguer votre itinéraire imbriqué par index |
526 | }, | 525 | }, |
527 | child: Text("Go to second"), | 526 | child: Text("Go to second"), |
528 | ), | 527 | ), |
-
Please register or login to post a comment