Showing
1 changed file
with
15 additions
and
13 deletions
| @@ -9,11 +9,11 @@ This library that will change the way you work with the Framework and save your | @@ -9,11 +9,11 @@ This library that will change the way you work with the Framework and save your | ||
| 9 | 9 | ||
| 10 | ```dart | 10 | ```dart |
| 11 | // Default Flutter navigator | 11 | // Default Flutter navigator |
| 12 | -Navigator.push( | 12 | +Navigator.of(context).push( |
| 13 | context, | 13 | context, |
| 14 | MaterialPageRoute( | 14 | MaterialPageRoute( |
| 15 | - builder: (context) { | ||
| 16 | - return Home(); | 15 | + builder: (BuildContext context) { |
| 16 | + return HomePage(); | ||
| 17 | }, | 17 | }, |
| 18 | ), | 18 | ), |
| 19 | ); | 19 | ); |
| @@ -22,7 +22,7 @@ Navigator.push( | @@ -22,7 +22,7 @@ Navigator.push( | ||
| 22 | Get.to(Home()); | 22 | Get.to(Home()); |
| 23 | ``` | 23 | ``` |
| 24 | 24 | ||
| 25 | -##### If you use master/dev/beta branch of Flutter, use the version 1.19.0-dev. | 25 | +##### If you use master/dev/beta branch of Flutter, use the version 1.19.1-dev. |
| 26 | * If you use MODULAR, add on your MaterialApp this: navigatorKey: Get.addKey(Modular.navigatorKey) | 26 | * If you use MODULAR, add on your MaterialApp this: navigatorKey: Get.addKey(Modular.navigatorKey) |
| 27 | 27 | ||
| 28 | ## How to use? | 28 | ## How to use? |
| @@ -31,7 +31,7 @@ Add this to your package's pubspec.yaml file: | @@ -31,7 +31,7 @@ Add this to your package's pubspec.yaml file: | ||
| 31 | 31 | ||
| 32 | ``` | 32 | ``` |
| 33 | dependencies: | 33 | dependencies: |
| 34 | - get: ^1.15.2 // ^1.19.0-dev on dev/master | 34 | + get: ^1.16.0 // ^1.19.1-dev on beta/dev/master |
| 35 | ``` | 35 | ``` |
| 36 | 36 | ||
| 37 | And import it: | 37 | And import it: |
| @@ -87,31 +87,34 @@ if(data == 'sucess') madeAnything(); | @@ -87,31 +87,34 @@ if(data == 'sucess') madeAnything(); | ||
| 87 | ``` | 87 | ``` |
| 88 | 88 | ||
| 89 | Don't you want to learn our syntax? | 89 | Don't you want to learn our syntax? |
| 90 | -Just change the Navigator (uppercase) to navigator (lowercase), and you will have all the functions of the standard browser, without having to use context | 90 | +Just change the Navigator (uppercase) to navigator (lowercase), and you will have all the functions of the standard navigation, without having to use context |
| 91 | Example: | 91 | Example: |
| 92 | 92 | ||
| 93 | ```dart | 93 | ```dart |
| 94 | + | ||
| 94 | // Default Flutter navigator | 95 | // Default Flutter navigator |
| 95 | -Navigator.push( | 96 | +Navigator.of(context).push( |
| 96 | context, | 97 | context, |
| 97 | MaterialPageRoute( | 98 | MaterialPageRoute( |
| 98 | - builder: (context) { | 99 | + builder: (BuildContext context) { |
| 99 | return HomePage(); | 100 | return HomePage(); |
| 100 | }, | 101 | }, |
| 101 | ), | 102 | ), |
| 102 | ); | 103 | ); |
| 103 | 104 | ||
| 104 | -// Get with no context but Flutter sintax | 105 | +// Get using Flutter syntax without needing context |
| 105 | navigator.push( | 106 | navigator.push( |
| 106 | MaterialPageRoute( | 107 | MaterialPageRoute( |
| 107 | - builder: (context) { | 108 | + builder: (_) { |
| 108 | return HomePage(); | 109 | return HomePage(); |
| 109 | }, | 110 | }, |
| 110 | ), | 111 | ), |
| 111 | ); | 112 | ); |
| 112 | 113 | ||
| 113 | -// Get sintax (Much better, but we respect your opinion) | 114 | +// Get sintax (It is much better, but you have the right to disagree) |
| 114 | Get.to(HomePage()); | 115 | Get.to(HomePage()); |
| 116 | + | ||
| 117 | + | ||
| 115 | ``` | 118 | ``` |
| 116 | 119 | ||
| 117 | ### SnackBars | 120 | ### SnackBars |
| @@ -524,8 +527,7 @@ Get.height / Get.width // Equivalent to the method: MediaQuery.of(context).size. | @@ -524,8 +527,7 @@ Get.height / Get.width // Equivalent to the method: MediaQuery.of(context).size. | ||
| 524 | 527 | ||
| 525 | Get.context // Gives the context of the screen in the foreground anywhere in your code. | 528 | Get.context // Gives the context of the screen in the foreground anywhere in your code. |
| 526 | 529 | ||
| 527 | -@deprecated on 1.17.0 | ||
| 528 | -var arguments = Get.args(context); // Gives current route arguments | 530 | + |
| 529 | ``` | 531 | ``` |
| 530 | 532 | ||
| 531 | This library will always be updated and implementing new features. Feel free to offer PRs and contribute to them. | 533 | This library will always be updated and implementing new features. Feel free to offer PRs and contribute to them. |
-
Please register or login to post a comment