Nipodemos

adapt to new changes made on original README

@@ -1028,6 +1028,55 @@ Get.config( @@ -1028,6 +1028,55 @@ Get.config(
1028 ) 1028 )
1029 ``` 1029 ```
1030 1030
  1031 +
  1032 +### Nested Navigators
  1033 +
  1034 +Get made Flutter's nested navigation even easier.
  1035 +You don't need the context, and you will find your navigation stack by Id.
  1036 +
  1037 +- 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.
  1038 +
  1039 +See how simple it is:
  1040 +```dart
  1041 +Navigator(
  1042 + key: nestedKey(1), // create a key by index
  1043 + initialRoute: '/',
  1044 + onGenerateRoute: (settings) {
  1045 + if (settings.name == '/') {
  1046 + return GetRouteBase(
  1047 + page: Scaffold(
  1048 + appBar: AppBar(
  1049 + title: Text("Main"),
  1050 + ),
  1051 + body: Center(
  1052 + child: FlatButton(
  1053 + color: Colors.blue,
  1054 + onPressed: () {
  1055 + Get.toNamed('/second', id:1); // navigate by your nested route by index
  1056 + },
  1057 + child: Text("Go to second"),
  1058 + ),
  1059 + ),
  1060 + ),
  1061 + );
  1062 + } else if (settings.name == '/second') {
  1063 + return GetRouteBase(
  1064 + page: Center(
  1065 + child: Scaffold(
  1066 + appBar: AppBar(
  1067 + title: Text("Main"),
  1068 + ),
  1069 + body: Center(
  1070 + child: Text("second")
  1071 + ),
  1072 + ),
  1073 + ),
  1074 + );
  1075 + }
  1076 + }
  1077 +),
  1078 +```
  1079 +
1031 ### Other Advanced APIs and Manual configurations 1080 ### Other Advanced APIs and Manual configurations
1032 GetMaterialApp configures everything for you, but if you want to configure Get Manually using advanced APIs. 1081 GetMaterialApp configures everything for you, but if you want to configure Get Manually using advanced APIs.
1033 1082
@@ -1082,55 +1131,6 @@ Get.contextOverlay // Gives the context of the snackbar/dialog/bottomsheet in th @@ -1082,55 +1131,6 @@ Get.contextOverlay // Gives the context of the snackbar/dialog/bottomsheet in th
1082 1131
1083 ``` 1132 ```
1084 1133
1085 -### Nested Navigators  
1086 -  
1087 -Get made Flutter's nested navigation even easier.  
1088 -You don't need the context, and you will find your navigation stack by Id.  
1089 -  
1090 -- 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.  
1091 -  
1092 -See how simple it is:  
1093 -```dart  
1094 -Navigator(  
1095 - key: nestedKey(1), // create a key by index  
1096 - initialRoute: '/',  
1097 - onGenerateRoute: (settings) {  
1098 - if (settings.name == '/') {  
1099 - return GetRouteBase(  
1100 - page: Scaffold(  
1101 - appBar: AppBar(  
1102 - title: Text("Main"),  
1103 - ),  
1104 - body: Center(  
1105 - child: FlatButton(  
1106 - color: Colors.blue,  
1107 - onPressed: () {  
1108 - Get.toNamed('/second', id:1); // navigate by your nested route by index  
1109 - },  
1110 - child: Text("Go to second"),  
1111 - ),  
1112 - ),  
1113 - ),  
1114 - );  
1115 - } else if (settings.name == '/second') {  
1116 - return GetRouteBase(  
1117 - page: Center(  
1118 - child: Scaffold(  
1119 - appBar: AppBar(  
1120 - title: Text("Main"),  
1121 - ),  
1122 - body: Center(  
1123 - child: Text("second")  
1124 - ),  
1125 - ),  
1126 - ),  
1127 - );  
1128 - }  
1129 - }  
1130 -),  
1131 -```  
1132 -  
1133 -  
1134 This library will always be updated and implementing new features. Feel free to offer PRs and contribute to them. 1134 This library will always be updated and implementing new features. Feel free to offer PRs and contribute to them.
1135 1135
1136 -<a href="https://www.buymeacoffee.com/jonataslaw" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important; box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" > </a> 1136 +
  1 +<a href="https://www.buymeacoffee.com/jonataslaw" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Me compre um café" style="height: 41px !important;width: 174px !important; box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" > </a>
