Skip to content

Commit 2e59eda

Browse files
committed
V4.0.2
1 parent 956e2c8 commit 2e59eda

File tree

4 files changed

+51
-56
lines changed

4 files changed

+51
-56
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [4.0.2] - 26.04.2020
2+
3+
* removed too strong type check for passed factory parameter
4+
* fixed error message https://github.com/fluttercommunity/get_it/issues/69
5+
6+
17
## [4.0.1] - 19.03.2020
28

39
* overhauled readme

example/pubspec.lock

Lines changed: 31 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@ packages:
1515
url: "https://pub.dartlang.org"
1616
source: hosted
1717
version: "0.39.1"
18-
archive:
19-
dependency: transitive
20-
description:
21-
name: archive
22-
url: "https://pub.dartlang.org"
23-
source: hosted
24-
version: "2.0.11"
2518
args:
2619
dependency: transitive
2720
description:
@@ -35,28 +28,35 @@ packages:
3528
name: async
3629
url: "https://pub.dartlang.org"
3730
source: hosted
38-
version: "2.4.0"
31+
version: "2.4.1"
3932
boolean_selector:
4033
dependency: transitive
4134
description:
4235
name: boolean_selector
4336
url: "https://pub.dartlang.org"
4437
source: hosted
45-
version: "1.0.5"
38+
version: "2.0.0"
4639
charcode:
4740
dependency: transitive
4841
description:
4942
name: charcode
5043
url: "https://pub.dartlang.org"
5144
source: hosted
52-
version: "1.1.2"
45+
version: "1.1.3"
46+
clock:
47+
dependency: transitive
48+
description:
49+
name: clock
50+
url: "https://pub.dartlang.org"
51+
source: hosted
52+
version: "1.0.1"
5353
collection:
5454
dependency: transitive
5555
description:
5656
name: collection
5757
url: "https://pub.dartlang.org"
5858
source: hosted
59-
version: "1.14.11"
59+
version: "1.14.12"
6060
convert:
6161
dependency: transitive
6262
description:
@@ -70,7 +70,7 @@ packages:
7070
name: coverage
7171
url: "https://pub.dartlang.org"
7272
source: hosted
73-
version: "0.13.3+2"
73+
version: "0.13.9"
7474
crypto:
7575
dependency: transitive
7676
description:
@@ -92,6 +92,13 @@ packages:
9292
url: "https://pub.dartlang.org"
9393
source: hosted
9494
version: "0.1.3"
95+
fake_async:
96+
dependency: transitive
97+
description:
98+
name: fake_async
99+
url: "https://pub.dartlang.org"
100+
source: hosted
101+
version: "1.1.0"
95102
flutter:
96103
dependency: "direct main"
97104
description: flutter
@@ -115,7 +122,7 @@ packages:
115122
path: ".."
116123
relative: true
117124
source: path
118-
version: "4.0.0-release-candidate"
125+
version: "4.0.1"
119126
glob:
120127
dependency: transitive
121128
description:
@@ -151,13 +158,6 @@ packages:
151158
url: "https://pub.dartlang.org"
152159
source: hosted
153160
version: "3.1.3"
154-
image:
155-
dependency: transitive
156-
description:
157-
name: image
158-
url: "https://pub.dartlang.org"
159-
source: hosted
160-
version: "2.1.4"
161161
io:
162162
dependency: transitive
163163
description:
@@ -241,7 +241,7 @@ packages:
241241
name: package_config
242242
url: "https://pub.dartlang.org"
243243
source: hosted
244-
version: "1.1.0"
244+
version: "1.9.3"
245245
package_resolver:
246246
dependency: transitive
247247
description:
@@ -255,21 +255,14 @@ packages:
255255
name: path
256256
url: "https://pub.dartlang.org"
257257
source: hosted
258-
version: "1.6.4"
258+
version: "1.7.0"
259259
pedantic:
260260
dependency: transitive
261261
description:
262262
name: pedantic
263263
url: "https://pub.dartlang.org"
264264
source: hosted
265265
version: "1.8.0+1"
266-
petitparser:
267-
dependency: transitive
268-
description:
269-
name: petitparser
270-
url: "https://pub.dartlang.org"
271-
source: hosted
272-
version: "2.4.0"
273266
pool:
274267
dependency: transitive
275268
description:
@@ -284,13 +277,6 @@ packages:
284277
url: "https://pub.dartlang.org"
285278
source: hosted
286279
version: "1.4.2"
287-
quiver:
288-
dependency: transitive
289-
description:
290-
name: quiver
291-
url: "https://pub.dartlang.org"
292-
source: hosted
293-
version: "2.0.5"
294280
shelf:
295281
dependency: transitive
296282
description:
@@ -330,7 +316,7 @@ packages:
330316
name: source_map_stack_trace
331317
url: "https://pub.dartlang.org"
332318
source: hosted
333-
version: "1.1.5"
319+
version: "2.0.0"
334320
source_maps:
335321
dependency: transitive
336322
description:
@@ -344,7 +330,7 @@ packages:
344330
name: source_span
345331
url: "https://pub.dartlang.org"
346332
source: hosted
347-
version: "1.5.5"
333+
version: "1.7.0"
348334
stack_trace:
349335
dependency: transitive
350336
description:
@@ -379,21 +365,21 @@ packages:
379365
name: test
380366
url: "https://pub.dartlang.org"
381367
source: hosted
382-
version: "1.9.4"
368+
version: "1.14.2"
383369
test_api:
384370
dependency: transitive
385371
description:
386372
name: test_api
387373
url: "https://pub.dartlang.org"
388374
source: hosted
389-
version: "0.2.11"
375+
version: "0.2.15"
390376
test_core:
391377
dependency: transitive
392378
description:
393379
name: test_core
394380
url: "https://pub.dartlang.org"
395381
source: hosted
396-
version: "0.2.15"
382+
version: "0.3.3"
397383
typed_data:
398384
dependency: transitive
399385
description:
@@ -429,13 +415,13 @@ packages:
429415
url: "https://pub.dartlang.org"
430416
source: hosted
431417
version: "1.1.0"
432-
xml:
418+
webkit_inspection_protocol:
433419
dependency: transitive
434420
description:
435-
name: xml
421+
name: webkit_inspection_protocol
436422
url: "https://pub.dartlang.org"
437423
source: hosted
438-
version: "3.5.0"
424+
version: "0.5.0+1"
439425
yaml:
440426
dependency: transitive
441427
description:
@@ -444,4 +430,4 @@ packages:
444430
source: hosted
445431
version: "2.2.0"
446432
sdks:
447-
dart: ">=2.6.0 <3.0.0"
433+
dart: ">=2.7.0 <3.0.0"

