diff --git a/lib/src/core/implementation/interaction_output.dart b/lib/src/core/implementation/interaction_output.dart index 440c680f..54776ac6 100644 --- a/lib/src/core/implementation/interaction_output.dart +++ b/lib/src/core/implementation/interaction_output.dart @@ -34,8 +34,7 @@ class InteractionOutput implements scripting_api.InteractionOutput { bool _dataUsed = false; - ({bool read, Object? internalValue}) _value = - (read: false, internalValue: null); + scripting_api.DataSchemaValue? _value; @override Future arrayBuffer() async { @@ -48,8 +47,9 @@ class InteractionOutput implements scripting_api.InteractionOutput { @override Future value() async { - if (_value.read) { - return _value.internalValue; + final existingValue = _value; + if (existingValue != null) { + return existingValue.value; } if (schema == null) { @@ -65,7 +65,7 @@ class InteractionOutput implements scripting_api.InteractionOutput { ); _dataUsed = true; - _value = (read: true, internalValue: value?.value); + _value = value; return value?.value; }