Jonny Borges
Committed by GitHub

Merge pull request #454 from tiagocpeixoto/master

fix typos
@@ -30,5 +30,5 @@ extension Inst on GetInterface { @@ -30,5 +30,5 @@ extension Inst on GetInterface {
30 Future<bool> delete<S>({String tag, String key}) async => 30 Future<bool> delete<S>({String tag, String key}) async =>
31 GetInstance().delete<S>(tag: tag, key: key); 31 GetInstance().delete<S>(tag: tag, key: key);
32 32
33 - bool isRegistred<S>({String tag}) => GetInstance().isRegistred<S>(tag: tag); 33 + bool isRegistered<S>({String tag}) => GetInstance().isRegistered<S>(tag: tag);
34 } 34 }
@@ -117,12 +117,12 @@ class GetInstance { @@ -117,12 +117,12 @@ class GetInstance {
117 117
118 S findByType<S>(Type type, {String tag}) { 118 S findByType<S>(Type type, {String tag}) {
119 String key = _getKey(type, tag); 119 String key = _getKey(type, tag);
120 - return GetConfig._singl[key].getSependency() as S; 120 + return GetConfig._singl[key].getDependency() as S;
121 } 121 }
122 122
123 void startController<S>({String tag}) { 123 void startController<S>({String tag}) {
124 String key = _getKey(S, tag); 124 String key = _getKey(S, tag);
125 - final i = GetConfig._singl[key].getSependency(); 125 + final i = GetConfig._singl[key].getDependency();
126 126
127 if (i is DisposableInterface) { 127 if (i is DisposableInterface) {
128 i.onStart(); 128 i.onStart();
@@ -134,7 +134,7 @@ class GetInstance { @@ -134,7 +134,7 @@ class GetInstance {
134 // final key = _getKey(S, tag); 134 // final key = _getKey(S, tag);
135 135
136 // if (GetConfig._singl.containsKey(key)) { 136 // if (GetConfig._singl.containsKey(key)) {
137 - // return GetConfig._singl[key].getSependency() as S; 137 + // return GetConfig._singl[key].getDependency() as S;
138 // } else { 138 // } else {
139 // if (GetConfig._factory.containsKey(key)) { 139 // if (GetConfig._factory.containsKey(key)) {
140 // S _value = put<S>((GetConfig._factory[key].builder() as S), tag: tag); 140 // S _value = put<S>((GetConfig._factory[key].builder() as S), tag: tag);
@@ -155,7 +155,7 @@ class GetInstance { @@ -155,7 +155,7 @@ class GetInstance {
155 S find<S>({String tag, FcBuilderFunc<S> instance}) { 155 S find<S>({String tag, FcBuilderFunc<S> instance}) {
156 String key = _getKey(S, tag); 156 String key = _getKey(S, tag);
157 157
158 - if (isRegistred<S>(tag: tag)) { 158 + if (isRegistered<S>(tag: tag)) {
159 FcBuilder builder = GetConfig._singl[key] as FcBuilder; 159 FcBuilder builder = GetConfig._singl[key] as FcBuilder;
160 if (builder == null) { 160 if (builder == null) {
161 if (tag == null) { 161 if (tag == null) {
@@ -166,7 +166,7 @@ class GetInstance { @@ -166,7 +166,7 @@ class GetInstance {
166 } 166 }
167 initDependencies<S>(name: tag); 167 initDependencies<S>(name: tag);
168 168
169 - return GetConfig._singl[key].getSependency() as S; 169 + return GetConfig._singl[key].getDependency() as S;
170 } else { 170 } else {
171 if (!GetConfig._factory.containsKey(key)) 171 if (!GetConfig._factory.containsKey(key))
172 throw " $S not found. You need call put<$S>($S()) before"; 172 throw " $S not found. You need call put<$S>($S()) before";
@@ -227,7 +227,7 @@ class GetInstance { @@ -227,7 +227,7 @@ class GetInstance {
227 if (GetConfig.isLogEnable) print('[GETX] onClose of $newKey called'); 227 if (GetConfig.isLogEnable) print('[GETX] onClose of $newKey called');
228 } 228 }
229 229
230 - GetConfig._singl.removeWhere((oldkey, value) => (oldkey == newKey)); 230 + GetConfig._singl.removeWhere((oldKey, value) => (oldKey == newKey));
231 if (GetConfig._singl.containsKey(newKey)) { 231 if (GetConfig._singl.containsKey(newKey)) {
232 print('[GETX] error on remove object $newKey'); 232 print('[GETX] error on remove object $newKey');
233 } else { 233 } else {
@@ -237,8 +237,8 @@ class GetInstance { @@ -237,8 +237,8 @@ class GetInstance {
237 return true; 237 return true;
238 } 238 }
239 239
240 - /// check if instance is registred  
241 - bool isRegistred<S>({String tag}) => 240 + /// check if instance is registered
  241 + bool isRegistered<S>({String tag}) =>
242 GetConfig._singl.containsKey(_getKey(S, tag)); 242 GetConfig._singl.containsKey(_getKey(S, tag));
243 243
244 /// check if instance is prepared 244 /// check if instance is prepared
@@ -259,7 +259,7 @@ class FcBuilder<S> { @@ -259,7 +259,7 @@ class FcBuilder<S> {
259 259
260 FcBuilder(this.isSingleton, this.builderFunc, this.permanent, this.isInit); 260 FcBuilder(this.isSingleton, this.builderFunc, this.permanent, this.isInit);
261 261
262 - S getSependency() { 262 + S getDependency() {
263 if (isSingleton) { 263 if (isSingleton) {
264 if (dependency == null) { 264 if (dependency == null) {
265 dependency = builderFunc() as S; 265 dependency = builderFunc() as S;
@@ -42,14 +42,14 @@ class GetImplXState<T extends DisposableInterface> extends State<GetX<T>> { @@ -42,14 +42,14 @@ class GetImplXState<T extends DisposableInterface> extends State<GetX<T>> {
42 void initState() { 42 void initState() {
43 _observer = Rx(); 43 _observer = Rx();
44 bool isPrepared = GetInstance().isPrepared<T>(); 44 bool isPrepared = GetInstance().isPrepared<T>();
45 - bool isRegistred = GetInstance().isRegistred<T>(); 45 + bool isRegistered = GetInstance().isRegistered<T>();
46 if (widget.global) { 46 if (widget.global) {
47 if (isPrepared) { 47 if (isPrepared) {
48 if (GetConfig.smartManagement != SmartManagement.keepFactory) { 48 if (GetConfig.smartManagement != SmartManagement.keepFactory) {
49 isCreator = true; 49 isCreator = true;
50 } 50 }
51 controller = GetInstance().find<T>(); 51 controller = GetInstance().find<T>();
52 - } else if (isRegistred) { 52 + } else if (isRegistered) {
53 controller = GetInstance().find<T>(); 53 controller = GetInstance().find<T>();
54 isCreator = false; 54 isCreator = false;
55 } else { 55 } else {
@@ -89,7 +89,7 @@ class GetImplXState<T extends DisposableInterface> extends State<GetX<T>> { @@ -89,7 +89,7 @@ class GetImplXState<T extends DisposableInterface> extends State<GetX<T>> {
89 void dispose() { 89 void dispose() {
90 if (widget.dispose != null) widget.dispose(this); 90 if (widget.dispose != null) widget.dispose(this);
91 if (isCreator || widget.assignId) { 91 if (isCreator || widget.assignId) {
92 - if (widget.autoRemove && GetInstance().isRegistred<T>()) { 92 + if (widget.autoRemove && GetInstance().isRegistered<T>()) {
93 GetInstance().delete<T>(); 93 GetInstance().delete<T>();
94 } 94 }
95 } 95 }
@@ -100,7 +100,7 @@ class GetImplXState<T extends DisposableInterface> extends State<GetX<T>> { @@ -100,7 +100,7 @@ class GetImplXState<T extends DisposableInterface> extends State<GetX<T>> {
100 super.dispose(); 100 super.dispose();
101 } 101 }
102 102
103 - Widget get notifyChilds { 103 + Widget get notifyChildren {
104 final observer = getObs; 104 final observer = getObs;
105 getObs = _observer; 105 getObs = _observer;
106 final result = widget.builder(controller); 106 final result = widget.builder(controller);
@@ -119,5 +119,5 @@ class GetImplXState<T extends DisposableInterface> extends State<GetX<T>> { @@ -119,5 +119,5 @@ class GetImplXState<T extends DisposableInterface> extends State<GetX<T>> {
119 } 119 }
120 120
121 @override 121 @override
122 - Widget build(BuildContext context) => notifyChilds; 122 + Widget build(BuildContext context) => notifyChildren;
123 } 123 }
@@ -205,14 +205,14 @@ class _GetBuilderState<T extends GetxController> extends State<GetBuilder<T>> { @@ -205,14 +205,14 @@ class _GetBuilderState<T extends GetxController> extends State<GetBuilder<T>> {
205 if (widget.initState != null) widget.initState(this); 205 if (widget.initState != null) widget.initState(this);
206 if (widget.global) { 206 if (widget.global) {
207 final isPrepared = GetInstance().isPrepared<T>(tag: widget.tag); 207 final isPrepared = GetInstance().isPrepared<T>(tag: widget.tag);
208 - final isRegistred = GetInstance().isRegistred<T>(tag: widget.tag); 208 + final isRegistered = GetInstance().isRegistered<T>(tag: widget.tag);
209 209
210 if (isPrepared) { 210 if (isPrepared) {
211 if (GetConfig.smartManagement != SmartManagement.keepFactory) { 211 if (GetConfig.smartManagement != SmartManagement.keepFactory) {
212 isCreator = true; 212 isCreator = true;
213 } 213 }
214 controller = GetInstance().find<T>(tag: widget.tag); 214 controller = GetInstance().find<T>(tag: widget.tag);
215 - } else if (isRegistred) { 215 + } else if (isRegistered) {
216 controller = GetInstance().find<T>(tag: widget.tag); 216 controller = GetInstance().find<T>(tag: widget.tag);
217 isCreator = false; 217 isCreator = false;
218 } else { 218 } else {
@@ -240,7 +240,7 @@ class _GetBuilderState<T extends GetxController> extends State<GetBuilder<T>> { @@ -240,7 +240,7 @@ class _GetBuilderState<T extends GetxController> extends State<GetBuilder<T>> {
240 super.dispose(); 240 super.dispose();
241 if (widget.dispose != null) widget.dispose(this); 241 if (widget.dispose != null) widget.dispose(this);
242 if (isCreator || widget.assignId) { 242 if (isCreator || widget.assignId) {
243 - if (widget.autoRemove && GetInstance().isRegistred<T>(tag: widget.tag)) { 243 + if (widget.autoRemove && GetInstance().isRegistered<T>(tag: widget.tag)) {
244 if (remove != null) remove(); 244 if (remove != null) remove();
245 245
246 GetInstance().delete<T>(tag: widget.tag); 246 GetInstance().delete<T>(tag: widget.tag);
@@ -268,7 +268,7 @@ class _GetBuilderState<T extends GetxController> extends State<GetBuilder<T>> { @@ -268,7 +268,7 @@ class _GetBuilderState<T extends GetxController> extends State<GetBuilder<T>> {
268 if (widget.didUpdateWidget != null) widget.didUpdateWidget(oldWidget, this); 268 if (widget.didUpdateWidget != null) widget.didUpdateWidget(oldWidget, this);
269 } 269 }
270 270
271 - Widget get notifyChilds { 271 + Widget get notifyChildren {
272 final old = Value._remove; 272 final old = Value._remove;
273 Value._remove = disposers; 273 Value._remove = disposers;
274 final observer = Value._setter; 274 final observer = Value._setter;
@@ -280,7 +280,7 @@ class _GetBuilderState<T extends GetxController> extends State<GetBuilder<T>> { @@ -280,7 +280,7 @@ class _GetBuilderState<T extends GetxController> extends State<GetBuilder<T>> {
280 } 280 }
281 281
282 @override 282 @override
283 - Widget build(BuildContext context) => notifyChilds; 283 + Widget build(BuildContext context) => notifyChildren;
284 } 284 }
285 285
286 class Value<T> extends GetxController { 286 class Value<T> extends GetxController {