Jonatas

update to 3.25.1

## [3.25.1] - Big update
- Improved the log system to display the tag used in the controller that was created.
## [3.25.0] - Big update
- Added [reload] and [reloadAll] methods to reload your Controller to original values
- Added [FullLifeCycleController] - A GetxController capable of observing all the life cycles of your application. FullLifeCycleController has the life cycles:
... ...
... ... @@ -61,6 +61,7 @@ linter:
avoid_catches_without_on_clauses: true # avoid
avoid_catching_errors: true
use_rethrow_when_possible: true
unrelated_type_equality_checks: true
# DESIGN
use_to_and_as_if_applicable: true # prefer
... ...
... ... @@ -187,6 +187,7 @@ class GetInstance {
permanent,
false,
fenix,
name,
),
);
}
... ... @@ -287,7 +288,11 @@ class GetInstance {
if (i is GetLifeCycleBase) {
if (i.onStart != null) {
i.onStart();
Get.log('"$key" has been initialized');
if (tag == null) {
Get.log('Instance "$S" has been initialized');
} else {
Get.log('Instance "$S" with tag "$tag" has been initialized');
}
}
if (!_singl[key].isSingleton && i.onDelete != null) {
_routesByCreate[Get.reference] ??= HashSet<Function>();
... ... @@ -495,16 +500,35 @@ class _InstanceBuilderFactory<S> {
bool isInit = false;
String tag;
_InstanceBuilderFactory(
this.isSingleton,
this.builderFunc,
this.permanent,
this.isInit,
this.fenix,
this.tag,
);
void _showInitLog() {
if (tag == null) {
Get.log('Instance "$S" has been created');
} else {
Get.log('Instance "$S" has been created with tag "$tag"');
}
}
/// Gets the actual instance by it's [builderFunc] or the persisted instance.
S getDependency() {
return isSingleton ? dependency ??= builderFunc() : builderFunc();
if (isSingleton) {
if (dependency == null) {
_showInitLog();
dependency = builderFunc();
}
return dependency;
} else {
return builderFunc();
}
}
}
... ...
... ... @@ -104,9 +104,12 @@ extension MapExtension<K, V> on Map<K, V> {
}
void assignAll(Map<K, V> val) {
if (val is RxMap && this is RxMap) {
if ((val as RxMap)._value == (this as RxMap)._value) return;
}
if (this is RxMap) {
final map = (this as RxMap);
if (map._value == val || map == val) return;
if (map._value == val) return;
map._value = val;
map.refresh();
} else {
... ...
name: get
description: Open screens/snackbars/dialogs without context, manage states and inject dependencies easily with GetX.
version: 3.25.0
version: 3.25.1
homepage: https://github.com/jonataslaw/getx
environment:
... ...