Merge pull request #1596 from famedly/nico/upgrade-lints

chore: upgrade lints
This commit is contained in:
Nicolas Werner 2023-11-02 10:55:51 +01:00 committed by GitHub
commit 94bf74cb0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 36 additions and 49 deletions

View File

@ -1205,8 +1205,7 @@ const knownHashes = ['sha256'];
const knownHashesAuthentificationCodes = ['hkdf-hmac-sha256'];
class _KeyVerificationMethodSas extends _KeyVerificationMethod {
_KeyVerificationMethodSas({required KeyVerification request})
: super(request: request);
_KeyVerificationMethodSas({required super.request});
@override
// ignore: overridden_fields

View File

@ -79,10 +79,10 @@ class Event extends MatrixEvent {
Event({
this.status = defaultStatus,
required Map<String, dynamic> content,
required String type,
required Map<String, dynamic> super.content,
required super.type,
required String eventId,
required String senderId,
required super.senderId,
required DateTime originServerTs,
Map<String, dynamic>? unsigned,
Map<String, dynamic>? prevContent,
@ -91,10 +91,7 @@ class Event extends MatrixEvent {
MatrixEvent? originalSource,
}) : _originalSource = originalSource,
super(
content: content,
type: type,
eventId: eventId,
senderId: senderId,
originServerTs: originServerTs,
roomId: room.id,
) {

View File

@ -1381,7 +1381,7 @@ class Room {
);
final events = [
if (resp.eventsAfter != null) ...resp.eventsAfter!.reversed.toList(),
if (resp.eventsAfter != null) ...resp.eventsAfter!.reversed,
if (resp.event != null) resp.event!,
if (resp.eventsBefore != null) ...resp.eventsBefore!
].map((e) => Event.fromMatrixEvent(e, this)).toList();

View File

@ -43,25 +43,17 @@ class User extends Event {
}
User.fromState({
Map<String, dynamic>? prevContent,
required String stateKey,
Map<String, dynamic> content = const {},
super.prevContent,
required String super.stateKey,
super.content = const {},
required String typeKey,
required String eventId,
required String senderId,
required DateTime originServerTs,
dynamic unsigned,
required Room room,
required super.eventId,
required super.senderId,
required super.originServerTs,
super.unsigned,
required super.room,
}) : super(
stateKey: stateKey,
prevContent: prevContent,
content: content,
type: typeKey,
eventId: eventId,
senderId: senderId,
originServerTs: originServerTs,
unsigned: unsigned,
room: room,
);
/// The full qualified Matrix ID in the format @username:server.abc.

View File

@ -135,7 +135,8 @@ class SimpleSignableKey extends MatrixSignableKey {
@override
String? identifier;
SimpleSignableKey.fromJson(Map<String, dynamic> json) : super.fromJson(json);
SimpleSignableKey.fromJson(Map<String, dynamic> super.json)
: super.fromJson();
}
abstract class SignableKey extends MatrixSignableKey {
@ -166,8 +167,8 @@ abstract class SignableKey extends MatrixSignableKey {
bool get crossVerified => hasValidSignatureChain();
bool get signed => hasValidSignatureChain(verifiedOnly: false);
SignableKey.fromJson(Map<String, dynamic> json, this.client)
: super.fromJson(json) {
SignableKey.fromJson(Map<String, dynamic> super.json, this.client)
: super.fromJson() {
_verified = false;
_blocked = false;
}

View File

@ -50,7 +50,7 @@ abstract class TimeoutHttpClient extends http.BaseClient {
}
class FixedTimeoutHttpClient extends TimeoutHttpClient {
FixedTimeoutHttpClient(http.Client inner, this.timeout) : super(inner);
FixedTimeoutHttpClient(super.inner, this.timeout);
@override
Duration timeout;
}

View File

@ -17,6 +17,7 @@
*/
/// Workaround until [File] in dart:io and dart:html is unified
library;
import 'dart:async';
import 'dart:typed_data';
@ -91,15 +92,14 @@ class MatrixFile {
class MatrixImageFile extends MatrixFile {
MatrixImageFile({
required Uint8List bytes,
required String name,
String? mimeType,
required super.bytes,
required super.name,
super.mimeType,
int? width,
int? height,
this.blurhash,
}) : _width = width,
_height = height,
super(bytes: bytes, name: name, mimeType: mimeType);
_height = height;
/// Creates a new image file and calculates the width, height and blurhash.
static Future<MatrixImageFile> create({
@ -355,13 +355,12 @@ class MatrixVideoFile extends MatrixFile {
final int? duration;
MatrixVideoFile(
{required Uint8List bytes,
required String name,
String? mimeType,
{required super.bytes,
required super.name,
super.mimeType,
this.width,
this.height,
this.duration})
: super(bytes: bytes, name: name, mimeType: mimeType);
this.duration});
@override
String get msgType => 'm.video';
@ -379,11 +378,10 @@ class MatrixAudioFile extends MatrixFile {
final int? duration;
MatrixAudioFile(
{required Uint8List bytes,
required String name,
String? mimeType,
this.duration})
: super(bytes: bytes, name: name, mimeType: mimeType);
{required super.bytes,
required super.name,
super.mimeType,
this.duration});
@override
String get msgType => 'm.audio';

View File

@ -26,10 +26,10 @@ class ToDeviceEvent extends BasicEventWithSender {
ToDeviceEvent({
required String sender,
required String type,
required Map<String, dynamic> content,
required super.type,
required Map<String, dynamic> super.content,
this.encryptedContent,
}) : super(senderId: sender, type: type, content: content);
}) : super(senderId: sender);
factory ToDeviceEvent.fromJson(Map<String, dynamic> json) {
final event = BasicEventWithSender.fromJson(json);

View File

@ -35,7 +35,7 @@ dev_dependencies:
coverage: ">=0.15.0 <2.0.0"
file: ^6.1.1
import_sorter: ^4.6.0
lints: ^2.0.0
lints: ^3.0.0
test: ^1.15.7
#flutter_test: {sdk: flutter}
#dependency_overrides:

View File

@ -36,7 +36,7 @@ Uint8List secureRandomBytes(int len) {
}
class MockSSSS extends SSSS {
MockSSSS(Encryption encryption) : super(encryption);
MockSSSS(super.encryption);
bool requestedSecrets = false;
@override