Showing
1 changed file
with
4 additions
and
4 deletions
@@ -119,6 +119,8 @@ Get.putAsync<SharedPreferences>(() async { | @@ -119,6 +119,8 @@ Get.putAsync<SharedPreferences>(() async { | ||
119 | await prefs.setInt('counter', 12345); | 119 | await prefs.setInt('counter', 12345); |
120 | return prefs; | 120 | return prefs; |
121 | }); | 121 | }); |
122 | + | ||
123 | +Get.putAsync<YourAsyncClass>( () async => await YourAsyncClass() ) | ||
122 | ``` | 124 | ``` |
123 | 125 | ||
124 | This is all options you can set when using putAsync: | 126 | This is all options you can set when using putAsync: |
@@ -136,9 +138,6 @@ Get.putAsync<S>( | @@ -136,9 +138,6 @@ Get.putAsync<S>( | ||
136 | // defaults to false | 138 | // defaults to false |
137 | bool permanent = false | 139 | bool permanent = false |
138 | ) | 140 | ) |
139 | - | ||
140 | -// Example | ||
141 | -Get.putAsync<YourAsyncClass>( () async => await YourAsyncClass() ) | ||
142 | ``` | 141 | ``` |
143 | 142 | ||
144 | ### Get.create | 143 | ### Get.create |
@@ -180,7 +179,8 @@ final controller = Get.find<Controller>(); | @@ -180,7 +179,8 @@ final controller = Get.find<Controller>(); | ||
180 | // OR | 179 | // OR |
181 | Controller controller = Get.find(); | 180 | Controller controller = Get.find(); |
182 | 181 | ||
183 | -//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. | 182 | +// Yes, it looks like Magic, Get will find your controller, and will deliver it to you. |
183 | +// You can have 1 million controllers instantiated, Get will always give you the right controller. | ||
184 | ``` | 184 | ``` |
185 | 185 | ||
186 | And then you will be able to recover your controller data that was obtained back there: | 186 | And then you will be able to recover your controller data that was obtained back there: |
-
Please register or login to post a comment