lib/get_it_impl.dart

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,17 @@ class _ServiceFactory<T, P1, P2> {
104104
switch (factoryType) {
105105
case _ServiceFactoryType.alwaysNew:
106106
if (creationFunctionParam != null) {
107-
assert(
108-
param1 == null || param1.runtimeType == param1Type,
109-
'Incompatible Type passed as param1\n'
110-
'expected: $param1Type actual: ${param1.runtimeType}');
111-
assert(
112-
param2 == null || param2.runtimeType == param2Type,
113-
'Incompatible Type passed as param2\n'
114-
'expected: $param2Type actual: ${param2.runtimeType}');
107+
// param1.runtimeType == param1Type should use 'is' but Dart does
108+
// not support this comparison. For the time being it is therefore
109+
// disabled
110+
// assert(
111+
// param1 == null || param1.runtimeType == param1Type,
112+
// 'Incompatible Type passed as param1\n'
113+
// 'expected: $param1Type actual: ${param1.runtimeType}');
114+
// assert(
115+
// param2 == null || param2.runtimeType == param2Type,
116+
// 'Incompatible Type passed as param2\n'
117+
// 'expected: $param2Type actual: ${param2.runtimeType}');
115118
return creationFunctionParam(param1 as P1, param2 as P2);
116119
} else {
117120
return creationFunction();
@@ -598,7 +601,7 @@ class _GetItImplementation implements GetIt {
598601
throwIf(dependentFactory == null,
599602
ArgumentError('Dependent Type $type is not registered in GetIt'));
600603
throwIfNot(dependentFactory.canBeWaitedFor,
601-
ArgumentError('Dependent Type $type is an async Singleton'));
604+
ArgumentError('Dependent Type $type is not an async Singleton'));
602605
dependentFactory.objectsWaiting.add(serviceFactory.registrationType);
603606
dependentFutureGroup.add(dependentFactory._readyCompleter.future);
604607
});

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: get_it
22
description: Simple direct Service Locator that allows to decouple the interface from a concrete implementation and to access the concrete implementation from everywhere in your App"
3-
version: 4.0.1
3+
version: 4.0.2
44
maintainer: Thomas Burkhart (@escamoteur)
55
authors:
66
- Flutter Community <[email protected]>
@@ -9,7 +9,7 @@ authors:
99
homepage: https://github.com/fluttercommunity/get_it
1010

1111
environment:
12-
sdk: '>=2.0.0-dev<3.0.0'
12+
sdk: '>=2.0.0 < 3.0.0'
1313

1414
dependencies:
1515
async: ^2.4.0

0 commit comments

Comments
 (0)