mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-30 06:30:01 +00:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user