fix analyser issues

This commit is contained in:
otsmr 2025-10-26 01:15:54 +02:00
parent 5ae943bcf3
commit b03bcfe6e1
5 changed files with 22 additions and 16 deletions

View file

@ -1,9 +1,9 @@
import 'dart:io'; // import 'dart:io';
import 'package:camera/camera.dart'; import 'package:camera/camera.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:path/path.dart'; // import 'package:path/path.dart';
import 'package:path_provider/path_provider.dart'; // import 'package:path_provider/path_provider.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:twonly/globals.dart'; import 'package:twonly/globals.dart';
import 'package:twonly/src/database/twonly.db.dart'; import 'package:twonly/src/database/twonly.db.dart';

View file

@ -57,12 +57,14 @@ class GroupsDao extends DatabaseAccessor<TwonlyDB> with _$GroupsDaoMixin {
final result = await _insertGroup(insertGroup); final result = await _insertGroup(insertGroup);
if (result != null) { if (result != null) {
await into(groupMembers).insert(GroupMembersCompanion( await into(groupMembers).insert(
groupId: Value(result.groupId), GroupMembersCompanion(
contactId: Value( groupId: Value(result.groupId),
contactId, contactId: Value(
contactId,
),
), ),
)); );
} }
return result; return result;
} }

View file

@ -20,7 +20,8 @@ class ConnectPreKeyStore extends PreKeyStore {
.get(); .get();
if (preKeyRecord.isEmpty) { if (preKeyRecord.isEmpty) {
throw InvalidKeyIdException( throw InvalidKeyIdException(
'[PREKEY] No such preKey record! - $preKeyId'); '[PREKEY] No such preKey record! - $preKeyId',
);
} }
Log.info('[PREKEY] Contact used my preKey $preKeyId'); Log.info('[PREKEY] Contact used my preKey $preKeyId');
final preKey = preKeyRecord.first.preKey; final preKey = preKeyRecord.first.preKey;

View file

@ -121,7 +121,8 @@ Future<void> handleMediaUpdate(
.getSingleOrNull(); .getSingleOrNull();
if (message == null) { if (message == null) {
Log.error( Log.error(
'Got media update to message ${mediaUpdate.targetMessageId} but message not found.'); 'Got media update to message ${mediaUpdate.targetMessageId} but message not found.',
);
} }
final mediaFile = final mediaFile =
await twonlyDB.mediaFilesDao.getMediaFileById(message!.mediaId!); await twonlyDB.mediaFilesDao.getMediaFileById(message!.mediaId!);

View file

@ -185,7 +185,8 @@ class _DatabaseMigrationViewState extends State<DatabaseMigrationView> {
for (final oldSignalSessionStore in oldSignalSessionStores) { for (final oldSignalSessionStore in oldSignalSessionStores) {
try { try {
await twonlyDB.into(twonlyDB.signalSessionStores).insert( await twonlyDB.into(twonlyDB.signalSessionStores).insert(
SignalSessionStore.fromJson(oldSignalSessionStore.toJson())); SignalSessionStore.fromJson(oldSignalSessionStore.toJson()),
);
} catch (e) { } catch (e) {
Log.error(e); Log.error(e);
} }
@ -221,7 +222,8 @@ class _DatabaseMigrationViewState extends State<DatabaseMigrationView> {
try { try {
await twonlyDB.into(twonlyDB.signalIdentityKeyStores).insert( await twonlyDB.into(twonlyDB.signalIdentityKeyStores).insert(
SignalIdentityKeyStore.fromJson( SignalIdentityKeyStore.fromJson(
oldSignalIdentityKeyStore.toJson()), oldSignalIdentityKeyStore.toJson(),
),
); );
} catch (e) { } catch (e) {
Log.error(e); Log.error(e);
@ -271,8 +273,8 @@ class _DatabaseMigrationViewState extends State<DatabaseMigrationView> {
), ),
const SizedBox(height: 40), const SizedBox(height: 40),
...[ ...[
'${_contactsMigrated} Kontakte', '$_contactsMigrated Kontakte',
'${_storedMediaFiles} gespeicherte Mediendateien', '$_storedMediaFiles gespeicherte Mediendateien',
].map( ].map(
(e) => Text( (e) => Text(
e, e,
@ -333,8 +335,8 @@ class _DatabaseMigrationViewState extends State<DatabaseMigrationView> {
style: TextStyle(fontSize: 20), style: TextStyle(fontSize: 20),
), ),
...[ ...[
'${_contactsMigrated} Kontakte', '$_contactsMigrated Kontakte',
'${_storedMediaFiles} gespeicherte Mediendateien', '$_storedMediaFiles gespeicherte Mediendateien',
].map( ].map(
(e) => Text( (e) => Text(
e, e,