diff --git a/CHANGES.md b/CHANGES.md index 24b847b..a152ce9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1108,3 +1108,10 @@ 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 +2026-07-03 06:33 [Edit] /home/steggi/pyramid/lib/features/chat/attachment_dialog.dart +2026-07-03 06:33 [Edit] /home/steggi/pyramid/lib/widgets/create_join_dialog.dart +2026-07-03 06:33 [Edit] /home/steggi/pyramid/lib/features/chat/chat_view.dart +2026-07-03 06:34 [Edit] /home/steggi/pyramid/lib/widgets/pyramid_loader.dart +2026-07-03 06:35 [Edit] /home/steggi/pyramid/lib/features/chat/chat_view.dart +2026-07-03 06:35 [Edit] /home/steggi/pyramid/lib/features/chat/chat_view.dart +2026-07-03 06:35 [Edit] /home/steggi/pyramid/lib/features/chat/chat_view.dart diff --git a/lib/features/chat/attachment_dialog.dart b/lib/features/chat/attachment_dialog.dart index bd95af2..281f54d 100644 --- a/lib/features/chat/attachment_dialog.dart +++ b/lib/features/chat/attachment_dialog.dart @@ -184,7 +184,7 @@ class _AttachmentDialogState extends State { Switch.adaptive( value: !_compress, onChanged: (v) => setState(() => _compress = !v), - activeColor: pt.accent, + activeThumbColor: pt.accent, ), ], ), diff --git a/lib/features/chat/chat_view.dart b/lib/features/chat/chat_view.dart index e96d4ff..ba8f281 100644 --- a/lib/features/chat/chat_view.dart +++ b/lib/features/chat/chat_view.dart @@ -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 — diff --git a/lib/features/chat/media_player.dart b/lib/features/chat/media_player.dart index d5236cf..f13bf81 100644 --- a/lib/features/chat/media_player.dart +++ b/lib/features/chat/media_player.dart @@ -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( 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'; diff --git a/lib/widgets/create_join_dialog.dart b/lib/widgets/create_join_dialog.dart index 3474312..493e6cd 100644 --- a/lib/widgets/create_join_dialog.dart +++ b/lib/widgets/create_join_dialog.dart @@ -40,7 +40,7 @@ class _CreateJoinDialogState extends ConsumerState { // Discover final _discoverServerCtrl = TextEditingController(); final _discoverSearchCtrl = TextEditingController(); - List _publicRooms = []; + List _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; diff --git a/lib/widgets/pyramid_loader.dart b/lib/widgets/pyramid_loader.dart index 664de3a..715150d 100644 --- a/lib/widgets/pyramid_loader.dart +++ b/lib/widgets/pyramid_loader.dart @@ -127,11 +127,10 @@ class _PyramidPainter extends CustomPainter { Offset _proj(List 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