fix deprecated and lint warnings

This commit is contained in:
Tommy Chow
2024-12-23 15:09:28 -05:00
parent ca9dd32555
commit b9dae5df88
8 changed files with 21 additions and 16 deletions

View File

@ -146,7 +146,7 @@ class IRCMessage {
span.add(
TextSpan(
text: '${DateFormat.Hm().format(parsedTime)} ',
style: style?.copyWith(color: style.color?.withOpacity(0.5)),
style: style?.copyWith(color: style.color?.withValues(alpha: 0.5)),
),
);
}
@ -155,7 +155,7 @@ class IRCMessage {
span.add(
TextSpan(
text: '${DateFormat('h:mm').format(parsedTime)} ',
style: style?.copyWith(color: style.color?.withOpacity(0.5)),
style: style?.copyWith(color: style.color?.withValues(alpha: 0.5)),
),
);
}

View File

@ -126,7 +126,8 @@ class _VideoChatState extends State<VideoChat> {
duration: const Duration(milliseconds: 200),
child: Container(
decoration: BoxDecoration(
color: Colors.black.withOpacity(settingsStore.overlayOpacity),
color: Colors.black
.withValues(alpha: settingsStore.overlayOpacity),
),
child: IgnorePointer(
ignoring: !_videoStore.overlayVisible,
@ -234,8 +235,8 @@ class _VideoChatState extends State<VideoChat> {
: MediaQuery.of(context).size.width *
_chatStore.settings.chatWidth,
color: _chatStore.settings.fullScreen
? Colors.black.withOpacity(
_chatStore.settings.fullScreenChatOverlayOpacity,
? Colors.black.withValues(
alpha: _chatStore.settings.fullScreenChatOverlayOpacity,
)
: Theme.of(context).scaffoldBackgroundColor,
child: chat,

View File

@ -11,7 +11,7 @@ class ChatModes extends StatelessWidget {
@override
Widget build(BuildContext context) {
final disabledColor =
Theme.of(context).colorScheme.onSurface.withOpacity(0.5);
Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.5);
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,

View File

@ -30,7 +30,9 @@ class ChatMessage extends StatelessWidget {
// Ignore if long-pressing own username.
if (ircMessage.user == null ||
ircMessage.user == chatStore.auth.user.details?.login) return;
ircMessage.user == chatStore.auth.user.details?.login) {
return;
}
showModalBottomSheet(
isScrollControlled: true,
@ -139,7 +141,8 @@ class ChatMessage extends StatelessWidget {
final defaultTextStyle = DefaultTextStyle.of(context).style;
final messageHeaderIconSize =
defaultBadgeSize * chatStore.settings.badgeScale;
final messageHeaderTextColor = defaultTextStyle.color?.withOpacity(0.5);
final messageHeaderTextColor =
defaultTextStyle.color?.withValues(alpha: 0.5);
const messageHeaderFontWeight = FontWeight.w600;
return Observer(
@ -433,7 +436,7 @@ class ChatMessage extends StatelessWidget {
: Container(
padding: const EdgeInsets.only(left: 8, right: 12),
decoration: BoxDecoration(
color: highlightColor.withOpacity(0.1),
color: highlightColor.withValues(alpha: 0.1),
border: Border(
left: BorderSide(color: highlightColor, width: 4),
),

View File

@ -72,7 +72,7 @@ class VideoBar extends StatelessWidget {
Theme.of(context)
.colorScheme
.onSurface
.withOpacity(0.8),
.withValues(alpha: 0.8),
fontWeight: subtitleTextWeight,
),
),
@ -102,7 +102,7 @@ class VideoBar extends StatelessWidget {
Theme.of(context)
.colorScheme
.onSurface
.withOpacity(0.8),
.withValues(alpha: 0.8),
fontWeight: subtitleTextWeight,
),
),

View File

@ -151,7 +151,7 @@ class StreamCard extends StatelessWidget {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: subFontSize,
color: fontColor?.withOpacity(0.8),
color: fontColor?.withValues(alpha: 0.8),
),
),
),
@ -179,7 +179,7 @@ class StreamCard extends StatelessWidget {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: subFontSize,
color: fontColor?.withOpacity(0.8),
color: fontColor?.withValues(alpha: 0.8),
),
),
),
@ -190,7 +190,7 @@ class StreamCard extends StatelessWidget {
'${NumberFormat().format(streamInfo.viewerCount)} viewers',
style: TextStyle(
fontSize: subFontSize,
color: fontColor?.withOpacity(0.8),
color: fontColor?.withValues(alpha: 0.8),
fontFeatures: const [FontFeature.tabularFigures()],
),
),

View File

@ -16,7 +16,7 @@ class AlertMessage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final defaultColor =
Theme.of(context).colorScheme.onSurface.withOpacity(0.5);
Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.5);
return Row(
mainAxisAlignment:

View File

@ -19,7 +19,8 @@ class LoadingIndicator extends StatelessWidget {
Text(
subtitle!,
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.5),
color:
Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.5),
),
),
],