style: verbleibende flutter-analyze Deprecations beheben
withOpacity/activeColor/cacheExtent/PublicRoomsChunk durch die neuen Flutter-3.44-Äquivalente ersetzt.
This commit is contained in:
@@ -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,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 —
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -40,7 +40,7 @@ class _CreateJoinDialogState extends ConsumerState<CreateJoinDialog> {
|
||||
// Discover
|
||||
final _discoverServerCtrl = TextEditingController();
|
||||
final _discoverSearchCtrl = TextEditingController();
|
||||
List<PublicRoomsChunk> _publicRooms = [];
|
||||
List<PublishedRoomsChunk> _publicRooms = [];
|
||||
String? _nextBatch;
|
||||
bool _discoverLoading = false;
|
||||
bool _discoverLoadingMore = false;
|
||||
@@ -911,7 +911,7 @@ class _OptionRow extends StatelessWidget {
|
||||
Text(label, style: TextStyle(color: pt.fg, fontSize: 13, fontWeight: FontWeight.w500)),
|
||||
Text(desc, style: TextStyle(color: pt.fgDim, fontSize: 11)),
|
||||
])),
|
||||
Switch(value: value, onChanged: onChanged, activeColor: pt.accent),
|
||||
Switch(value: value, onChanged: onChanged, activeThumbColor: pt.accent),
|
||||
]),
|
||||
);
|
||||
}
|
||||
@@ -981,7 +981,7 @@ class _ErrorCard extends StatelessWidget {
|
||||
}
|
||||
|
||||
class _PublicRoomItem extends ConsumerWidget {
|
||||
final PublicRoomsChunk room;
|
||||
final PublishedRoomsChunk room;
|
||||
final PyramidTheme pt;
|
||||
final bool isJoining;
|
||||
final VoidCallback onJoin;
|
||||
|
||||
@@ -127,11 +127,10 @@ 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);
|
||||
|
||||
Color _darken(Color c, double amount) => Color.fromARGB(
|
||||
c.alpha,
|
||||
max(0, (c.red * (1 - amount)).round()),
|
||||
max(0, (c.green * (1 - amount)).round()),
|
||||
max(0, (c.blue * (1 - amount)).round()),
|
||||
Color _darken(Color c, double amount) => c.withValues(
|
||||
red: max(0.0, c.r * (1 - amount)),
|
||||
green: max(0.0, c.g * (1 - amount)),
|
||||
blue: max(0.0, c.b * (1 - amount)),
|
||||
);
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user