style: weitere flutter-analyze Infos beheben
Ungenutzte Imports (dart:typed_data, flutter/services.dart), unnötige String-Interpolations-Klammern, führender Unterstrich bei lokaler Funktion, fehlende Blockklammern bei if-Statements und SCREAMING_CASE-Konstanten in clipboard_image.dart auf lowerCamelCase umbenannt. Rein mechanisch, keine Verhaltensänderung. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1101,3 +1101,10 @@
|
|||||||
2026-07-03 06:29 [Edit] /home/steggi/pyramid/lib/core/background_push.dart
|
2026-07-03 06:29 [Edit] /home/steggi/pyramid/lib/core/background_push.dart
|
||||||
2026-07-03 06:29 [Edit] /home/steggi/pyramid/lib/core/background_push.dart
|
2026-07-03 06:29 [Edit] /home/steggi/pyramid/lib/core/background_push.dart
|
||||||
2026-07-03 06:29 [Edit] /home/steggi/pyramid/lib/core/voip_manager.dart
|
2026-07-03 06:29 [Edit] /home/steggi/pyramid/lib/core/voip_manager.dart
|
||||||
|
2026-07-03 06:31 [Edit] /home/steggi/pyramid/lib/features/chat/chat_composer.dart
|
||||||
|
2026-07-03 06:31 [Edit] /home/steggi/pyramid/lib/widgets/settings_modal.dart
|
||||||
|
2026-07-03 06:31 [Edit] /home/steggi/pyramid/lib/widgets/create_join_dialog.dart
|
||||||
|
2026-07-03 06:31 [Edit] /home/steggi/pyramid/lib/features/chat/attachment_dialog.dart
|
||||||
|
2026-07-03 06:31 [Edit] /home/steggi/pyramid/lib/widgets/create_join_dialog.dart
|
||||||
|
2026-07-03 06:32 [Edit] /home/steggi/pyramid/lib/widgets/settings_modal.dart
|
||||||
|
2026-07-03 06:32 [Edit] /home/steggi/pyramid/lib/widgets/settings_modal.dart
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ class VoiceChannelView extends ConsumerWidget {
|
|||||||
List<_ParticipantData> _getVoipParticipants(PyramidVoipManager voip) {
|
List<_ParticipantData> _getVoipParticipants(PyramidVoipManager voip) {
|
||||||
final participants = <_ParticipantData>[];
|
final participants = <_ParticipantData>[];
|
||||||
|
|
||||||
double _ar(rtc.RTCVideoRenderer r) {
|
double ar(rtc.RTCVideoRenderer r) {
|
||||||
final w = r.videoWidth.toDouble();
|
final w = r.videoWidth.toDouble();
|
||||||
final h = r.videoHeight.toDouble();
|
final h = r.videoHeight.toDouble();
|
||||||
return (w > 0 && h > 0) ? w / h : 16.0 / 9.0;
|
return (w > 0 && h > 0) ? w / h : 16.0 / 9.0;
|
||||||
@@ -162,7 +162,7 @@ class VoiceChannelView extends ConsumerWidget {
|
|||||||
hasVideo: hasRemoteVideo,
|
hasVideo: hasRemoteVideo,
|
||||||
isScreenShare: isRemoteScreen,
|
isScreenShare: isRemoteScreen,
|
||||||
avatarColor: _avatarColors[1],
|
avatarColor: _avatarColors[1],
|
||||||
aspectRatio: hasRemoteVideo ? _ar(voip.remoteRenderer) : 16.0 / 9.0,
|
aspectRatio: hasRemoteVideo ? ar(voip.remoteRenderer) : 16.0 / 9.0,
|
||||||
));
|
));
|
||||||
|
|
||||||
// Local
|
// Local
|
||||||
@@ -176,7 +176,7 @@ class VoiceChannelView extends ConsumerWidget {
|
|||||||
hasVideo: hasLocalVideo,
|
hasVideo: hasLocalVideo,
|
||||||
isScreenShare: isLocalScreen,
|
isScreenShare: isLocalScreen,
|
||||||
avatarColor: _avatarColors[0],
|
avatarColor: _avatarColors[0],
|
||||||
aspectRatio: hasLocalVideo ? _ar(voip.localRenderer) : 16.0 / 9.0,
|
aspectRatio: hasLocalVideo ? ar(voip.localRenderer) : 16.0 / 9.0,
|
||||||
));
|
));
|
||||||
|
|
||||||
return participants;
|
return participants;
|
||||||
|
|||||||
@@ -321,7 +321,7 @@ class _FilePreviewState extends State<_FilePreview> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String _formatSize(int bytes) {
|
String _formatSize(int bytes) {
|
||||||
if (bytes < 1024) return '${bytes} B';
|
if (bytes < 1024) return '$bytes B';
|
||||||
if (bytes < 1024 * 1024) return '${(bytes / 1024).toStringAsFixed(1)} KB';
|
if (bytes < 1024 * 1024) return '${(bytes / 1024).toStringAsFixed(1)} KB';
|
||||||
return '${(bytes / (1024 * 1024)).toStringAsFixed(1)} MB';
|
return '${(bytes / (1024 * 1024)).toStringAsFixed(1)} MB';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:typed_data';
|
|
||||||
import 'package:file_picker/file_picker.dart';
|
import 'package:file_picker/file_picker.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import 'package:image/image.dart' as img;
|
|||||||
|
|
||||||
// ── Windows constants ────────────────────────────────────────────────────────
|
// ── Windows constants ────────────────────────────────────────────────────────
|
||||||
|
|
||||||
const _CF_DIB = 8;
|
const _cfDib = 8;
|
||||||
const _CF_DIBV4 = 20;
|
const _cfDibV4 = 20;
|
||||||
|
|
||||||
// ── Native function typedefs ─────────────────────────────────────────────────
|
// ── Native function typedefs ─────────────────────────────────────────────────
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ Uint8List? _readClipboardImage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 2. Try CF_DIBV4 then CF_DIB — convert DIB to PNG via the image package
|
// 2. Try CF_DIBV4 then CF_DIB — convert DIB to PNG via the image package
|
||||||
for (final fmt in [_CF_DIBV4, _CF_DIB]) {
|
for (final fmt in [_cfDibV4, _cfDib]) {
|
||||||
if (isFormatAvailable(fmt) != 0) {
|
if (isFormatAvailable(fmt) != 0) {
|
||||||
final dibBytes = _readGlobalBytes(
|
final dibBytes = _readGlobalBytes(
|
||||||
getClipboardData(fmt), globalSize, globalLock, globalUnlock);
|
getClipboardData(fmt), globalSize, globalLock, globalUnlock);
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/material.dart' hide Visibility;
|
import 'package:flutter/material.dart' hide Visibility;
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:matrix/matrix.dart';
|
import 'package:matrix/matrix.dart';
|
||||||
import 'package:pyramid/core/app_state.dart';
|
import 'package:pyramid/core/app_state.dart';
|
||||||
@@ -189,11 +188,13 @@ class _CreateJoinDialogState extends ConsumerState<CreateJoinDialog> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (mounted) setState(() {
|
if (mounted) {
|
||||||
_discoverLoading = false;
|
setState(() {
|
||||||
_discoverLoadingMore = false;
|
_discoverLoading = false;
|
||||||
_discoverError = e.toString().split('\n').first;
|
_discoverLoadingMore = false;
|
||||||
});
|
_discoverError = e.toString().split('\n').first;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import 'dart:async';
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
import 'dart:typed_data';
|
|
||||||
|
|
||||||
import 'package:crypto/crypto.dart' as mcrypto;
|
import 'package:crypto/crypto.dart' as mcrypto;
|
||||||
import 'package:pyramid/core/fcm_push_service.dart';
|
import 'package:pyramid/core/fcm_push_service.dart';
|
||||||
@@ -3666,17 +3665,21 @@ class _EncryptionSectionState extends ConsumerState<_EncryptionSection> {
|
|||||||
final file = File('${dir.path}/pyramid_keys_$stamp.txt');
|
final file = File('${dir.path}/pyramid_keys_$stamp.txt');
|
||||||
await file.writeAsString(encrypted);
|
await file.writeAsString(encrypted);
|
||||||
|
|
||||||
if (mounted) setState(() {
|
if (mounted) {
|
||||||
_exportLoading = false;
|
setState(() {
|
||||||
_keyFileMsgIsError = false;
|
_exportLoading = false;
|
||||||
_keyFileMsg = '${sessions.length} Schlüssel exportiert → ${file.path}';
|
_keyFileMsgIsError = false;
|
||||||
});
|
_keyFileMsg = '${sessions.length} Schlüssel exportiert → ${file.path}';
|
||||||
|
});
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (mounted) setState(() {
|
if (mounted) {
|
||||||
_exportLoading = false;
|
setState(() {
|
||||||
_keyFileMsgIsError = true;
|
_exportLoading = false;
|
||||||
_keyFileMsg = 'Export fehlgeschlagen: ${e.toString().split('\n').first}';
|
_keyFileMsgIsError = true;
|
||||||
});
|
_keyFileMsg = 'Export fehlgeschlagen: ${e.toString().split('\n').first}';
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3753,17 +3756,21 @@ class _EncryptionSectionState extends ConsumerState<_EncryptionSection> {
|
|||||||
} catch (_) { continue; }
|
} catch (_) { continue; }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mounted) setState(() {
|
if (mounted) {
|
||||||
_importLoading = false;
|
setState(() {
|
||||||
_keyFileMsgIsError = false;
|
_importLoading = false;
|
||||||
_keyFileMsg = '$imported von ${sessions.length} Schlüssel importiert.';
|
_keyFileMsgIsError = false;
|
||||||
});
|
_keyFileMsg = '$imported von ${sessions.length} Schlüssel importiert.';
|
||||||
|
});
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (mounted) setState(() {
|
if (mounted) {
|
||||||
_importLoading = false;
|
setState(() {
|
||||||
_keyFileMsgIsError = true;
|
_importLoading = false;
|
||||||
_keyFileMsg = 'Import fehlgeschlagen: ${e.toString().split('\n').first}';
|
_keyFileMsgIsError = true;
|
||||||
});
|
_keyFileMsg = 'Import fehlgeschlagen: ${e.toString().split('\n').first}';
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user