Jonatas

cleaner structure

1 -{  
2 - "cSpell.enableFiletypes": [  
3 - "markdown"  
4 - ]  
5 -}  
1 # Generated by pub 1 # Generated by pub
2 # See https://dart.dev/tools/pub/glossary#lockfile 2 # See https://dart.dev/tools/pub/glossary#lockfile
3 packages: 3 packages:
  4 + _fe_analyzer_shared:
  5 + dependency: transitive
  6 + description:
  7 + name: _fe_analyzer_shared
  8 + url: "https://pub.dartlang.org"
  9 + source: hosted
  10 + version: "9.0.0"
  11 + analyzer:
  12 + dependency: transitive
  13 + description:
  14 + name: analyzer
  15 + url: "https://pub.dartlang.org"
  16 + source: hosted
  17 + version: "0.40.2"
  18 + args:
  19 + dependency: transitive
  20 + description:
  21 + name: args
  22 + url: "https://pub.dartlang.org"
  23 + source: hosted
  24 + version: "1.6.0"
4 async: 25 async:
5 dependency: transitive 26 dependency: transitive
6 description: 27 description:
7 name: async 28 name: async
8 url: "https://pub.dartlang.org" 29 url: "https://pub.dartlang.org"
9 source: hosted 30 source: hosted
10 - version: "2.4.2" 31 + version: "2.5.0-nullsafety"
11 boolean_selector: 32 boolean_selector:
12 dependency: transitive 33 dependency: transitive
13 description: 34 description:
14 name: boolean_selector 35 name: boolean_selector
15 url: "https://pub.dartlang.org" 36 url: "https://pub.dartlang.org"
16 source: hosted 37 source: hosted
17 - version: "2.0.0" 38 + version: "2.1.0-nullsafety"
18 characters: 39 characters:
19 dependency: transitive 40 dependency: transitive
20 description: 41 description:
21 name: characters 42 name: characters
22 url: "https://pub.dartlang.org" 43 url: "https://pub.dartlang.org"
23 source: hosted 44 source: hosted
24 - version: "1.0.0" 45 + version: "1.1.0-nullsafety.2"
25 charcode: 46 charcode:
26 dependency: transitive 47 dependency: transitive
27 description: 48 description:
28 name: charcode 49 name: charcode
29 url: "https://pub.dartlang.org" 50 url: "https://pub.dartlang.org"
30 source: hosted 51 source: hosted
31 - version: "1.1.3" 52 + version: "1.2.0-nullsafety"
  53 + cli_util:
  54 + dependency: transitive
  55 + description:
  56 + name: cli_util
  57 + url: "https://pub.dartlang.org"
  58 + source: hosted
  59 + version: "0.2.0"
32 clock: 60 clock:
33 dependency: transitive 61 dependency: transitive
34 description: 62 description:
35 name: clock 63 name: clock
36 url: "https://pub.dartlang.org" 64 url: "https://pub.dartlang.org"
37 source: hosted 65 source: hosted
38 - version: "1.0.1" 66 + version: "1.1.0-nullsafety"
39 collection: 67 collection:
40 dependency: transitive 68 dependency: transitive
41 description: 69 description:
42 name: collection 70 name: collection
43 url: "https://pub.dartlang.org" 71 url: "https://pub.dartlang.org"
44 source: hosted 72 source: hosted
45 - version: "1.14.13" 73 + version: "1.15.0-nullsafety.2"
  74 + convert:
  75 + dependency: transitive
  76 + description:
  77 + name: convert
  78 + url: "https://pub.dartlang.org"
  79 + source: hosted
  80 + version: "2.1.1"
  81 + coverage:
  82 + dependency: transitive
  83 + description:
  84 + name: coverage
  85 + url: "https://pub.dartlang.org"
  86 + source: hosted
  87 + version: "0.14.1"
  88 + crypto:
  89 + dependency: transitive
  90 + description:
  91 + name: crypto
  92 + url: "https://pub.dartlang.org"
  93 + source: hosted
  94 + version: "2.1.5"
46 dio: 95 dio:
47 dependency: "direct main" 96 dependency: "direct main"
48 description: 97 description:
@@ -56,7 +105,7 @@ packages: @@ -56,7 +105,7 @@ packages:
56 name: fake_async 105 name: fake_async
57 url: "https://pub.dartlang.org" 106 url: "https://pub.dartlang.org"
58 source: hosted 107 source: hosted
59 - version: "1.1.0" 108 + version: "1.1.0-nullsafety"
60 flutter: 109 flutter:
61 dependency: "direct main" 110 dependency: "direct main"
62 description: flutter 111 description: flutter
@@ -68,12 +117,40 @@ packages: @@ -68,12 +117,40 @@ packages:
68 source: sdk 117 source: sdk
69 version: "0.0.0" 118 version: "0.0.0"
70 get: 119 get:
71 - dependency: "direct main" 120 + dependency: transitive
72 description: 121 description:
73 - path: ".."  
74 - relative: true  
75 - source: path 122 + name: get
  123 + url: "https://pub.dartlang.org"
  124 + source: hosted
76 version: "3.10.2" 125 version: "3.10.2"
  126 + get_test:
  127 + dependency: "direct main"
  128 + description:
  129 + name: get_test
  130 + url: "https://pub.dartlang.org"
  131 + source: hosted
  132 + version: "0.0.3"
  133 + glob:
  134 + dependency: transitive
  135 + description:
  136 + name: glob
  137 + url: "https://pub.dartlang.org"
  138 + source: hosted
  139 + version: "1.2.0"
  140 + http:
  141 + dependency: transitive
  142 + description:
  143 + name: http
  144 + url: "https://pub.dartlang.org"
  145 + source: hosted
  146 + version: "0.12.2"
  147 + http_multi_server:
  148 + dependency: transitive
  149 + description:
  150 + name: http_multi_server
  151 + url: "https://pub.dartlang.org"
  152 + source: hosted
  153 + version: "2.2.0"
77 http_parser: 154 http_parser:
78 dependency: transitive 155 dependency: transitive
79 description: 156 description:
@@ -81,87 +158,270 @@ packages: @@ -81,87 +158,270 @@ packages:
81 url: "https://pub.dartlang.org" 158 url: "https://pub.dartlang.org"
82 source: hosted 159 source: hosted
83 version: "3.1.4" 160 version: "3.1.4"
  161 + image_test_utils:
  162 + dependency: transitive
  163 + description:
  164 + name: image_test_utils
  165 + url: "https://pub.dartlang.org"
  166 + source: hosted
  167 + version: "1.0.0"
  168 + io:
  169 + dependency: transitive
  170 + description:
  171 + name: io
  172 + url: "https://pub.dartlang.org"
  173 + source: hosted
  174 + version: "0.3.4"
  175 + js:
  176 + dependency: transitive
  177 + description:
  178 + name: js
  179 + url: "https://pub.dartlang.org"
  180 + source: hosted
  181 + version: "0.6.3-nullsafety"
  182 + logging:
  183 + dependency: transitive
  184 + description:
  185 + name: logging
  186 + url: "https://pub.dartlang.org"
  187 + source: hosted
  188 + version: "0.11.4"
84 matcher: 189 matcher:
85 dependency: transitive 190 dependency: transitive
86 description: 191 description:
87 name: matcher 192 name: matcher
88 url: "https://pub.dartlang.org" 193 url: "https://pub.dartlang.org"
89 source: hosted 194 source: hosted
90 - version: "0.12.8" 195 + version: "0.12.10-nullsafety"
91 meta: 196 meta:
92 dependency: transitive 197 dependency: transitive
93 description: 198 description:
94 name: meta 199 name: meta
95 url: "https://pub.dartlang.org" 200 url: "https://pub.dartlang.org"
96 source: hosted 201 source: hosted
97 - version: "1.1.8" 202 + version: "1.3.0-nullsafety.2"
  203 + mime:
  204 + dependency: transitive
  205 + description:
  206 + name: mime
  207 + url: "https://pub.dartlang.org"
  208 + source: hosted
  209 + version: "0.9.7"
  210 + mockito:
  211 + dependency: transitive
  212 + description:
  213 + name: mockito
  214 + url: "https://pub.dartlang.org"
  215 + source: hosted
  216 + version: "3.0.2"
  217 + node_interop:
  218 + dependency: transitive
  219 + description:
  220 + name: node_interop
  221 + url: "https://pub.dartlang.org"
  222 + source: hosted
  223 + version: "1.1.1"
  224 + node_io:
  225 + dependency: transitive
  226 + description:
  227 + name: node_io
  228 + url: "https://pub.dartlang.org"
  229 + source: hosted
  230 + version: "1.1.1"
  231 + node_preamble:
  232 + dependency: transitive
  233 + description:
  234 + name: node_preamble
  235 + url: "https://pub.dartlang.org"
  236 + source: hosted
  237 + version: "1.4.12"
  238 + package_config:
  239 + dependency: transitive
  240 + description:
  241 + name: package_config
  242 + url: "https://pub.dartlang.org"
  243 + source: hosted
  244 + version: "1.9.3"
