fix: flutter analyze Warnings beheben (totes/unerreichbares Code)

Entfernt tatsächlich toten Code, den flutter analyze als Warning markiert
hatte: unbenutzte Felder/Parameter (_saved, _hovered wird jetzt für Hover-
Feedback genutzt, destructive-Flag ohne Aufrufer, size-Parameter ohne
Override), unerreichbaren dead_code (Room.topic/Space.topic sind laut SDK
nie null, client.database ist nie null) sowie Legacy-Funktionen aus der
alten Push-Architektur (_showNotif/_fetchTitle, ersetzt durch natives
PushService.kt) und einen leeren Noise-Suppression-Stub ohne Aufrufer.
Keine funktionale Verhaltensänderung an aktiven Code-Pfaden.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Bernd Steckmeister
2026-07-03 06:26:31 +02:00
parent 594e6718be
commit 9dc11757e2
9 changed files with 31 additions and 132 deletions
+6 -7
View File
@@ -518,13 +518,12 @@ class _SpaceEditDialogState extends ConsumerState<SpaceEditDialog> {
late TextEditingController _topicCtrl;
bool _saving = false;
String? _error;
bool _saved = false;
@override
void initState() {
super.initState();
_nameCtrl = TextEditingController(text: widget.space.getLocalizedDisplayname());
_topicCtrl = TextEditingController(text: widget.space.topic ?? '');
_topicCtrl = TextEditingController(text: widget.space.topic);
}
@override
@@ -535,17 +534,17 @@ class _SpaceEditDialogState extends ConsumerState<SpaceEditDialog> {
}
Future<void> _save() async {
setState(() { _saving = true; _error = null; _saved = false; });
setState(() { _saving = true; _error = null; });
try {
final name = _nameCtrl.text.trim();
final topic = _topicCtrl.text.trim();
if (name.isNotEmpty && name != widget.space.getLocalizedDisplayname()) {
await widget.space.setName(name);
}
if (topic != (widget.space.topic ?? '')) {
if (topic != widget.space.topic) {
await widget.space.setDescription(topic);
}
if (mounted) setState(() { _saving = false; _saved = true; });
if (mounted) setState(() { _saving = false; });
await Future.delayed(const Duration(seconds: 1));
if (mounted) Navigator.of(context).pop(true);
} catch (e) {
@@ -674,7 +673,7 @@ class _RoomSettingsDialogState extends ConsumerState<RoomSettingsDialog> {
void initState() {
super.initState();
_nameCtrl = TextEditingController(text: widget.room.getLocalizedDisplayname());
_topicCtrl = TextEditingController(text: widget.room.topic ?? '');
_topicCtrl = TextEditingController(text: widget.room.topic);
}
@override
@@ -691,7 +690,7 @@ class _RoomSettingsDialogState extends ConsumerState<RoomSettingsDialog> {
await widget.room.setName(_nameCtrl.text.trim());
}
final newTopic = _topicCtrl.text.trim();
if (newTopic != (widget.room.topic ?? '')) {
if (newTopic != widget.room.topic) {
await widget.room.setDescription(newTopic);
}
if (mounted) Navigator.of(context).pop();
-11
View File
@@ -127,17 +127,6 @@ class _PyramidPainter extends CustomPainter {
Offset _proj(List<double> v, double sc, double cx, double cy, double tr) =>
Offset(cx + v[0] * sc, cy + (v[1] * cos(tr) + v[2] * sin(tr)) * sc);
double _frontness(List<List<double>> verts) {
final a = verts[0], b = verts[1], c = verts[2];
final ux = b[0]-a[0], uy = b[1]-a[1], uz = b[2]-a[2];
final vx = c[0]-a[0], vy = c[1]-a[1], vz = c[2]-a[2];
final nz = ux * vy - uy * vx;
final nLen = sqrt(
pow(uy * vz - uz * vy, 2) + pow(uz * vx - ux * vz, 2) + nz * nz,
);
return nLen == 0 ? 0 : max(0.0, -nz / nLen);
}
Color _darken(Color c, double amount) => Color.fromARGB(
c.alpha,
max(0, (c.red * (1 - amount)).round()),
-1
View File
@@ -1,4 +1,3 @@
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:flutter_webrtc/flutter_webrtc.dart';
import 'package:pyramid/core/theme.dart';
+2 -5
View File
@@ -859,7 +859,6 @@ class _PrimaryBtn extends StatelessWidget {
final VoidCallback? onPressed;
final PyramidTheme pt;
final bool loading;
final bool destructive;
const _PrimaryBtn({
required this.label,
@@ -867,13 +866,12 @@ class _PrimaryBtn extends StatelessWidget {
this.icon,
this.onPressed,
this.loading = false,
this.destructive = false,
});
@override
Widget build(BuildContext context) {
final bg = destructive ? pt.danger : pt.accent;
final fg = destructive ? Colors.white : pt.accentFg;
final bg = pt.accent;
final fg = pt.accentFg;
return ElevatedButton.icon(
style: ElevatedButton.styleFrom(
backgroundColor: bg,
@@ -3626,7 +3624,6 @@ class _EncryptionSectionState extends ConsumerState<_EncryptionSection> {
try {
final client = await ref.read(matrixClientProvider.future);
final db = client.database;
if (db == null) throw Exception('Datenbank nicht verfügbar.');
final stored = await db.getAllInboundGroupSessions();
final sessions = <Map<String, dynamic>>[];