From 18afdf74e6f71b6c7f8f36a1a50346b71f01fd56 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Tue, 8 Nov 2022 18:06:59 +0100 Subject: [PATCH] fix: Linter warnings --- moxxmpp/lib/src/connection.dart | 2 +- moxxmpp/lib/src/managers/handlers.dart | 2 +- moxxmpp/lib/src/message.dart | 1 - moxxmpp/lib/src/stanza.dart | 2 +- moxxmpp/lib/src/xeps/xep_0004.dart | 10 +++++----- moxxmpp/lib/src/xeps/xep_0030/xep_0030.dart | 4 ++-- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/moxxmpp/lib/src/connection.dart b/moxxmpp/lib/src/connection.dart index 032b46b..b54326f 100644 --- a/moxxmpp/lib/src/connection.dart +++ b/moxxmpp/lib/src/connection.dart @@ -72,7 +72,7 @@ class XmppConnectionResult { } class XmppConnection { - /// [socket] is for debugging purposes. + /// [_socket] is for debugging purposes. /// [connectionPingDuration] is the duration after which a ping will be sent to keep /// the connection open. Defaults to 15 minutes. XmppConnection( diff --git a/moxxmpp/lib/src/managers/handlers.dart b/moxxmpp/lib/src/managers/handlers.dart index de42b81..2f565cb 100644 --- a/moxxmpp/lib/src/managers/handlers.dart +++ b/moxxmpp/lib/src/managers/handlers.dart @@ -78,7 +78,7 @@ class StanzaHandler extends Handler { } else if (tagXmlns != null) { return listContains( node.children, - (XMLNode _node) => _node.attributes.containsKey('xmlns') && _node.attributes['xmlns'] == tagXmlns, + (XMLNode node_) => node_.attributes.containsKey('xmlns') && node_.attributes['xmlns'] == tagXmlns, ); } diff --git a/moxxmpp/lib/src/message.dart b/moxxmpp/lib/src/message.dart index 0c8af11..0ae1270 100644 --- a/moxxmpp/lib/src/message.dart +++ b/moxxmpp/lib/src/message.dart @@ -1,4 +1,3 @@ -import 'package:moxlib/moxlib.dart'; import 'package:moxxmpp/src/events.dart'; import 'package:moxxmpp/src/jid.dart'; import 'package:moxxmpp/src/managers/base.dart'; diff --git a/moxxmpp/lib/src/stanza.dart b/moxxmpp/lib/src/stanza.dart index cc60da9..9c8df98 100644 --- a/moxxmpp/lib/src/stanza.dart +++ b/moxxmpp/lib/src/stanza.dart @@ -2,7 +2,7 @@ import 'package:moxxmpp/src/namespaces.dart'; import 'package:moxxmpp/src/stringxml.dart'; class Stanza extends XMLNode { - + // ignore: use_super_parameters Stanza({ this.to, this.from, this.type, this.id, List children = const [], required String tag, Map attributes = const {} }) : super( tag: tag, attributes: { diff --git a/moxxmpp/lib/src/xeps/xep_0004.dart b/moxxmpp/lib/src/xeps/xep_0004.dart index 19387ae..f45d27f 100644 --- a/moxxmpp/lib/src/xeps/xep_0004.dart +++ b/moxxmpp/lib/src/xeps/xep_0004.dart @@ -52,7 +52,7 @@ class DataFormField { children: [ ...description != null ? [XMLNode(tag: 'desc', text: description)] : [], ...isRequired ? [XMLNode(tag: 'required')] : [], - ...values.map((value) => XMLNode(tag: 'value', text: value)).toList(), + ...values.map((value) => XMLNode(tag: 'value', text: value)), ...options.map((option) => option.toXml()) ], ); @@ -88,14 +88,14 @@ class DataForm { 'type': type }, children: [ - ...instructions.map((i) => XMLNode(tag: 'instruction', text: i)).toList(), + ...instructions.map((i) => XMLNode(tag: 'instruction', text: i)), ...title != null ? [XMLNode(tag: 'title', text: title)] : [], - ...fields.map((field) => field.toXml()).toList(), - ...reported.map((report) => report.toXml()).toList(), + ...fields.map((field) => field.toXml()), + ...reported.map((report) => report.toXml()), ...items.map((item) => XMLNode( tag: 'item', children: item.map((i) => i.toXml()).toList(), - ),).toList(), + ),), ], ); } diff --git a/moxxmpp/lib/src/xeps/xep_0030/xep_0030.dart b/moxxmpp/lib/src/xeps/xep_0030/xep_0030.dart index 1aab955..6c44860 100644 --- a/moxxmpp/lib/src/xeps/xep_0030/xep_0030.dart +++ b/moxxmpp/lib/src/xeps/xep_0030/xep_0030.dart @@ -204,13 +204,13 @@ class DiscoManager extends XmppManagerBase { } }, children: [ - ...getIdentities().map((identity) => identity.toXMLNode()).toList(), + ...getIdentities().map((identity) => identity.toXMLNode()), ..._features.map((feat) { return XMLNode( tag: 'feature', attributes: { 'var': feat }, ); - }).toList(), + }), ], ), ],