98 path: 245 path:
99 dependency: transitive 246 dependency: transitive
100 description: 247 description:
101 name: path 248 name: path
102 url: "https://pub.dartlang.org" 249 url: "https://pub.dartlang.org"
103 source: hosted 250 source: hosted
104 - version: "1.7.0" 251 + version: "1.8.0-nullsafety"
  252 + pedantic:
  253 + dependency: transitive
  254 + description:
  255 + name: pedantic
  256 + url: "https://pub.dartlang.org"
  257 + source: hosted
  258 + version: "1.10.0-nullsafety"
  259 + pool:
  260 + dependency: transitive
  261 + description:
  262 + name: pool
  263 + url: "https://pub.dartlang.org"
  264 + source: hosted
  265 + version: "1.5.0-nullsafety"
  266 + pub_semver:
  267 + dependency: transitive
  268 + description:
  269 + name: pub_semver
  270 + url: "https://pub.dartlang.org"
  271 + source: hosted
  272 + version: "1.4.4"
  273 + shelf:
  274 + dependency: transitive
  275 + description:
  276 + name: shelf
  277 + url: "https://pub.dartlang.org"
  278 + source: hosted
  279 + version: "0.7.9"
  280 + shelf_packages_handler:
  281 + dependency: transitive
  282 + description:
  283 + name: shelf_packages_handler
  284 + url: "https://pub.dartlang.org"
  285 + source: hosted
  286 + version: "2.0.0"
  287 + shelf_static:
  288 + dependency: transitive
  289 + description:
  290 + name: shelf_static
  291 + url: "https://pub.dartlang.org"
  292 + source: hosted
  293 + version: "0.2.8"
  294 + shelf_web_socket:
  295 + dependency: transitive
  296 + description:
  297 + name: shelf_web_socket
  298 + url: "https://pub.dartlang.org"
  299 + source: hosted
  300 + version: "0.2.3"
105 sky_engine: 301 sky_engine:
106 dependency: transitive 302 dependency: transitive
107 description: flutter 303 description: flutter
108 source: sdk 304 source: sdk
109 version: "0.0.99" 305 version: "0.0.99"
  306 + source_map_stack_trace:
  307 + dependency: transitive
  308 + description:
  309 + name: source_map_stack_trace
  310 + url: "https://pub.dartlang.org"
  311 + source: hosted
  312 + version: "2.1.0-nullsafety.1"
  313 + source_maps:
  314 + dependency: transitive
  315 + description:
  316 + name: source_maps
  317 + url: "https://pub.dartlang.org"
  318 + source: hosted
  319 + version: "0.10.10-nullsafety"
110 source_span: 320 source_span:
111 dependency: transitive 321 dependency: transitive
112 description: 322 description:
113 name: source_span 323 name: source_span
114 url: "https://pub.dartlang.org" 324 url: "https://pub.dartlang.org"
115 source: hosted 325 source: hosted
116 - version: "1.7.0" 326 + version: "1.8.0-nullsafety"
117 stack_trace: 327 stack_trace:
118 dependency: transitive 328 dependency: transitive
119 description: 329 description:
120 name: stack_trace 330 name: stack_trace
121 url: "https://pub.dartlang.org" 331 url: "https://pub.dartlang.org"
122 source: hosted 332 source: hosted
123 - version: "1.9.5" 333 + version: "1.10.0-nullsafety"
124 stream_channel: 334 stream_channel:
125 dependency: transitive 335 dependency: transitive
126 description: 336 description:
127 name: stream_channel 337 name: stream_channel
128 url: "https://pub.dartlang.org" 338 url: "https://pub.dartlang.org"
129 source: hosted 339 source: hosted
130 - version: "2.0.0" 340 + version: "2.1.0-nullsafety"
131 string_scanner: 341 string_scanner:
132 dependency: transitive 342 dependency: transitive
133 description: 343 description:
134 name: string_scanner 344 name: string_scanner
135 url: "https://pub.dartlang.org" 345 url: "https://pub.dartlang.org"
136 source: hosted 346 source: hosted
137 - version: "1.0.5" 347 + version: "1.1.0-nullsafety"
138 term_glyph: 348 term_glyph:
139 dependency: transitive 349 dependency: transitive
140 description: 350 description:
141 name: term_glyph 351 name: term_glyph
142 url: "https://pub.dartlang.org" 352 url: "https://pub.dartlang.org"
143 source: hosted 353 source: hosted
144 - version: "1.1.0" 354 + version: "1.2.0-nullsafety"
  355 + test:
  356 + dependency: transitive
  357 + description:
  358 + name: test
  359 + url: "https://pub.dartlang.org"
  360 + source: hosted
  361 + version: "1.16.0-nullsafety.4"
145 test_api: 362 test_api:
146 dependency: transitive 363 dependency: transitive
147 description: 364 description:
148 name: test_api 365 name: test_api
149 url: "https://pub.dartlang.org" 366 url: "https://pub.dartlang.org"
150 source: hosted 367 source: hosted
151 - version: "0.2.17" 368 + version: "0.2.19-nullsafety"
  369 + test_core:
  370 + dependency: transitive
  371 + description:
  372 + name: test_core
  373 + url: "https://pub.dartlang.org"
  374 + source: hosted
  375 + version: "0.3.12-nullsafety.4"
152 typed_data: 376 typed_data:
153 dependency: transitive 377 dependency: transitive
154 description: 378 description:
155 name: typed_data 379 name: typed_data
156 url: "https://pub.dartlang.org" 380 url: "https://pub.dartlang.org"
157 source: hosted 381 source: hosted
158 - version: "1.2.0" 382 + version: "1.3.0-nullsafety.2"
159 vector_math: 383 vector_math:
160 dependency: transitive 384 dependency: transitive
161 description: 385 description:
162 name: vector_math 386 name: vector_math
163 url: "https://pub.dartlang.org" 387 url: "https://pub.dartlang.org"
164 source: hosted 388 source: hosted
165 - version: "2.0.8" 389 + version: "2.1.0-nullsafety.2"
  390 + vm_service:
  391 + dependency: transitive
  392 + description:
  393 + name: vm_service
  394 + url: "https://pub.dartlang.org"
  395 + source: hosted
  396 + version: "5.0.0+1"
  397 + watcher:
  398 + dependency: transitive
  399 + description:
  400 + name: watcher
  401 + url: "https://pub.dartlang.org"
  402 + source: hosted
  403 + version: "0.9.7+15"
  404 + web_socket_channel:
  405 + dependency: transitive
  406 + description:
  407 + name: web_socket_channel
  408 + url: "https://pub.dartlang.org"
  409 + source: hosted
  410 + version: "1.1.0"
  411 + webkit_inspection_protocol:
  412 + dependency: transitive
  413 + description:
  414 + name: webkit_inspection_protocol
  415 + url: "https://pub.dartlang.org"
  416 + source: hosted
  417 + version: "0.7.3"
  418 + yaml:
  419 + dependency: transitive
  420 + description:
  421 + name: yaml
  422 + url: "https://pub.dartlang.org"
  423 + source: hosted
  424 + version: "2.2.1"
166 sdks: 425 sdks:
167 - dart: ">=2.9.0-14.0.dev <3.0.0" 426 + dart: ">=2.10.0-0.0.dev <2.10.0"
  427 + flutter: ">=1.17.0 <2.0.0"
@@ -26,9 +26,10 @@ dependencies: @@ -26,9 +26,10 @@ dependencies:
26 26
27 # The following adds the Cupertino Icons font to your application. 27 # The following adds the Cupertino Icons font to your application.
28 # Use with the CupertinoIcons class for iOS style icons. 28 # Use with the CupertinoIcons class for iOS style icons.
29 - get:  
30 - path: ../ 29 + # get:
  30 + # path: ../