1 ![](get.png) 2 ![](get.png)
2 3
3 *Idiomas: [English](README.md), [Brazilian Portuguese](README.pt-br.md).* 4 *Idiomas: [English](README.md), [Brazilian Portuguese](README.pt-br.md).*
@@ -69,8 +70,6 @@ Essa biblioteca vai mudar a forma que você trabalha com o Framework e salvar se @@ -69,8 +70,6 @@ Essa biblioteca vai mudar a forma que você trabalha com o Framework e salvar se
69 - [Middleware](#middleware) 70 - [Middleware](#middleware)
70 - [Change Theme](#change-theme) 71 - [Change Theme](#change-theme)
71 - [Configurações Globais Opcionais](#configurações-globais-opcionais) 72 - [Configurações Globais Opcionais](#configurações-globais-opcionais)
72 - - [Outras APIs avançadas e Configurações Manuais](#outras-apis-avançadas-e-configurações-manuais)  
73 - - [Nested Navigators](#nested-navigators)  
74 73
75 74
76 75
@@ -1049,6 +1048,54 @@ Get.config( @@ -1049,6 +1048,54 @@ Get.config(
1049 defaultPopGesture = true, 1048 defaultPopGesture = true,
1050 defaultTransition = Transitions.cupertino 1049 defaultTransition = Transitions.cupertino
1051 ) 1050 )
  1051 +
  1052 +### Nested Navigators
  1053 +
  1054 +Get fez a navegação aninhada no Flutter mais fácil ainda. Você não precisa do `context`, e você encontrará sua `navigation stack` pela ID.
  1055 +
  1056 +* Nota: Criar navegação paralela em stacks pode ser perigoso. O idela é não usar `NestedNavigators`, ou usar com moderação. Se o seu projeto requer isso, vá em frente, mas fique ciente que manter múltiplas stacks de navegação na memória pode não ser uma boa ideia no quesito consumo de RAM.
  1057 +
  1058 +Veja como é simples:
  1059 +```dart
  1060 +Navigator(
  1061 + key: nestedKey(1), // crie uma key com um index
  1062 + initialRoute: '/',
  1063 + onGenerateRoute: (settings) {
  1064 + if (settings.name == '/') {
  1065 + return GetRouteBase(
  1066 + page: Scaffold(
  1067 + appBar: AppBar(
  1068 + title: Text("Principal"),
  1069 + ),
  1070 + body: Center(
  1071 + child: FlatButton(
  1072 + color: Colors.blue,
  1073 + child: Text("Ir para a segunda"),
  1074 + onPressed: () {
  1075 + Get.toNamed('/segunda', id:1); // navega pela sua navegação aninhada usando o index
  1076 + },
  1077 + )
  1078 + ),
  1079 + ),
  1080 + );
  1081 + } else if (settings.name == '/segunda') {
  1082 + return GetRouteBase(
  1083 + page: Center(
  1084 + child: Scaffold(
  1085 + appBar: AppBar(
  1086 + title: Text("Principal"),
  1087 + ),
  1088 + body: Center(
  1089 + child: Text("Segunda")
  1090 + ),
  1091 + ),
  1092 + ),
  1093 + );
  1094 + }
  1095 + }
  1096 +),
  1097 +```
  1098 +
1052 ``` 1099 ```
1053 ### Outras APIs avançadas e Configurações Manuais 1100 ### Outras APIs avançadas e Configurações Manuais
1054 1101
@@ -1126,54 +1173,6 @@ Get.contextOverlay @@ -1126,54 +1173,6 @@ Get.contextOverlay
1126 1173
1127 ``` 1174 ```
1128 1175
1129 -### Nested Navigators  
1130 -  
1131 -Get fez a navegação aninhada no Flutter mais fácil ainda. Você não precisa do `context`, e você encontrará sua `navigation stack` pela ID.  
1132 -  
1133 -* Nota: Criar navegação paralela em stacks pode ser perigoso. O idela é não usar `NestedNavigators`, ou usar com moderação. Se o seu projeto requer isso, vá em frente, mas fique ciente que manter múltiplas stacks de navegação na memória pode não ser uma boa ideia no quesito consumo de RAM.  
1134 -  
1135 -Veja como é simples:  
1136 -```dart  
1137 -Navigator(  
1138 - key: nestedKey(1), // crie uma key com um index  
1139 - initialRoute: '/',  
1140 - onGenerateRoute: (settings) {  
1141 - if (settings.name == '/') {  
1142 - return GetRouteBase(  
1143 - page: Scaffold(  
1144 - appBar: AppBar(  
1145 - title: Text("Principal"),  
1146 - ),  
1147 - body: Center(  
1148 - child: FlatButton(  
1149 - color: Colors.blue,  
1150 - child: Text("Ir para a segunda"),  
1151 - onPressed: () {  
1152 - Get.toNamed('/segunda', id:1); // navega pela sua navegação aninhada usando o index  
1153 - },  
1154 - )  
1155 - ),  
1156 - ),  
1157 - );  
1158 - } else if (settings.name == '/segunda') {  
1159 - return GetRouteBase(  
1160 - page: Center(  
1161 - child: Scaffold(  
1162 - appBar: AppBar(  
1163 - title: Text("Principal"),  
1164 - ),  
1165 - body: Center(  
1166 - child: Text("Segunda")  
1167 - ),  
1168 - ),  
1169 - ),  
1170 - );  
1171 - }  
1172 - }  
1173 -),  
1174 -```  
1175 -  
1176 Essa biblioteca sempre será atualizada e terá sempre nova features sendo implementadas. Sinta-se livre para oferecer PRs e contribuir com o package. 1176 Essa biblioteca sempre será atualizada e terá sempre nova features sendo implementadas. Sinta-se livre para oferecer PRs e contribuir com o package.
1177 1177
1178 1178
1179 -<a href="https://www.buymeacoffee.com/jonataslaw" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Me compre um café" style="height: 41px !important;width: 174px !important; box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" > </a>