diff --git a/extras/with_built_value/lib/database.g.dart b/extras/with_built_value/lib/database.g.dart index 8d1d81ea..1306902b 100644 --- a/extras/with_built_value/lib/database.g.dart +++ b/extras/with_built_value/lib/database.g.dart @@ -14,9 +14,7 @@ class _$Foo extends Foo { (new FooBuilder()..update(updates)).build(); _$Foo._({this.moorField}) : super._() { - if (moorField == null) { - throw new BuiltValueNullFieldError('Foo', 'moorField'); - } + BuiltValueNullFieldError.checkNotNull(moorField, 'Foo', 'moorField'); } @override @@ -54,8 +52,9 @@ class FooBuilder implements Builder { FooBuilder(); FooBuilder get _$this { - if (_$v != null) { - _moorField = _$v.moorField; + final $v = _$v; + if ($v != null) { + _moorField = $v.moorField; _$v = null; } return this; @@ -63,9 +62,7 @@ class FooBuilder implements Builder { @override void replace(Foo other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } + ArgumentError.checkNotNull(other, 'other'); _$v = other as _$Foo; } @@ -76,7 +73,10 @@ class FooBuilder implements Builder { @override _$Foo build() { - final _$result = _$v ?? new _$Foo._(moorField: moorField); + final _$result = _$v ?? + new _$Foo._( + moorField: BuiltValueNullFieldError.checkNotNull( + moorField, 'Foo', 'moorField')); replace(_$result); return _$result; } diff --git a/extras/with_built_value/pubspec.yaml b/extras/with_built_value/pubspec.yaml index 4a30110a..ca57c779 100644 --- a/extras/with_built_value/pubspec.yaml +++ b/extras/with_built_value/pubspec.yaml @@ -6,13 +6,13 @@ environment: sdk: '>=2.6.0 <3.0.0' dependencies: - moor: ^3.2.0 - built_value: ^7.1.0 + moor: ^4.0.0 + built_value: ^8.0.0 dev_dependencies: - moor_generator: ^2.1.0 - built_value_generator: ^7.1.0 - build_runner: '^1.10.1' + moor_generator: ^4.0.0 + built_value_generator: ^8.0.0 + build_runner: ^1.11.1 dependency_overrides: moor: @@ -22,6 +22,7 @@ dependency_overrides: sqlparser: path: ../../sqlparser - # todo: Remove after built_value supports analyzer ^0.40 + # todo: Remove after we can use analyzer ^1.0.0 analyzer: 0.40.4 + dart_style: '>=1.2.0 <1.3.0' convert: ^3.0.0-nullsafety \ No newline at end of file