mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-10 23:17:27 +00:00
Fix union unpacking (#8748)
This commit is contained in:
@@ -606,7 +606,8 @@ class DartGenerator : public BaseGenerator {
|
||||
std::string defaultValue = getDefaultValue(field.value);
|
||||
bool isNullable = defaultValue.empty() && !struct_def.fixed;
|
||||
std::string nullableValueAccessOperator = isNullable ? "?" : "";
|
||||
if (type.base_type == BASE_TYPE_STRUCT) {
|
||||
if (type.base_type == BASE_TYPE_STRUCT ||
|
||||
type.base_type == BASE_TYPE_UNION) {
|
||||
constructor_args +=
|
||||
field_name + nullableValueAccessOperator + ".unpack()";
|
||||
} else if (type.base_type == BASE_TYPE_VECTOR) {
|
||||
|
||||
Reference in New Issue
Block a user