style: verbleibende flutter-analyze Deprecations beheben

withOpacity/activeColor/cacheExtent/PublicRoomsChunk durch die neuen
Flutter-3.44-Äquivalente ersetzt.
This commit is contained in:
Bernd Steckmeister
2026-07-03 09:40:10 +02:00
parent 90593d2f81
commit 057ac1e4ea
6 changed files with 26 additions and 19 deletions
+1 -1
View File
@@ -184,7 +184,7 @@ class _AttachmentDialogState extends State<AttachmentDialog> {
Switch.adaptive(
value: !_compress,
onChanged: (v) => setState(() => _compress = !v),
activeColor: pt.accent,
activeThumbColor: pt.accent,
),
],
),
+2 -1
View File
@@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:flutter/rendering.dart' show ScrollCacheExtent;
import 'package:flutter/services.dart' show Clipboard, ClipboardData;
import 'package:desktop_drop/desktop_drop.dart';
@@ -1598,7 +1599,7 @@ class _MessageList extends StatelessWidget {
reverse: true,
physics: const ClampingScrollPhysics(),
padding: const EdgeInsets.only(bottom: 8),
cacheExtent: 2500,
scrollCacheExtent: const ScrollCacheExtent.pixels(2500),
itemCount: itemKeys.length,
findChildIndexCallback: (Key key) {
// Only return an index when the key still maps to that exact slot —
+9 -9
View File
@@ -266,7 +266,7 @@ class _AArtwork extends StatelessWidget {
borderRadius: BorderRadius.circular(size * 0.3),
gradient: LinearGradient(begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [c1, c2]),
),
child: Icon(Icons.music_note, color: Colors.white.withOpacity(0.85), size: size * 0.48),
child: Icon(Icons.music_note, color: Colors.white.withValues(alpha: 0.85), size: size * 0.48),
);
}
}
@@ -603,9 +603,9 @@ class _VCenterPlay extends StatelessWidget {
Widget build(BuildContext context) => Container(
width: 56, height: 56,
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.10),
color: Colors.white.withValues(alpha: 0.10),
shape: BoxShape.circle,
border: Border.all(color: Colors.white.withOpacity(0.18)),
border: Border.all(color: Colors.white.withValues(alpha: 0.18)),
),
child: const Icon(Icons.play_arrow, color: Colors.white, size: 26),
);
@@ -682,14 +682,14 @@ class _VScrubber extends StatelessWidget {
milliseconds: (dur.inMilliseconds * (d.localPosition.dx / c.maxWidth).clamp(0.0, 1.0)).round())),
child: SizedBox(height: 16, child: Stack(alignment: Alignment.centerLeft, children: [
Container(height: 3, decoration: BoxDecoration(
color: Colors.white.withOpacity(0.20), borderRadius: BorderRadius.circular(2))),
color: Colors.white.withValues(alpha: 0.20), borderRadius: BorderRadius.circular(2))),
FractionallySizedBox(widthFactor: progress, child: Container(height: 3,
decoration: BoxDecoration(color: accent, borderRadius: BorderRadius.circular(2)))),
Positioned(
left: c.maxWidth * progress.clamp(0.0, 1.0) - 5,
child: Container(width: 10, height: 10,
decoration: BoxDecoration(color: accent, shape: BoxShape.circle,
boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.4), blurRadius: 0, spreadRadius: 2)])),
boxShadow: [BoxShadow(color: Colors.black.withValues(alpha: 0.4), blurRadius: 0, spreadRadius: 2)])),
),
])),
));
@@ -722,7 +722,7 @@ class _VOverlayBtn extends StatelessWidget {
onTap: onTap,
borderRadius: BorderRadius.circular(6),
child: SizedBox(width: 32, height: 32,
child: Icon(icon, size: 17, color: Colors.white.withOpacity(0.85))),
child: Icon(icon, size: 17, color: Colors.white.withValues(alpha: 0.85))),
);
}
@@ -750,7 +750,7 @@ class _VSettingsButton extends StatelessWidget {
color: const Color(0xF014141A),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: BorderSide(color: Colors.white.withOpacity(0.1)),
side: BorderSide(color: Colors.white.withValues(alpha: 0.1)),
),
itemBuilder: (_) => [PopupMenuItem<void>(
enabled: false, padding: EdgeInsets.zero,
@@ -761,7 +761,7 @@ class _VSettingsButton extends StatelessWidget {
),
)],
child: SizedBox(width: 32, height: 32,
child: Icon(Icons.settings_outlined, size: 16, color: Colors.white.withOpacity(0.85))),
child: Icon(Icons.settings_outlined, size: 16, color: Colors.white.withValues(alpha: 0.85))),
);
}
@@ -812,7 +812,7 @@ class _VSettingsMenuState extends State<_VSettingsMenu> {
]),
),
),
Container(height: 1, color: Colors.white.withOpacity(0.08)),
Container(height: 1, color: Colors.white.withValues(alpha: 0.08)),
if (isSpeed)
...widget.speeds.map((s) {
final lbl = '${s == s.toInt() ? s.toInt() : s}x';