Nipodemos

last changes

Showing 1 changed file with 73 additions and 23 deletions
@@ -15,13 +15,16 @@ @@ -15,13 +15,16 @@
15 - [About Get](#about-get) 15 - [About Get](#about-get)
16 - [The Three pillars](#the-three-pillars) 16 - [The Three pillars](#the-three-pillars)
17 - [State management](#state-management) 17 - [State management](#state-management)
  18 + - [In-depth explanation](#in-depth-explanation)
18 - [Route management](#route-management) 19 - [Route management](#route-management)
  20 + - [In-Depth Explanation](#in-depth-explanation-1)
19 - [Dependency management](#dependency-management) 21 - [Dependency management](#dependency-management)
  22 + - [In-depth explanation](#in-depth-explanation-2)
20 - [How to contribute](#how-to-contribute) 23 - [How to contribute](#how-to-contribute)
21 - [Utils](#utils) 24 - [Utils](#utils)
22 - [Change Theme](#change-theme) 25 - [Change Theme](#change-theme)
23 - - [Other Advanced APIs and Manual configurations](#other-advanced-apis-and-manual-configurations)  
24 - - [Optional Global Settings](#optional-global-settings) 26 + - [Other Advanced APIs](#other-advanced-apis)
  27 + - [Optional Global Settings and Manual configurations](#optional-global-settings-and-manual-configurations)
25 - [Breaking changes from 2.0](#breaking-changes-from-20) 28 - [Breaking changes from 2.0](#breaking-changes-from-20)
26 - [Why I made this package](#why-i-made-this-package) 29 - [Why I made this package](#why-i-made-this-package)
27 30
@@ -94,6 +97,10 @@ class Other extends StatelessWidget { @@ -94,6 +97,10 @@ class Other extends StatelessWidget {
94 97
95 This is a simple project but it already makes clear how powerful Get is. As your project grows, this difference will become more significant. Get was designed to work with teams, but it makes the job of an individual developer simple. Improve your deadlines, deliver everything on time without losing performance. Get is not for everyone, but if you identified with that phrase, Get is for you! 98 This is a simple project but it already makes clear how powerful Get is. As your project grows, this difference will become more significant. Get was designed to work with teams, but it makes the job of an individual developer simple. Improve your deadlines, deliver everything on time without losing performance. Get is not for everyone, but if you identified with that phrase, Get is for you!
96 99
  100 +### In-depth explanation
  101 +
  102 +**See an more in-depth explanation of state management [here](./docs/state_management.md). There you will see more examples and also the differente between the simple stage manager and the reactive state manager**
  103 +
97 ## Route management 104 ## Route management
98 105
99 **See a more in-depth explanation of route management [here](./docs/route_management.md)** 106 **See a more in-depth explanation of route management [here](./docs/route_management.md)**
@@ -140,10 +147,53 @@ var data = await Get.to(Payment()); @@ -140,10 +147,53 @@ var data = await Get.to(Payment());
140 147
141 Noticed that you didn't had to use context to do any of these things? That's one of the biggest advantages of using Get route management. With this, you can execute all these methods from within your controller class, without worries. 148 Noticed that you didn't had to use context to do any of these things? That's one of the biggest advantages of using Get route management. With this, you can execute all these methods from within your controller class, without worries.
142 149
  150 +### In-Depth Explanation
  151 +
143 **Note: Get work with named routes too! As said in the beggining, there is a in-depth documentation [here](./docs/route_management.md)** 152 **Note: Get work with named routes too! As said in the beggining, there is a in-depth documentation [here](./docs/route_management.md)**
144 153
145 ## Dependency management 154 ## Dependency management
146 155
  156 +**See a more in-depth explanation of dependency management [here](./docs/dependency_management.md)**
  157 +
  158 +- Note: If you are using Get's State Manager, you don't have to worry about that, just read for information, but pay more attention to the bindings api, which will do all of this automatically for you.
  159 +
  160 +Are you already using Get and want to make your project as lean as possible? Get has a simple and powerful dependency manager that allows you to retrieve the same class as your Bloc or Controller with just 1 lines of code, no Provider context, no inheritedWidget:
  161 +
  162 +```dart
  163 +Controller controller = Get.put(Controller()); // Rather Controller controller = Controller();
  164 +```
  165 +
  166 +Instead of instantiating your class within the class you are using, you are instantiating it within the Get instance, which will make it available throughout your App.
  167 +So you can use your controller (or class Bloc) normally
  168 +
  169 +```dart
  170 +controller.fetchApi();
  171 +```
  172 +
  173 +Imagine that you have navigated through numerous routes, and you need a data that was left behind in your controller, you would need a state manager combined with the Provider or Get_it, correct? Not with Get. You just need to ask Get to "find" for your controller, you don't need any additional dependencies:
  174 +
  175 +```dart
  176 +Controller controller = Get.find();
  177 +//Yes, it looks like Magic, Get will find your controller, and will deliver it to you. You can have 1 million controllers instantiated, Get will always give you the right controller.
  178 +```
  179 +
  180 +And then you will be able to recover your controller data that was obtained back there:
  181 +
  182 +```dart
  183 +Text(controller.textFromApi);
  184 +```
  185 +
  186 +Looking for lazy loading? You can declare all your controllers, and it will be called only when someone needs it. You can do this with:
  187 +
  188 +```dart
  189 +Get.lazyPut<Service>(()=> ApiMock());
  190 +/// ApiMock will only be called when someone uses Get.find<Service> for the first time
  191 +```
  192 +
  193 +### In-depth explanation
  194 +
  195 +**See a more in-depth explanation of dependency management [here](./docs/dependency_management.md)**
  196 +
147 # How to contribute 197 # How to contribute
148 198
149 *Want to contribute to the project? We will be proud to highlight you as one of our collaborators. Here are some points where you can contribute and make Get (and Flutter) even better.* 199 *Want to contribute to the project? We will be proud to highlight you as one of our collaborators. Here are some points where you can contribute and make Get (and Flutter) even better.*
@@ -180,25 +230,7 @@ If you want to know in depth how to change the theme, you can follow this tutori @@ -180,25 +230,7 @@ If you want to know in depth how to change the theme, you can follow this tutori
180 230
181 - [Dynamic Themes in 3 lines using Get](https://medium.com/swlh/flutter-dynamic-themes-in-3-lines-c3b375f292e3) - Tutorial by [Rod Brown](https://github.com/RodBr). 231 - [Dynamic Themes in 3 lines using Get](https://medium.com/swlh/flutter-dynamic-themes-in-3-lines-c3b375f292e3) - Tutorial by [Rod Brown](https://github.com/RodBr).
182 232
183 -## Other Advanced APIs and Manual configurations  
184 -  
185 -GetMaterialApp configures everything for you, but if you want to configure Get Manually using advanced APIs.  
186 -  
187 -```dart  
188 -MaterialApp(  
189 - navigatorKey: Get.key,  
190 - navigatorObservers: [GetObserver()],  
191 -);  
192 -```  
193 -  
194 -You will also be able to use your own Middleware within GetObserver, this will not influence anything.  
195 -  
196 -```dart  
197 -MaterialApp(  
198 - navigatorKey: Get.key,  
199 - navigatorObservers: [GetObserver(MiddleWare.observer)], // Here  
200 -);  
201 -``` 233 +## Other Advanced APIs
202 234
203 ```dart 235 ```dart
204 Get.arguments // give the current args from currentScreen 236 Get.arguments // give the current args from currentScreen
@@ -235,7 +267,25 @@ Get.contextOverlay // Gives the context of the snackbar/dialog/bottomsheet in th @@ -235,7 +267,25 @@ Get.contextOverlay // Gives the context of the snackbar/dialog/bottomsheet in th
235 267
236 ``` 268 ```
237 269
238 -### Optional Global Settings 270 +### Optional Global Settings and Manual configurations
  271 +
  272 +GetMaterialApp configures everything for you, but if you want to configure Get Manually using advanced APIs.
  273 +
  274 +```dart
  275 +MaterialApp(
  276 + navigatorKey: Get.key,
  277 + navigatorObservers: [GetObserver()],
  278 +);
  279 +```
  280 +
  281 +You will also be able to use your own Middleware within GetObserver, this will not influence anything.
  282 +
  283 +```dart
  284 +MaterialApp(
  285 + navigatorKey: Get.key,
  286 + navigatorObservers: [GetObserver(MiddleWare.observer)], // Here
  287 +);
  288 +```
239 289
240 You can create Global settings for Get. Just add Get.config to your code before pushing any route or do it directly in your GetMaterialApp 290 You can create Global settings for Get. Just add Get.config to your code before pushing any route or do it directly in your GetMaterialApp
241 291
@@ -327,4 +377,4 @@ I know this looks a lot like the package being based on my personal experiences, @@ -327,4 +377,4 @@ I know this looks a lot like the package being based on my personal experiences,
327 377
328 Every time I go through a frustrating experience, I write it down in my schedule, and try to resolve it after completing the project. 378 Every time I go through a frustrating experience, I write it down in my schedule, and try to resolve it after completing the project.
329 379
330 -And then I decided to make a package that have the three things that you will always use: State management, route management and Dependency injection/management 380 +And then I decided to make a package that have the three things that you will always use: State management, route management, Dependency injection/management, internationalization, and storage (the last two are still being made)