31 dio: ^3.0.9 31 dio: ^3.0.9
  32 + get_test:
32 33
33 dev_dependencies: 34 dev_dependencies:
34 flutter_test: 35 flutter_test:
1 import 'dart:math'; 1 import 'dart:math';
2 - 2 +import 'package:flutter/material.dart';
3 import 'package:flutter_test/flutter_test.dart'; 3 import 'package:flutter_test/flutter_test.dart';
4 import 'package:get/get.dart'; 4 import 'package:get/get.dart';
5 import 'package:get_demo/pages/home/domain/adapters/repository_adapter.dart'; 5 import 'package:get_demo/pages/home/domain/adapters/repository_adapter.dart';
6 import 'package:get_demo/pages/home/domain/entity/cases_model.dart'; 6 import 'package:get_demo/pages/home/domain/entity/cases_model.dart';
7 import 'package:get_demo/pages/home/presentation/controllers/home_controller.dart'; 7 import 'package:get_demo/pages/home/presentation/controllers/home_controller.dart';
8 -import 'package:matcher/matcher.dart'; 8 +import 'package:get_demo/routes/app_pages.dart';
  9 +import 'package:get_test/get_test.dart';
  10 +import 'package:matcher/matcher.dart' as m;
9 11
10 class MockRepository implements IHomeRepository { 12 class MockRepository implements IHomeRepository {
11 @override 13 @override
@@ -43,7 +45,7 @@ void main() { @@ -43,7 +45,7 @@ void main() {
43 }); 45 });
44 test('Test Controller', () async { 46 test('Test Controller', () async {
45 /// Controller can't be on memory 47 /// Controller can't be on memory
46 - expect(() => Get.find<HomeController>(), throwsA(TypeMatcher<String>())); 48 + expect(() => Get.find<HomeController>(), throwsA(m.TypeMatcher<String>()));
47 49
48 /// build Binding 50 /// build Binding
49 binding.builder(); 51 binding.builder();
@@ -69,4 +71,104 @@ void main() { @@ -69,4 +71,104 @@ void main() {
69 expect(controller.cases.value.global.totalConfirmed, 200); 71 expect(controller.cases.value.global.totalConfirmed, 200);
70 } 72 }
71 }); 73 });
  74 +
  75 + /// Tests with GetTests
  76 + getTest(
  77 + "test description",
  78 + getPages: AppPages.routes,
  79 + initialRoute: AppPages.INITIAL,
  80 + widgetTest: (tester) async {
  81 + expect('/home', Get.currentRoute);
  82 +
  83 + Get.toNamed('/country');
  84 + expect('/country', Get.currentRoute);
  85 +
  86 + Get.toNamed('/details');
  87 + expect('/details', Get.currentRoute);
  88 +
  89 + Get.back();
  90 +
  91 + expect('/country', Get.currentRoute);
  92 + },
  93 + );
  94 +
  95 + testGetX(
  96 + 'GetX test',
  97 + widget: GetX<Controller>(
  98 + init: Controller(),
  99 + builder: (controller) {
  100 + return Text("ban:${controller.count}");
  101 + },
  102 + ),
  103 + test: (e) {
  104 + expect(find.text("ban:0"), findsOneWidget);
  105 + expect(e.count.value, 0);
  106 + },
  107 + );
  108 +
  109 + testGetBuilder(
  110 + 'GetBuilder test',
  111 + widget: GetBuilder<Controller>(
  112 + init: Controller(),
  113 + builder: (controller) {
  114 + return Text("ban:${controller.count}");
  115 + },
  116 + ),
  117 + test: (e) {
  118 + expect(find.text("ban:0"), findsOneWidget);
  119 + expect(e.count.value, 0);
  120 + },
  121 + );
  122 +
  123 + testObx(
  124 + 'Obx test',
  125 + widget: (controller) => Obx(
  126 + () => Text("ban:${controller.count}"),
  127 + ),
  128 + controller: Controller(),
  129 + test: (e) {
  130 + expect(find.text("ban:0"), findsOneWidget);
  131 + expect(e.count.value, 0);
  132 + },
  133 + );
  134 +
  135 + testController<Controller>(
  136 + 'Controller test',
  137 + (controller) {
  138 + print('controllllllll ${controller.count}');
  139 + },
  140 + controller: Controller(),
  141 + onInit: (c) {
  142 + c.increment();
  143 + print('onInit');
  144 + },
  145 + onReady: (c) {
  146 + print('onReady');
  147 + c.increment();
  148 + },
  149 + onClose: (c) {
  150 + print('onClose');
  151 + },
  152 + );
  153 +}
  154 +
  155 +class Controller extends GetxController {
  156 + final count = 0.obs;
  157 + void increment() => count.value++;
  158 +
  159 + @override
  160 + void onInit() {
  161 + print('inittt');
  162 + super.onInit();
  163 + }
  164 +
  165 + @override
  166 + void onReady() {
  167 + print('onReady');
  168 + super.onReady();
  169 + }
  170 +
  171 + void onClose() {
  172 + print('onClose');
  173 + }
72 } 174 }
  1 +import '../navigation/root/smart_management.dart';
  2 +import 'log.dart';
  3 +
1 /// Use Get.to instead of Navigator.push, Get.off instead 4 /// Use Get.to instead of Navigator.push, Get.off instead
2 /// of Navigator.pushReplacement, 5 /// of Navigator.pushReplacement,
3 /// Get.offAll instead of Navigator.pushAndRemoveUntil. 6 /// Get.offAll instead of Navigator.pushAndRemoveUntil.
@@ -6,5 +9,10 @@ @@ -6,5 +9,10 @@
6 /// To return to the previous screen, use Get.back(). 9 /// To return to the previous screen, use Get.back().
7 /// No need to pass any context to Get, just put the name of the route inside 10 /// No need to pass any context to Get, just put the name of the route inside
8 /// the parentheses and the magic will occur. 11 /// the parentheses and the magic will occur.
  12 +abstract class GetInterface {
  13 + SmartManagement smartManagement = SmartManagement.full;
  14 + String reference;
  15 + bool isLogEnable = true;
  16 + LogWriterCallback log = defaultLogWriterCallback;
  17 +}
