Skip to content

Commit

Permalink
Merge branch 'main' into style/unnecesarry-library-names
Browse files Browse the repository at this point in the history
  • Loading branch information
bivens-dev committed Jan 26, 2025
2 parents 1648d36 + 8a81865 commit 352e8f6
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ linter:
cascade_invocations: true
only_throw_errors: true
unnecessary_library_name: true
always_put_required_named_parameters_first: true
6 changes: 3 additions & 3 deletions lib/src/binding_coap/coap_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ final class CoapClient extends ProtocolClient
Future<Content> _sendRequest(
Uri uri,
coap.RequestMethod method, {
Content? content,
required AugmentedForm? form,
Content? content,
coap.CoapMediaType? format,
coap.CoapMediaType? accept,
coap.BlockSize? block1Size,
Expand Down Expand Up @@ -204,8 +204,8 @@ final class CoapClient extends ProtocolClient
Future<DiscoveryContent> _sendDiscoveryRequest(
Uri uri,
coap.RequestMethod method, {
Content? content,
required AugmentedForm? form,
Content? content,
coap.CoapMediaType? format,
coap.CoapMediaType? accept,
coap.BlockSize? block1Size,
Expand Down Expand Up @@ -388,8 +388,8 @@ final class CoapClient extends ProtocolClient
Future<Subscription> subscribeResource(
AugmentedForm form, {
required void Function(Content content) next,
void Function(Exception error)? error,
required void Function() complete,
void Function(Exception error)? error,
}) async {
final OperationType operationType = form.op.firstWhere(
(element) => [OperationType.subscribeevent, OperationType.observeproperty]
Expand Down
2 changes: 1 addition & 1 deletion lib/src/binding_http/http_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ final class HttpClient extends ProtocolClient
Future<Subscription> subscribeResource(
AugmentedForm form, {
required void Function(Content content) next,
void Function(Exception error)? error,
required void Function() complete,
void Function(Exception error)? error,
}) async {
if (form.subprotocol != "sse") {
throw const DartWotException(
Expand Down
2 changes: 1 addition & 1 deletion lib/src/binding_mqtt/mqtt_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ final class MqttClient extends ProtocolClient with MqttDiscoverer {
Future<Subscription> subscribeResource(
AugmentedForm form, {
required void Function(Content content) next,
void Function(Exception error)? error,
required void Function() complete,
void Function(Exception error)? error,
}) async {
final client = await _connectWithForm(form);
final topic = form.topicFilter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ part of "interaction_affordance.dart";
class Event extends InteractionAffordance {
/// Creates a new [Event] from a [List] of [forms].
const Event({
required super.forms,
super.title,
super.titles,
super.description,
super.descriptions,
super.uriVariables,
required super.forms,
this.subscription,
this.data,
this.cancellation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ part "property.dart";
sealed class InteractionAffordance implements Serializable {
/// Creates a new [InteractionAffordance]. Accepts a [List] of [forms].
const InteractionAffordance({
required this.forms,
this.atType,
this.title,
this.titles,
this.description,
this.descriptions,
this.uriVariables,
required this.forms,
this.additionalFields = const {},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ class Property extends InteractionAffordance implements DataSchema {
/// Default constructor that creates a [Property] from a [List] of [forms].
const Property({
required super.forms,
required this.dataSchema,
super.uriVariables,
super.additionalFields,
required this.dataSchema,
this.observable = _defaultObservableValue,
});

Expand Down
2 changes: 1 addition & 1 deletion lib/src/core/protocol_interfaces/protocol_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ abstract base class ProtocolClient {
Future<Subscription> subscribeResource(
AugmentedForm form, {
required void Function(Content content) next,
void Function(Exception error)? error,
required void Function() complete,
void Function(Exception error)? error,
});
}
2 changes: 1 addition & 1 deletion test/core/discovery_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ final class _MockedProtocolClient extends ProtocolClient with DirectDiscoverer {
Future<Subscription> subscribeResource(
Form form, {
required void Function(Content content) next,
void Function(Exception error)? error,
required void Function() complete,
void Function(Exception error)? error,
}) {
// TODO: implement subscribeResource
throw UnimplementedError();
Expand Down

0 comments on commit 352e8f6

Please sign in to comment.