Dart: binary lists (typed_data) (#6839)

* Dart - add eager mode to Uint8ListReader

* Dart - add Int8ListReader

* Dart - use binary reader where useful

* Dart - test binary list reader laziness

* Dart - update generated code
This commit is contained in:
Ivan Dlugos
2021-09-15 17:50:57 +02:00
committed by GitHub
parent 0a3b017f09
commit 90baa1444b
6 changed files with 108 additions and 33 deletions

View File

@@ -335,6 +335,14 @@ class DartGenerator : public BaseGenerator {
if (type.base_type == BASE_TYPE_BOOL) {
return prefix + ".BoolReader()";
} else if (IsVector(type)) {
if (!type.VectorType().enum_def) {
if (type.VectorType().base_type == BASE_TYPE_CHAR) {
return prefix + ".Int8ListReader(" + (lazy ? ")" : "lazy: false)");
}
if (type.VectorType().base_type == BASE_TYPE_UCHAR) {
return prefix + ".Uint8ListReader(" + (lazy ? ")" : "lazy: false)");
}
}
return prefix + ".ListReader<" +
GenDartTypeName(type.VectorType(), current_namespace, def) + ">(" +
GenReaderTypeName(type.VectorType(), current_namespace, def, true,