9 18
10 -abstract class GetInterface {}  
1 import 'dart:developer' as developer; 1 import 'dart:developer' as developer;
2 -  
3 -import '../../instance_manager.dart'; 2 +import 'get_main.dart';
4 3
5 typedef LogWriterCallback = void Function(String text, {bool isError}); 4 typedef LogWriterCallback = void Function(String text, {bool isError});
6 5
7 void defaultLogWriterCallback(String value, {bool isError = false}) { 6 void defaultLogWriterCallback(String value, {bool isError = false}) {
8 - if (isError || GetConfig.isLogEnable) developer.log(value, name: 'GETX'); 7 + if (isError || Get.isLogEnable) developer.log(value, name: 'GETX');
9 } 8 }
@@ -8,7 +8,7 @@ extension Inst on GetInterface { @@ -8,7 +8,7 @@ extension Inst on GetInterface {
8 /// the Instance and persisted as a Singleton (like you would use 8 /// the Instance and persisted as a Singleton (like you would use
9 /// [Get.put()]). 9 /// [Get.put()]).
10 /// 10 ///
11 - /// Using [GetConfig.smartManagement] as [SmartManagement.keepFactory] has 11 + /// Using [Get.smartManagement] as [SmartManagement.keepFactory] has
12 /// the same outcome 12 /// the same outcome
13 /// as using [fenix:true] : 13 /// as using [fenix:true] :
14 /// The internal register of [builder()] will remain in memory to recreate 14 /// The internal register of [builder()] will remain in memory to recreate
@@ -73,7 +73,7 @@ extension Inst on GetInterface { @@ -73,7 +73,7 @@ extension Inst on GetInterface {
73 /// of the same Type<[S]> the [tag] does **not** conflict with the same tags 73 /// of the same Type<[S]> the [tag] does **not** conflict with the same tags
74 /// used by other [dependencies] Types. 74 /// used by other [dependencies] Types.
75 /// - [permanent] keeps the Instance in memory and persist it, 75 /// - [permanent] keeps the Instance in memory and persist it,
76 - /// not following [GetConfig.smartManagement] 76 + /// not following [Get.smartManagement]
77 /// rules. Although, can be removed by [GetInstance.reset()] 77 /// rules. Although, can be removed by [GetInstance.reset()]
78 /// and [Get.delete()] 78 /// and [Get.delete()]
79 /// - [builder] If defined, the [dependency] must be returned from here 79 /// - [builder] If defined, the [dependency] must be returned from here
1 import 'dart:async'; 1 import 'dart:async';
2 import 'dart:collection'; 2 import 'dart:collection';
3 -  
4 -import '../core/log.dart'; 3 +import '../core/get_main.dart';
5 import '../navigation/root/smart_management.dart'; 4 import '../navigation/root/smart_management.dart';
6 import '../state_manager/rx/rx_core/rx_interface.dart'; 5 import '../state_manager/rx/rx_core/rx_interface.dart';
7 -import '../utils/queue/get_queue.dart';  
8 -  
9 -// ignore: avoid_classes_with_only_static_members  
10 -class GetConfig {  
11 - static SmartManagement smartManagement = SmartManagement.full;  
12 - static bool isLogEnable = true;  
13 - static LogWriterCallback log = defaultLogWriterCallback;  
14 - static String currentRoute;  
15 -}  
16 6
17 class GetInstance { 7 class GetInstance {
18 factory GetInstance() => _getInstance ??= GetInstance._(); 8 factory GetInstance() => _getInstance ??= GetInstance._();
@@ -21,7 +11,7 @@ class GetInstance { @@ -21,7 +11,7 @@ class GetInstance {
21 11
22 static GetInstance _getInstance; 12 static GetInstance _getInstance;
23 13
24 - static final config = GetConfig(); 14 + // static final config = Get();
25 15
26 /// Holds references to every registered Instance when using 16 /// Holds references to every registered Instance when using
27 /// [Get.put()] 17 /// [Get.put()]
@@ -31,25 +21,23 @@ class GetInstance { @@ -31,25 +21,23 @@ class GetInstance {
31 /// [Get.lazyPut()] 21 /// [Get.lazyPut()]
32 static final Map<String, _Lazy> _factory = {}; 22 static final Map<String, _Lazy> _factory = {};
33 23
34 - /// Holds a reference to [GetConfig.currentRoute] when the Instance was 24 + /// Holds a reference to [Get.reference] when the Instance was
35 /// created to manage the memory. 25 /// created to manage the memory.
36 static final Map<String, String> _routesKey = {}; 26 static final Map<String, String> _routesKey = {};
37 27
38 /// Stores the onClose() references of instances created with [Get.create()] 28 /// Stores the onClose() references of instances created with [Get.create()]
39 - /// using the [GetConfig.currentRoute]. 29 + /// using the [Get.reference].
40 /// Experimental feature to keep the lifecycle and memory management with 30 /// Experimental feature to keep the lifecycle and memory management with
41 /// non-singleton instances. 31 /// non-singleton instances.
42 static final Map<String, HashSet<Function>> _routesByCreate = {}; 32 static final Map<String, HashSet<Function>> _routesByCreate = {};
43 33
44 - static final _queue = GetQueue();  
45 -  
46 /// Creates a new Instance<S> lazily from the [<S>builder()] callback. 34 /// Creates a new Instance<S> lazily from the [<S>builder()] callback.
47 /// 35 ///
48 /// The first time you call [Get.find()], the [builder()] callback will create 36 /// The first time you call [Get.find()], the [builder()] callback will create
49 /// the Instance and persisted as a Singleton (like you would 37 /// the Instance and persisted as a Singleton (like you would
50 /// use [Get.put()]). 38 /// use [Get.put()]).
51 /// 39 ///
52 - /// Using [GetConfig.smartManagement] as [SmartManagement.keepFactory] has 40 + /// Using [Get.smartManagement] as [SmartManagement.keepFactory] has
53 /// the same outcome as using [fenix:true] : 41 /// the same outcome as using [fenix:true] :
54 /// The internal register of [builder()] will remain in memory to recreate 42 /// The internal register of [builder()] will remain in memory to recreate
55 /// the Instance if the Instance has been removed with [Get.delete()]. 43 /// the Instance if the Instance has been removed with [Get.delete()].
@@ -94,7 +82,7 @@ class GetInstance { @@ -94,7 +82,7 @@ class GetInstance {
94 /// - [tag] optionally, use a [tag] as an "id" to create multiple records of 82 /// - [tag] optionally, use a [tag] as an "id" to create multiple records of
95 /// the same Type<[S]> 83 /// the same Type<[S]>
96 /// - [permanent] keeps the Instance in memory, not following 84 /// - [permanent] keeps the Instance in memory, not following
97 - /// [GetConfig.smartManagement] rules. 85 + /// [Get.smartManagement] rules.
98 S put<S>( 86 S put<S>(
99 S dependency, { 87 S dependency, {
100 String tag, 88 String tag,
@@ -113,7 +101,7 @@ class GetInstance { @@ -113,7 +101,7 @@ class GetInstance {
113 /// Every time [find]<[S]>() is used, it calls the builder method to generate 101 /// Every time [find]<[S]>() is used, it calls the builder method to generate
114 /// a new Instance [S]. 102 /// a new Instance [S].
115 /// It also registers each [instance.onClose()] with the current 103 /// It also registers each [instance.onClose()] with the current
116 - /// Route [GetConfig.currentRoute] to keep the lifecycle active. 104 + /// Route [Get.reference] to keep the lifecycle active.
117 /// Is important to know that the instances created are only stored per Route. 105 /// Is important to know that the instances created are only stored per Route.
118 /// So, if you call `Get.delete<T>()` the "instance factory" used in this 106 /// So, if you call `Get.delete<T>()` the "instance factory" used in this
119 /// method ([Get.create<T>()]) will be removed, but NOT the instances 107 /// method ([Get.create<T>()]) will be removed, but NOT the instances
@@ -150,7 +138,7 @@ class GetInstance { @@ -150,7 +138,7 @@ class GetInstance {
150 } 138 }
151 139
152 /// Clears from memory registered Instances associated with [routeName] when 140 /// Clears from memory registered Instances associated with [routeName] when
153 - /// using [GetConfig.smartManagement] as [SmartManagement.full] or 141 + /// using [Get.smartManagement] as [SmartManagement.full] or
154 /// [SmartManagement.keepFactory] 142 /// [SmartManagement.keepFactory]
155 /// Meant for internal usage of [GetPageRoute] and [GetDialogRoute] 143 /// Meant for internal usage of [GetPageRoute] and [GetDialogRoute]
156 Future<void> removeDependencyByRoute(String routeName) async { 144 Future<void> removeDependencyByRoute(String routeName) async {
@@ -187,8 +175,8 @@ class GetInstance { @@ -187,8 +175,8 @@ class GetInstance {
187 /// Initializes the dependencies for a Class Instance [S] (or tag), 175 /// Initializes the dependencies for a Class Instance [S] (or tag),
188 /// If its a Controller, it starts the lifecycle process. 176 /// If its a Controller, it starts the lifecycle process.
189 /// Optionally associating the current Route to the lifetime of the instance, 177 /// Optionally associating the current Route to the lifetime of the instance,
190 - /// if [GetConfig.smartManagement] is marked as [SmartManagement.full] or  
191 - /// [GetConfig.keepFactory] 178 + /// if [Get.smartManagement] is marked as [SmartManagement.full] or
  179 + /// [Get.keepFactory]
192 /// Only flags `isInit` if it's using `Get.create()` 180 /// Only flags `isInit` if it's using `Get.create()`
193 /// (not for Singletons access). 181 /// (not for Singletons access).
194 bool _initDependencies<S>({String name}) { 182 bool _initDependencies<S>({String name}) {
@@ -198,7 +186,7 @@ class GetInstance { @@ -198,7 +186,7 @@ class GetInstance {
198 _startController<S>(tag: name); 186 _startController<S>(tag: name);
199 if (_singl[key].isSingleton) { 187 if (_singl[key].isSingleton) {
200 _singl[key].isInit = true; 188 _singl[key].isInit = true;
201 - if (GetConfig.smartManagement != SmartManagement.onlyBuilder) { 189 + if (Get.smartManagement != SmartManagement.onlyBuilder) {
202 _registerRouteInstance<S>(tag: name); 190 _registerRouteInstance<S>(tag: name);
203 } 191 }
204 } 192 }
@@ -209,7 +197,7 @@ class GetInstance { @@ -209,7 +197,7 @@ class GetInstance {
209 /// Links a Class instance [S] (or [tag]) to the current route. 197 /// Links a Class instance [S] (or [tag]) to the current route.
210 /// Requires usage of [GetMaterialApp]. 198 /// Requires usage of [GetMaterialApp].
211 void _registerRouteInstance<S>({String tag}) { 199 void _registerRouteInstance<S>({String tag}) {
212 - _routesKey.putIfAbsent(_getKey(S, tag), () => GetConfig.currentRoute); 200 + _routesKey.putIfAbsent(_getKey(S, tag), () => Get.reference);
213 } 201 }
214 202
215 /// Finds and returns a Instance<[S]> (or [tag]) without further processing. 203 /// Finds and returns a Instance<[S]> (or [tag]) without further processing.
@@ -225,11 +213,11 @@ class GetInstance { @@ -225,11 +213,11 @@ class GetInstance {
225 if (i is DisposableInterface) { 213 if (i is DisposableInterface) {
226 if (i.onStart != null) { 214 if (i.onStart != null) {
227 i.onStart(); 215 i.onStart();
228 - GetConfig.log('"$key" has been initialized'); 216 + Get.log('"$key" has been initialized');
229 } 217 }
230 if (!_singl[key].isSingleton && i.onClose != null) { 218 if (!_singl[key].isSingleton && i.onClose != null) {
231 - _routesByCreate[GetConfig.currentRoute] ??= HashSet<Function>();  
232 - _routesByCreate[GetConfig.currentRoute].add(i.onClose); 219 + _routesByCreate[Get.reference] ??= HashSet<Function>();
  220 + _routesByCreate[Get.reference].add(i.onClose);
233 } 221 }
234 } 222 }
235 } 223 }
@@ -243,7 +231,7 @@ class GetInstance { @@ -243,7 +231,7 @@ class GetInstance {
243 // if (_factory.containsKey(key)) { 231 // if (_factory.containsKey(key)) {
244 // S _value = put<S>((_factory[key].builder() as S), tag: tag); 232 // S _value = put<S>((_factory[key].builder() as S), tag: tag);
245 233
246 - // if (GetConfig.smartManagement != SmartManagement.keepFactory) { 234 + // if (Get.smartManagement != SmartManagement.keepFactory) {
247 // if (!_factory[key].fenix) { 235 // if (!_factory[key].fenix) {
248 // _factory.remove(key); 236 // _factory.remove(key);
249 // } 237 // }
@@ -278,11 +266,11 @@ class GetInstance { @@ -278,11 +266,11 @@ class GetInstance {
278 throw '"$S" not found. You need to call "Get.put($S())" or "Get.lazyPut(()=>$S())"'; 266 throw '"$S" not found. You need to call "Get.put($S())" or "Get.lazyPut(()=>$S())"';
279 } 267 }
280 268
281 - GetConfig.log('Lazy instance "$S" created'); 269 + Get.log('Lazy instance "$S" created');
282 final _value = put<S>(_factory[key].builder() as S, tag: tag); 270 final _value = put<S>(_factory[key].builder() as S, tag: tag);
283 _initDependencies<S>(name: tag); 271 _initDependencies<S>(name: tag);
284 272
285 - if (GetConfig.smartManagement != SmartManagement.keepFactory && 273 + if (Get.smartManagement != SmartManagement.keepFactory &&
286 !_factory[key].fenix) { 274 !_factory[key].fenix) {
287 _factory.remove(key); 275 _factory.remove(key);
288 } 276 }
@@ -339,40 +327,38 @@ class GetInstance { @@ -339,40 +327,38 @@ class GetInstance {
339 Future<bool> delete<S>({String tag, String key, bool force = false}) async { 327 Future<bool> delete<S>({String tag, String key, bool force = false}) async {
340 final newKey = key ?? _getKey(S, tag); 328 final newKey = key ?? _getKey(S, tag);
341 329
342 - return _queue.add<bool>(() async {  
343 - if (!_singl.containsKey(newKey)) {  
344 - GetConfig.log('Instance "$newKey" already removed.', isError: true);  
345 - return false;  
346 - } 330 + if (!_singl.containsKey(newKey)) {
  331 + Get.log('Instance "$newKey" already removed.', isError: true);
  332 + return false;
  333 + }
347 334
348 - final builder = _singl[newKey];  
349 - if (builder.permanent && !force) {  
350 - GetConfig.log(  
351 - // ignore: lines_longer_than_80_chars  
352 - '"$newKey" has been marked as permanent, SmartManagement is not authorized to delete it.',  
353 - isError: true,  
354 - );  
355 - return false;  
356 - }  
357 - final i = builder.dependency; 335 + final builder = _singl[newKey];
  336 + if (builder.permanent && !force) {
  337 + Get.log(
  338 + // ignore: lines_longer_than_80_chars
  339 + '"$newKey" has been marked as permanent, SmartManagement is not authorized to delete it.',
  340 + isError: true,
  341 + );
  342 + return false;
  343 + }
  344 + final i = builder.dependency;
358 345
359 - if (i is GetxService && !force) {  
360 - return false;  
361 - }  
362 - if (i is DisposableInterface) {  
363 - await i.onClose();  
364 - GetConfig.log('"$newKey" onClose() called');  
365 - } 346 + if (i is GetxService && !force) {
  347 + return false;
  348 + }
  349 + if (i is DisposableInterface) {
  350 + await i.onClose();
  351 + Get.log('"$newKey" onClose() called');
  352 + }
366 353
367 - _singl.removeWhere((oldKey, value) => (oldKey == newKey));  
368 - if (_singl.containsKey(newKey)) {  
369 - GetConfig.log('Error removing object "$newKey"', isError: true);  
370 - } else {  
371 - GetConfig.log('"$newKey" deleted from memory');  
372 - }  
373 - // _routesKey?.remove(key);  
374 - return true;  
375 - }); 354 + _singl.removeWhere((oldKey, value) => (oldKey == newKey));
  355 + if (_singl.containsKey(newKey)) {
  356 + Get.log('Error removing object "$newKey"', isError: true);
  357 + } else {
  358 + Get.log('"$newKey" deleted from memory');
  359 + }
  360 + // _routesKey?.remove(key);
  361 + return true;
376 } 362 }
377 363
378 /// Check if a Class Instance<[S]> (or [tag]) is registered in memory. 364 /// Check if a Class Instance<[S]> (or [tag]) is registered in memory.
@@ -403,7 +389,7 @@ class _InstanceBuilderFactory<S> { @@ -403,7 +389,7 @@ class _InstanceBuilderFactory<S> {
403 InstanceBuilderCallback<S> builderFunc; 389 InstanceBuilderCallback<S> builderFunc;
404 390
405 /// Flag to persist the instance in memory, 391 /// Flag to persist the instance in memory,
406 - /// without considering [GetConfig.smartManagement] 392 + /// without considering [Get.smartManagement]
407 bool permanent = false; 393 bool permanent = false;
408 394
409 bool isInit = false; 395 bool isInit = false;
@@ -31,7 +31,7 @@ class GetDialogRoute<T> extends PopupRoute<T> { @@ -31,7 +31,7 @@ class GetDialogRoute<T> extends PopupRoute<T> {
31 31
32 @override 32 @override
33 void dispose() { 33 void dispose() {
34 - if (GetConfig.smartManagement != SmartManagement.onlyBuilder) { 34 + if (Get.smartManagement != SmartManagement.onlyBuilder) {
35 WidgetsBinding.instance.addPostFrameCallback( 35 WidgetsBinding.instance.addPostFrameCallback(
36 (_) => GetInstance().removeDependencyByRoute(name)); 36 (_) => GetInstance().removeDependencyByRoute(name));
37 } 37 }
@@ -11,6 +11,8 @@ import 'root/parse_route.dart'; @@ -11,6 +11,8 @@ import 'root/parse_route.dart';
11 import 'root/root_controller.dart'; 11 import 'root/root_controller.dart';
12 import 'routes/bindings_interface.dart'; 12 import 'routes/bindings_interface.dart';
13 13
  14 +//TODO: Split this class on "Snackbar" "Dialog" "bottomSheet"
  15 +//and "navigation" extensions
14 extension GetNavigation on GetInterface { 16 extension GetNavigation on GetInterface {
15 /// **Navigation.push()** shortcut.<br><br> 17 /// **Navigation.push()** shortcut.<br><br>
16 /// 18 ///
@@ -884,10 +886,10 @@ extension GetNavigation on GetInterface { @@ -884,10 +886,10 @@ extension GetNavigation on GetInterface {
884 bool defaultGlobalState, 886 bool defaultGlobalState,
885 Transition defaultTransition}) { 887 Transition defaultTransition}) {
886 if (enableLog != null) { 888 if (enableLog != null) {
887 - GetConfig.isLogEnable = enableLog; 889 + Get.isLogEnable = enableLog;
888 } 890 }
889 if (logWriterCallback != null) { 891 if (logWriterCallback != null) {
890 - GetConfig.log = logWriterCallback; 892 + Get.log = logWriterCallback;
891 } 893 }
892 if (defaultPopGesture != null) { 894 if (defaultPopGesture != null) {
893 getxController.defaultPopGesture = defaultPopGesture; 895 getxController.defaultPopGesture = defaultPopGesture;
@@ -2,7 +2,6 @@ import 'package:flutter/foundation.dart'; @@ -2,7 +2,6 @@ import 'package:flutter/foundation.dart';
2 import 'package:flutter/material.dart'; 2 import 'package:flutter/material.dart';
3 import '../../../get.dart'; 3 import '../../../get.dart';
4 import '../../core/log.dart'; 4 import '../../core/log.dart';
5 -import '../../instance/get_instance.dart';  
6 import '../extension_navigation.dart'; 5 import '../extension_navigation.dart';
7 import '../routes/get_route.dart'; 6 import '../routes/get_route.dart';
8 import 'root_controller.dart'; 7 import 'root_controller.dart';
@@ -201,18 +200,17 @@ class GetMaterialApp extends StatelessWidget { @@ -201,18 +200,17 @@ class GetMaterialApp extends StatelessWidget {
201 200
202 initialBinding?.dependencies(); 201 initialBinding?.dependencies();
203 Get.addPages(getPages); 202 Get.addPages(getPages);
204 - GetConfig.smartManagement = smartManagement; 203 + Get.smartManagement = smartManagement;
205 onInit?.call(); 204 onInit?.call();
206 205
207 Get.config( 206 Get.config(
208 - enableLog: enableLog ?? GetConfig.isLogEnable, 207 + enableLog: enableLog ?? Get.isLogEnable,
209 logWriterCallback: logWriterCallback, 208 logWriterCallback: logWriterCallback,
210 defaultTransition: defaultTransition ?? Get.defaultTransition, 209 defaultTransition: defaultTransition ?? Get.defaultTransition,
211 defaultOpaqueRoute: opaqueRoute ?? Get.isOpaqueRouteDefault, 210 defaultOpaqueRoute: opaqueRoute ?? Get.isOpaqueRouteDefault,
212 defaultPopGesture: popGesture ?? Get.isPopGestureEnable, 211 defaultPopGesture: popGesture ?? Get.isPopGestureEnable,
213 defaultDurationTransition: 212 defaultDurationTransition:
214 transitionDuration ?? Get.defaultTransitionDuration, 213 transitionDuration ?? Get.defaultTransitionDuration,
215 -  
216 ); 214 );
217 }, 215 },
218 builder: (_) { 216 builder: (_) {
@@ -113,7 +113,7 @@ class GetPageRoute<T> extends PageRoute<T> { @@ -113,7 +113,7 @@ class GetPageRoute<T> extends PageRoute<T> {
113 Animation<double> animation, 113 Animation<double> animation,
114 Animation<double> secondaryAnimation, 114 Animation<double> secondaryAnimation,
115 ) { 115 ) {
116 - GetConfig.currentRoute = settings.name ?? routeName; 116 + Get.reference = settings.name ?? routeName;
117 binding?.dependencies(); 117 binding?.dependencies();
118 if (bindings != null) { 118 if (bindings != null) {
119 for (final binding in bindings) { 119 for (final binding in bindings) {
@@ -374,7 +374,7 @@ class GetPageRoute<T> extends PageRoute<T> { @@ -374,7 +374,7 @@ class GetPageRoute<T> extends PageRoute<T> {
374 374
375 @override 375 @override
376 void dispose() { 376 void dispose() {
377 - if (GetConfig.smartManagement != SmartManagement.onlyBuilder) { 377 + if (Get.smartManagement != SmartManagement.onlyBuilder) {
378 WidgetsBinding.instance.addPostFrameCallback((_) => GetInstance() 378 WidgetsBinding.instance.addPostFrameCallback((_) => GetInstance()
379 .removeDependencyByRoute("${settings?.name ?? routeName}")); 379 .removeDependencyByRoute("${settings?.name ?? routeName}"));
380 } 380 }
1 import 'package:flutter/widgets.dart'; 1 import 'package:flutter/widgets.dart';
2 -  
3 import '../../../../route_manager.dart'; 2 import '../../../../route_manager.dart';
4 -import '../../../instance/get_instance.dart';  
5 import '../../dialog/dialog_route.dart'; 3 import '../../dialog/dialog_route.dart';
6 import '../../snackbar/snack_route.dart'; 4 import '../../snackbar/snack_route.dart';
7 import '../default_route.dart'; 5 import '../default_route.dart';
@@ -96,14 +94,14 @@ class GetObserver extends NavigatorObserver { @@ -96,14 +94,14 @@ class GetObserver extends NavigatorObserver {
96 final newRoute = _RouteData.ofRoute(route); 94 final newRoute = _RouteData.ofRoute(route);
97 95
98 if (newRoute.isSnackbar) { 96 if (newRoute.isSnackbar) {
99 - GetConfig.log("OPEN SNACKBAR ${newRoute.name}"); 97 + Get.log("OPEN SNACKBAR ${newRoute.name}");
100 } else if (newRoute.isBottomSheet || newRoute.isDialog) { 98 } else if (newRoute.isBottomSheet || newRoute.isDialog) {
101 - GetConfig.log("OPEN ${newRoute.name}"); 99 + Get.log("OPEN ${newRoute.name}");
102 } else if (newRoute.isGetPageRoute) { 100 } else if (newRoute.isGetPageRoute) {
103 - GetConfig.log("GOING TO ROUTE ${newRoute.name}"); 101 + Get.log("GOING TO ROUTE ${newRoute.name}");
104 } 102 }
105 103
106 - GetConfig.currentRoute = newRoute.name; 104 + Get.reference = newRoute.name;
107 _routeSend?.update((value) { 105 _routeSend?.update((value) {
108 // Only PageRoute is allowed to change current value 106 // Only PageRoute is allowed to change current value
109 if (route is PageRoute) { 107 if (route is PageRoute) {
@@ -131,14 +129,14 @@ class GetObserver extends NavigatorObserver { @@ -131,14 +129,14 @@ class GetObserver extends NavigatorObserver {
131 final newRoute = _RouteData.ofRoute(route); 129 final newRoute = _RouteData.ofRoute(route);
132 130
133 if (newRoute.isSnackbar) { 131 if (newRoute.isSnackbar) {
134 - GetConfig.log("CLOSE SNACKBAR ${newRoute.name}"); 132 + Get.log("CLOSE SNACKBAR ${newRoute.name}");
135 } else if (newRoute.isBottomSheet || newRoute.isDialog) { 133 } else if (newRoute.isBottomSheet || newRoute.isDialog) {
136 - GetConfig.log("CLOSE ${newRoute.name}"); 134 + Get.log("CLOSE ${newRoute.name}");
137 } else if (newRoute.isGetPageRoute) { 135 } else if (newRoute.isGetPageRoute) {
138 - GetConfig.log("CLOSE TO ROUTE ${newRoute.name}"); 136 + Get.log("CLOSE TO ROUTE ${newRoute.name}");
139 } 137 }
140 138
141 - GetConfig.currentRoute = newRoute.name; 139 + Get.reference = newRoute.name;
142 // Here we use a 'inverse didPush set', meaning that we use 140 // Here we use a 'inverse didPush set', meaning that we use
143 // previous route instead of 'route' because this is 141 // previous route instead of 'route' because this is
144 // a 'inverse push' 142 // a 'inverse push'
@@ -167,10 +165,10 @@ class GetObserver extends NavigatorObserver { @@ -167,10 +165,10 @@ class GetObserver extends NavigatorObserver {
167 final newName = _extractRouteName(newRoute); 165 final newName = _extractRouteName(newRoute);
168 final oldName = _extractRouteName(oldRoute); 166 final oldName = _extractRouteName(oldRoute);
169 167
170 - GetConfig.log("REPLACE ROUTE $oldName");  
171 - GetConfig.log("NEW ROUTE $newName"); 168 + Get.log("REPLACE ROUTE $oldName");
  169 + Get.log("NEW ROUTE $newName");
172 170
173 - GetConfig.currentRoute = newName; 171 + Get.reference = newName;
174 _routeSend?.update((value) { 172 _routeSend?.update((value) {
175 // Only PageRoute is allowed to change current value 173 // Only PageRoute is allowed to change current value
176 if (newRoute is PageRoute) { 174 if (newRoute is PageRoute) {
@@ -195,7 +193,7 @@ class GetObserver extends NavigatorObserver { @@ -195,7 +193,7 @@ class GetObserver extends NavigatorObserver {
195 super.didRemove(route, previousRoute); 193 super.didRemove(route, previousRoute);
196 final routeName = _extractRouteName(route); 194 final routeName = _extractRouteName(route);
197 195
198 - GetConfig.log("REMOVING ROUTE $routeName"); 196 + Get.log("REMOVING ROUTE $routeName");
199 _routeSend?.update((value) { 197 _routeSend?.update((value) {
200 value.route = previousRoute; 198 value.route = previousRoute;
201 value.isBack = false; 199 value.isBack = false;
1 import 'dart:async'; 1 import 'dart:async';
2 2
3 import 'package:flutter/widgets.dart'; 3 import 'package:flutter/widgets.dart';
4 - 4 +import '../../../core/get_main.dart';
5 import '../../../instance/get_instance.dart'; 5 import '../../../instance/get_instance.dart';
6 import '../../../navigation/root/smart_management.dart'; 6 import '../../../navigation/root/smart_management.dart';
7 import '../rx_core/rx_impl.dart'; 7 import '../rx_core/rx_impl.dart';
@@ -52,7 +52,7 @@ class GetImplXState<T extends DisposableInterface> extends State<GetX<T>> { @@ -52,7 +52,7 @@ class GetImplXState<T extends DisposableInterface> extends State<GetX<T>> {
52 52
53 if (widget.global) { 53 if (widget.global) {
54 if (isPrepared) { 54 if (isPrepared) {
55 - if (GetConfig.smartManagement != SmartManagement.keepFactory) { 55 + if (Get.smartManagement != SmartManagement.keepFactory) {
56 isCreator = true; 56 isCreator = true;
57 } 57 }
58 controller = GetInstance().find<T>(tag: widget.tag); 58 controller = GetInstance().find<T>(tag: widget.tag);
@@ -70,8 +70,7 @@ class GetImplXState<T extends DisposableInterface> extends State<GetX<T>> { @@ -70,8 +70,7 @@ class GetImplXState<T extends DisposableInterface> extends State<GetX<T>> {
70 controller?.onStart(); 70 controller?.onStart();
71 } 71 }
72 if (widget.initState != null) widget.initState(this); 72 if (widget.initState != null) widget.initState(this);
73 - if (widget.global &&  
74 - GetConfig.smartManagement == SmartManagement.onlyBuilder) { 73 + if (widget.global && Get.smartManagement == SmartManagement.onlyBuilder) {
75 controller?.onStart(); 74 controller?.onStart();
76 } 75 }
77 subs = _observer.subject.stream.listen((data) => setState(() {})); 76 subs = _observer.subject.stream.listen((data) => setState(() {}));
@@ -183,7 +183,7 @@ class Worker { @@ -183,7 +183,7 @@ class Worker {
183 //final bool _verbose = true; 183 //final bool _verbose = true;
184 void _log(String msg) { 184 void _log(String msg) {
185 // if (!_verbose) return; 185 // if (!_verbose) return;
186 - GetConfig.log('$runtimeType $type $msg'); 186 + Get.log('$runtimeType $type $msg');
187 } 187 }
188 188
189 void dispose() { 189 void dispose() {
1 import 'dart:collection'; 1 import 'dart:collection';
2 -  
3 import 'package:flutter/widgets.dart'; 2 import 'package:flutter/widgets.dart';
4 -  
5 import '../../../state_manager.dart'; 3 import '../../../state_manager.dart';
  4 +import '../../core/get_main.dart';
6 import '../../instance/get_instance.dart'; 5 import '../../instance/get_instance.dart';
7 import '../../navigation/root/smart_management.dart'; 6 import '../../navigation/root/smart_management.dart';
8 import '../rx/rx_core/rx_interface.dart'; 7 import '../rx/rx_core/rx_interface.dart';
@@ -172,7 +171,7 @@ class _GetBuilderState<T extends GetxController> extends State<GetBuilder<T>> @@ -172,7 +171,7 @@ class _GetBuilderState<T extends GetxController> extends State<GetBuilder<T>>
172 final isRegistered = GetInstance().isRegistered<T>(tag: widget.tag); 171 final isRegistered = GetInstance().isRegistered<T>(tag: widget.tag);
173 172
174 if (isPrepared) { 173 if (isPrepared) {
175 - if (GetConfig.smartManagement != SmartManagement.keepFactory) { 174 + if (Get.smartManagement != SmartManagement.keepFactory) {
176 isCreator = true; 175 isCreator = true;
177 } 176 }
178 controller = GetInstance().find<T>(tag: widget.tag); 177 controller = GetInstance().find<T>(tag: widget.tag);
@@ -190,8 +189,7 @@ class _GetBuilderState<T extends GetxController> extends State<GetBuilder<T>> @@ -190,8 +189,7 @@ class _GetBuilderState<T extends GetxController> extends State<GetBuilder<T>>
190 controller?.onStart(); 189 controller?.onStart();
191 } 190 }
192 191
193 - if (widget.global &&  
194 - GetConfig.smartManagement == SmartManagement.onlyBuilder) { 192 + if (widget.global && Get.smartManagement == SmartManagement.onlyBuilder) {
195 controller?.onStart(); 193 controller?.onStart();
196 } 194 }
197 _subscribeToController(); 195 _subscribeToController();
1 import '../../../utils.dart'; 1 import '../../../utils.dart';
2 -import '../regex/get_utils.dart'; 2 +import '../get_utils/get_utils.dart';
3 3
4 extension GetDynamicUtils on dynamic { 4 extension GetDynamicUtils on dynamic {
5 bool get isNull => GetUtils.isNull(this); 5 bool get isNull => GetUtils.isNull(this);
1 import 'dart:ui'; 1 import 'dart:ui';
2 2
3 -import '../regex/get_utils.dart'; 3 +import '../get_utils/get_utils.dart';
4 4
5 extension GetNumUtils on num { 5 extension GetNumUtils on num {
6 bool isLowerThan(num b) => GetUtils.isLowerThan(this, b); 6 bool isLowerThan(num b) => GetUtils.isLowerThan(this, b);
1 -import '../regex/get_utils.dart'; 1 +import '../get_utils/get_utils.dart';
2 2
3 extension GetStringUtils on String { 3 extension GetStringUtils on String {
4 bool get isNum => GetUtils.isNum(this); 4 bool get isNum => GetUtils.isNum(this);
1 -import '../../../get.dart'; 1 +import '../../core/get_main.dart';
2 2
3 /// Returns whether a dynamic value PROBABLY 3 /// Returns whether a dynamic value PROBABLY
4 /// has the isEmpty getter/method by checking 4 /// has the isEmpty getter/method by checking
@@ -70,7 +70,7 @@ class GetUtils { @@ -70,7 +70,7 @@ class GetUtils {
70 return true; 70 return true;
71 } 71 }
72 72
73 - if(value is String) { 73 + if (value is String) {
74 return value.toString().trim().isEmpty; 74 return value.toString().trim().isEmpty;
75 } 75 }
76 76
@@ -372,7 +372,7 @@ class GetUtils { @@ -372,7 +372,7 @@ class GetUtils {
372 } 372 }
373 373
374 return isLengthGreaterOrEqual(value, minLength) && 374 return isLengthGreaterOrEqual(value, minLength) &&
375 - isLengthLowerOrEqual(value, maxLength); 375 + isLengthLessOrEqual(value, maxLength);
376 } 376 }
377 377
378 /// Checks if a contains b (Treating or interpreting upper- and lowercase 378 /// Checks if a contains b (Treating or interpreting upper- and lowercase
@@ -587,6 +587,6 @@ class GetUtils { @@ -587,6 +587,6 @@ class GetUtils {
587 String info, { 587 String info, {
588 bool isError = false, 588 bool isError = false,
589 }) { 589 }) {
590 - GetConfig.log('$prefix $value $info'.trim(), isError: isError); 590 + Get.log('$prefix $value $info'.trim(), isError: isError);
591 } 591 }
592 } 592 }
1 export 'src/utils/extensions/export.dart'; 1 export 'src/utils/extensions/export.dart';
  2 +export 'src/utils/get_utils/get_utils.dart';
2 export 'src/utils/platform/platform.dart'; 3 export 'src/utils/platform/platform.dart';
3 export 'src/utils/queue/get_queue.dart'; 4 export 'src/utils/queue/get_queue.dart';
4 -export 'src/utils/regex/get_utils.dart';  
@@ -7,42 +7,42 @@ packages: @@ -7,42 +7,42 @@ packages:
7 name: async 7 name: async
8 url: "https://pub.dartlang.org" 8 url: "https://pub.dartlang.org"
9 source: hosted 9 source: hosted
10 - version: "2.4.2" 10 + version: "2.5.0-nullsafety"
11 boolean_selector: 11 boolean_selector:
12 dependency: transitive 12 dependency: transitive
13 description: 13 description:
14 name: boolean_selector 14 name: boolean_selector
15 url: "https://pub.dartlang.org" 15 url: "https://pub.dartlang.org"
16 source: hosted 16 source: hosted
17 - version: "2.0.0" 17 + version: "2.1.0-nullsafety"
18 characters: 18 characters:
19 dependency: transitive 19 dependency: transitive
20 description: 20 description:
21 name: characters 21 name: characters
22 url: "https://pub.dartlang.org" 22 url: "https://pub.dartlang.org"
23 source: hosted 23 source: hosted
24 - version: "1.0.0" 24 + version: "1.1.0-nullsafety.2"
25 charcode: 25 charcode:
26 dependency: transitive 26 dependency: transitive
27 description: 27 description:
28 name: charcode 28 name: charcode
29 url: "https://pub.dartlang.org" 29 url: "https://pub.dartlang.org"
30 source: hosted 30 source: hosted
31 - version: "1.1.3" 31 + version: "1.2.0-nullsafety"
32 clock: 32 clock:
33 dependency: transitive 33 dependency: transitive
34 description: 34 description:
35 name: clock 35 name: clock
36 url: "https://pub.dartlang.org" 36 url: "https://pub.dartlang.org"
37 source: hosted 37 source: hosted
38 - version: "1.0.1" 38 + version: "1.1.0-nullsafety"
39 collection: 39 collection:
40 dependency: transitive 40 dependency: transitive
41 description: 41 description:
42 name: collection 42 name: collection
43 url: "https://pub.dartlang.org" 43 url: "https://pub.dartlang.org"
44 source: hosted 44 source: hosted
45 - version: "1.14.13" 45 + version: "1.15.0-nullsafety.2"
46 effective_dart: 46 effective_dart:
47 dependency: "direct dev" 47 dependency: "direct dev"
48 description: 48 description:
@@ -56,7 +56,7 @@ packages: @@ -56,7 +56,7 @@ packages:
56 name: fake_async 56 name: fake_async
57 url: "https://pub.dartlang.org" 57 url: "https://pub.dartlang.org"
58 source: hosted 58 source: hosted
59 - version: "1.1.0" 59 + version: "1.1.0-nullsafety"
60 flutter: 60 flutter:
61 dependency: "direct main" 61 dependency: "direct main"
62 description: flutter 62 description: flutter
@@ -73,21 +73,21 @@ packages: @@ -73,21 +73,21 @@ packages:
73 name: matcher 73 name: matcher
74 url: "https://pub.dartlang.org" 74 url: "https://pub.dartlang.org"
75 source: hosted 75 source: hosted
76 - version: "0.12.8" 76 + version: "0.12.10-nullsafety"
77 meta: 77 meta:
78 dependency: transitive 78 dependency: transitive
79 description: 79 description:
80 name: meta 80 name: meta
81 url: "https://pub.dartlang.org" 81 url: "https://pub.dartlang.org"
82 source: hosted 82 source: hosted
83 - version: "1.1.8" 83 + version: "1.3.0-nullsafety.2"
84 path: 84 path:
85 dependency: transitive 85 dependency: transitive
86 description: 86 description:
87 name: path 87 name: path
88 url: "https://pub.dartlang.org" 88 url: "https://pub.dartlang.org"
89 source: hosted 89 source: hosted
90 - version: "1.7.0" 90 + version: "1.8.0-nullsafety"
91 sky_engine: 91 sky_engine:
92 dependency: transitive 92 dependency: transitive
93 description: flutter 93 description: flutter
@@ -99,55 +99,55 @@ packages: @@ -99,55 +99,55 @@ packages:
99 name: source_span 99 name: source_span
100 url: "https://pub.dartlang.org" 100 url: "https://pub.dartlang.org"
101 source: hosted 101 source: hosted
102 - version: "1.7.0" 102 + version: "1.8.0-nullsafety"
103 stack_trace: 103 stack_trace:
104 dependency: transitive 104 dependency: transitive
105 description: 105 description:
106 name: stack_trace 106 name: stack_trace
107 url: "https://pub.dartlang.org" 107 url: "https://pub.dartlang.org"
108 source: hosted 108 source: hosted
109 - version: "1.9.5" 109 + version: "1.10.0-nullsafety"
110 stream_channel: 110 stream_channel:
111 dependency: transitive 111 dependency: transitive
112 description: 112 description:
113 name: stream_channel 113 name: stream_channel
114 url: "https://pub.dartlang.org" 114 url: "https://pub.dartlang.org"
115 source: hosted 115 source: hosted
116 - version: "2.0.0" 116 + version: "2.1.0-nullsafety"
117 string_scanner: 117 string_scanner:
118 dependency: transitive 118 dependency: transitive
119 description: 119 description:
120 name: string_scanner 120 name: string_scanner
121 url: "https://pub.dartlang.org" 121 url: "https://pub.dartlang.org"
122 source: hosted 122 source: hosted
123 - version: "1.0.5" 123 + version: "1.1.0-nullsafety"
124 term_glyph: 124 term_glyph:
125 dependency: transitive 125 dependency: transitive
126 description: 126 description:
127 name: term_glyph 127 name: term_glyph
128 url: "https://pub.dartlang.org" 128 url: "https://pub.dartlang.org"
129 source: hosted 129 source: hosted
130 - version: "1.1.0" 130 + version: "1.2.0-nullsafety"
131 test_api: 131 test_api:
132 dependency: transitive 132 dependency: transitive
133 description: 133 description:
134 name: test_api 134 name: test_api
135 url: "https://pub.dartlang.org" 135 url: "https://pub.dartlang.org"
136 source: hosted 136 source: hosted
137 - version: "0.2.17" 137 + version: "0.2.19-nullsafety"
138 typed_data: 138 typed_data:
139 dependency: transitive 139 dependency: transitive
140 description: 140 description:
141 name: typed_data 141 name: typed_data
142 url: "https://pub.dartlang.org" 142 url: "https://pub.dartlang.org"
143 source: hosted 143 source: hosted
144 - version: "1.2.0" 144 + version: "1.3.0-nullsafety.2"
145 vector_math: 145 vector_math:
146 dependency: transitive 146 dependency: transitive
147 description: 147 description:
148 name: vector_math 148 name: vector_math
149 url: "https://pub.dartlang.org" 149 url: "https://pub.dartlang.org"
150 source: hosted 150 source: hosted
151 - version: "2.0.8" 151 + version: "2.1.0-nullsafety.2"
152 sdks: 152 sdks:
153 - dart: ">=2.9.0-14.0.dev <3.0.0" 153 + dart: ">=2.10.0-0.0.dev <2.10.0"