Skip to content

Commit 0dbae16

Browse files
committed
feat(scripting_api): make InteractionOptions immutable
1 parent addca36 commit 0dbae16

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/src/scripting_api/interaction_options.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,27 @@
44
//
55
// SPDX-License-Identifier: BSD-3-Clause
66

7+
import 'package:meta/meta.dart';
8+
79
/// Holds the interaction options that need to be exposed for application
810
/// scripts according to the Thing Description.
911
///
1012
/// See [WoT Scripting API Specification, Section 8.12][spec link].
1113
///
1214
/// [spec link]: https://w3c.github.io/wot-scripting-api/#the-interactionoptions-dictionary
15+
@immutable
1316
class InteractionOptions {
1417
/// Constructor
15-
InteractionOptions({this.formIndex, this.uriVariables, this.data});
18+
const InteractionOptions({this.formIndex, this.uriVariables, this.data});
1619

1720
/// Represents an application hint for which Form definition should be used
1821
/// for the given interaction.
19-
int? formIndex;
22+
final int? formIndex;
2023

2124
/// Represents the URI template variables to be used with the interaction.
22-
Map<String, Object>? uriVariables;
25+
final Map<String, Object>? uriVariables;
2326

2427
/// Represents additional opaque data that needs to be passed to the
2528
/// interaction.
26-
Object? data;
29+
final Object? data;
2730
}

0 commit comments

Comments
 (0)