Dart lints (#6808)

* Dart - add analysis options with the recommended lints

* Dart - generate code without linter issues

* Dart - remove linter issues in example and test code

* Dart - remove linter issues in lib code

* Dart - update generate code in /tests/
This commit is contained in:
Ivan Dlugos
2021-08-30 21:54:59 +02:00
committed by GitHub
parent 4b9123baff
commit e3c76a5cde
20 changed files with 560 additions and 581 deletions

View File

@@ -11,11 +11,11 @@ import './namespace_test2_namespace_a_generated.dart' as namespace_a;
class TableInC {
TableInC._(this._bc, this._bcOffset);
factory TableInC(List<int> bytes) {
fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes);
final rootRef = fb.BufferContext.fromBytes(bytes);
return reader.read(rootRef, 0);
}
static const fb.Reader<TableInC> reader = const _TableInCReader();
static const fb.Reader<TableInC> reader = _TableInCReader();
final fb.BufferContext _bc;
final int _bcOffset;
@@ -66,11 +66,11 @@ class _TableInCReader extends fb.TableReader<TableInC> {
@override
TableInC createObject(fb.BufferContext bc, int offset) =>
new TableInC._(bc, offset);
TableInC._(bc, offset);
}
class TableInCBuilder {
TableInCBuilder(this.fbBuilder) {}
TableInCBuilder(this.fbBuilder);
final fb.Builder fbBuilder;
@@ -117,9 +117,8 @@ class TableInCObjectBuilder extends fb.ObjectBuilder {
/// Convenience method to serialize to byte list.
@override
Uint8List toBytes([String? fileIdentifier]) {
fb.Builder fbBuilder = new fb.Builder(deduplicateTables: false);
int offset = finish(fbBuilder);
fbBuilder.finish(offset, fileIdentifier);
final fbBuilder = fb.Builder(deduplicateTables: false);
fbBuilder.finish(finish(fbBuilder), fileIdentifier);
return fbBuilder.buffer;
}
}