Skip to content

Commit

Permalink
Merge pull request #454 from tiagocpeixoto/master
Browse files Browse the repository at this point in the history
fix typos
  • Loading branch information
jonataslaw authored Aug 9, 2020
2 parents 3b50c9f + e928ca0 commit 54e5ddc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion lib/src/instance/extension_instance.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ extension Inst on GetInterface {
Future<bool> delete<S>({String tag, String key}) async =>
GetInstance().delete<S>(tag: tag, key: key);

bool isRegistred<S>({String tag}) => GetInstance().isRegistred<S>(tag: tag);
bool isRegistered<S>({String tag}) => GetInstance().isRegistered<S>(tag: tag);
}
18 changes: 9 additions & 9 deletions lib/src/instance/get_instance.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ class GetInstance {

S findByType<S>(Type type, {String tag}) {
String key = _getKey(type, tag);
return GetConfig._singl[key].getSependency() as S;
return GetConfig._singl[key].getDependency() as S;
}

void startController<S>({String tag}) {
String key = _getKey(S, tag);
final i = GetConfig._singl[key].getSependency();
final i = GetConfig._singl[key].getDependency();

if (i is DisposableInterface) {
i.onStart();
Expand All @@ -134,7 +134,7 @@ class GetInstance {
// final key = _getKey(S, tag);

// if (GetConfig._singl.containsKey(key)) {
// return GetConfig._singl[key].getSependency() as S;
// return GetConfig._singl[key].getDependency() as S;
// } else {
// if (GetConfig._factory.containsKey(key)) {
// S _value = put<S>((GetConfig._factory[key].builder() as S), tag: tag);
Expand All @@ -155,7 +155,7 @@ class GetInstance {
S find<S>({String tag, FcBuilderFunc<S> instance}) {
String key = _getKey(S, tag);

if (isRegistred<S>(tag: tag)) {
if (isRegistered<S>(tag: tag)) {
FcBuilder builder = GetConfig._singl[key] as FcBuilder;
if (builder == null) {
if (tag == null) {
Expand All @@ -166,7 +166,7 @@ class GetInstance {
}
initDependencies<S>(name: tag);

return GetConfig._singl[key].getSependency() as S;
return GetConfig._singl[key].getDependency() as S;
} else {
if (!GetConfig._factory.containsKey(key))
throw " $S not found. You need call put<$S>($S()) before";
Expand Down Expand Up @@ -227,7 +227,7 @@ class GetInstance {
if (GetConfig.isLogEnable) print('[GETX] onClose of $newKey called');
}

GetConfig._singl.removeWhere((oldkey, value) => (oldkey == newKey));
GetConfig._singl.removeWhere((oldKey, value) => (oldKey == newKey));
if (GetConfig._singl.containsKey(newKey)) {
print('[GETX] error on remove object $newKey');
} else {
Expand All @@ -237,8 +237,8 @@ class GetInstance {
return true;
}

/// check if instance is registred
bool isRegistred<S>({String tag}) =>
/// check if instance is registered
bool isRegistered<S>({String tag}) =>
GetConfig._singl.containsKey(_getKey(S, tag));

/// check if instance is prepared
Expand All @@ -259,7 +259,7 @@ class FcBuilder<S> {

FcBuilder(this.isSingleton, this.builderFunc, this.permanent, this.isInit);

S getSependency() {
S getDependency() {
if (isSingleton) {
if (dependency == null) {
dependency = builderFunc() as S;
Expand Down
10 changes: 5 additions & 5 deletions lib/src/state_manager/rx/rx_getbuilder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ class GetImplXState<T extends DisposableInterface> extends State<GetX<T>> {
void initState() {
_observer = Rx();
bool isPrepared = GetInstance().isPrepared<T>();
bool isRegistred = GetInstance().isRegistred<T>();
bool isRegistered = GetInstance().isRegistered<T>();
if (widget.global) {
if (isPrepared) {
if (GetConfig.smartManagement != SmartManagement.keepFactory) {
isCreator = true;
}
controller = GetInstance().find<T>();
} else if (isRegistred) {
} else if (isRegistered) {
controller = GetInstance().find<T>();
isCreator = false;
} else {
Expand Down Expand Up @@ -89,7 +89,7 @@ class GetImplXState<T extends DisposableInterface> extends State<GetX<T>> {
void dispose() {
if (widget.dispose != null) widget.dispose(this);
if (isCreator || widget.assignId) {
if (widget.autoRemove && GetInstance().isRegistred<T>()) {
if (widget.autoRemove && GetInstance().isRegistered<T>()) {
GetInstance().delete<T>();
}
}
Expand All @@ -100,7 +100,7 @@ class GetImplXState<T extends DisposableInterface> extends State<GetX<T>> {
super.dispose();
}

Widget get notifyChilds {
Widget get notifyChildren {
final observer = getObs;
getObs = _observer;
final result = widget.builder(controller);
Expand All @@ -119,5 +119,5 @@ class GetImplXState<T extends DisposableInterface> extends State<GetX<T>> {
}

@override
Widget build(BuildContext context) => notifyChilds;
Widget build(BuildContext context) => notifyChildren;
}
10 changes: 5 additions & 5 deletions lib/src/state_manager/simple/get_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,14 @@ class _GetBuilderState<T extends GetxController> extends State<GetBuilder<T>> {
if (widget.initState != null) widget.initState(this);
if (widget.global) {
final isPrepared = GetInstance().isPrepared<T>(tag: widget.tag);
final isRegistred = GetInstance().isRegistred<T>(tag: widget.tag);
final isRegistered = GetInstance().isRegistered<T>(tag: widget.tag);

if (isPrepared) {
if (GetConfig.smartManagement != SmartManagement.keepFactory) {
isCreator = true;
}
controller = GetInstance().find<T>(tag: widget.tag);
} else if (isRegistred) {
} else if (isRegistered) {
controller = GetInstance().find<T>(tag: widget.tag);
isCreator = false;
} else {
Expand Down Expand Up @@ -240,7 +240,7 @@ class _GetBuilderState<T extends GetxController> extends State<GetBuilder<T>> {
super.dispose();
if (widget.dispose != null) widget.dispose(this);
if (isCreator || widget.assignId) {
if (widget.autoRemove && GetInstance().isRegistred<T>(tag: widget.tag)) {
if (widget.autoRemove && GetInstance().isRegistered<T>(tag: widget.tag)) {
if (remove != null) remove();

GetInstance().delete<T>(tag: widget.tag);
Expand Down Expand Up @@ -268,7 +268,7 @@ class _GetBuilderState<T extends GetxController> extends State<GetBuilder<T>> {
if (widget.didUpdateWidget != null) widget.didUpdateWidget(oldWidget, this);
}

Widget get notifyChilds {
Widget get notifyChildren {
final old = Value._remove;
Value._remove = disposers;
final observer = Value._setter;
Expand All @@ -280,7 +280,7 @@ class _GetBuilderState<T extends GetxController> extends State<GetBuilder<T>> {
}

@override
Widget build(BuildContext context) => notifyChilds;
Widget build(BuildContext context) => notifyChildren;
}

class Value<T> extends GetxController {
Expand Down

0 comments on commit 54e5ddc

Please sign in to comment.