From f0b4afea444fc9bf035f79c327a6cfa0a32673cd Mon Sep 17 00:00:00 2001 From: Jan Romann Date: Sat, 20 Jan 2024 21:32:37 +0100 Subject: [PATCH] feat!(InteractionOutput): make form field required --- lib/src/core/implementation/interaction_output.dart | 10 ++++++---- test/core/interaction_output_test.dart | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/src/core/implementation/interaction_output.dart b/lib/src/core/implementation/interaction_output.dart index 54776ac6..89ab1a55 100644 --- a/lib/src/core/implementation/interaction_output.dart +++ b/lib/src/core/implementation/interaction_output.dart @@ -20,13 +20,15 @@ class InteractionOutput implements scripting_api.InteractionOutput { /// payload contained in the [Content] object. InteractionOutput( this._content, - this._contentSerdes, [ + this._contentSerdes, this._form, this._schema, - ]) : _data = _content.body; + ) : _data = _content.body; final Content _content; - final Form? _form; + + final Form _form; + final DataSchema? _schema; final Stream> _data; @@ -76,5 +78,5 @@ class InteractionOutput implements scripting_api.InteractionOutput { DataSchema? get schema => _schema; @override - Form? get form => _form; + Form get form => _form; } diff --git a/test/core/interaction_output_test.dart b/test/core/interaction_output_test.dart index 1c53e745..ee3780ed 100644 --- a/test/core/interaction_output_test.dart +++ b/test/core/interaction_output_test.dart @@ -27,7 +27,7 @@ void main() { final interactionOutput = InteractionOutput( content, contentSerdes, - null, + Form(Uri.parse("http://example.org")), const DataSchema(), ); @@ -54,7 +54,7 @@ void main() { final interactionOutput = InteractionOutput( content, contentSerdes, - null, + Form(Uri.parse("http://example.org")), const DataSchema(), );