Skip to content

Commit b9dae5d

Browse files
committed
fix deprecated and lint warnings
1 parent ca9dd32 commit b9dae5d

File tree

8 files changed

+21
-16
lines changed

8 files changed

+21
-16
lines changed

lib/models/irc.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ class IRCMessage {
146146
span.add(
147147
TextSpan(
148148
text: '${DateFormat.Hm().format(parsedTime)} ',
149-
style: style?.copyWith(color: style.color?.withOpacity(0.5)),
149+
style: style?.copyWith(color: style.color?.withValues(alpha: 0.5)),
150150
),
151151
);
152152
}
@@ -155,7 +155,7 @@ class IRCMessage {
155155
span.add(
156156
TextSpan(
157157
text: '${DateFormat('h:mm').format(parsedTime)} ',
158-
style: style?.copyWith(color: style.color?.withOpacity(0.5)),
158+
style: style?.copyWith(color: style.color?.withValues(alpha: 0.5)),
159159
),
160160
);
161161
}

lib/screens/channel/channel.dart

+4-3
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ class _VideoChatState extends State<VideoChat> {
126126
duration: const Duration(milliseconds: 200),
127127
child: Container(
128128
decoration: BoxDecoration(
129-
color: Colors.black.withOpacity(settingsStore.overlayOpacity),
129+
color: Colors.black
130+
.withValues(alpha: settingsStore.overlayOpacity),
130131
),
131132
child: IgnorePointer(
132133
ignoring: !_videoStore.overlayVisible,
@@ -234,8 +235,8 @@ class _VideoChatState extends State<VideoChat> {
234235
: MediaQuery.of(context).size.width *
235236
_chatStore.settings.chatWidth,
236237
color: _chatStore.settings.fullScreen
237-
? Colors.black.withOpacity(
238-
_chatStore.settings.fullScreenChatOverlayOpacity,
238+
? Colors.black.withValues(
239+
alpha: _chatStore.settings.fullScreenChatOverlayOpacity,
239240
)
240241
: Theme.of(context).scaffoldBackgroundColor,
241242
child: chat,

lib/screens/channel/chat/details/chat_modes.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class ChatModes extends StatelessWidget {
1111
@override
1212
Widget build(BuildContext context) {
1313
final disabledColor =
14-
Theme.of(context).colorScheme.onSurface.withOpacity(0.5);
14+
Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.5);
1515

1616
return Row(
1717
mainAxisAlignment: MainAxisAlignment.spaceBetween,

lib/screens/channel/chat/widgets/chat_message.dart

+6-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ class ChatMessage extends StatelessWidget {
3030

3131
// Ignore if long-pressing own username.
3232
if (ircMessage.user == null ||
33-
ircMessage.user == chatStore.auth.user.details?.login) return;
33+
ircMessage.user == chatStore.auth.user.details?.login) {
34+
return;
35+
}
3436

3537
showModalBottomSheet(
3638
isScrollControlled: true,
@@ -139,7 +141,8 @@ class ChatMessage extends StatelessWidget {
139141
final defaultTextStyle = DefaultTextStyle.of(context).style;
140142
final messageHeaderIconSize =
141143
defaultBadgeSize * chatStore.settings.badgeScale;
142-
final messageHeaderTextColor = defaultTextStyle.color?.withOpacity(0.5);
144+
final messageHeaderTextColor =
145+
defaultTextStyle.color?.withValues(alpha: 0.5);
143146
const messageHeaderFontWeight = FontWeight.w600;
144147

145148
return Observer(
@@ -433,7 +436,7 @@ class ChatMessage extends StatelessWidget {
433436
: Container(
434437
padding: const EdgeInsets.only(left: 8, right: 12),
435438
decoration: BoxDecoration(
436-
color: highlightColor.withOpacity(0.1),
439+
color: highlightColor.withValues(alpha: 0.1),
437440
border: Border(
438441
left: BorderSide(color: highlightColor, width: 4),
439442
),

lib/screens/channel/video/video_bar.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class VideoBar extends StatelessWidget {
7272
Theme.of(context)
7373
.colorScheme
7474
.onSurface
75-
.withOpacity(0.8),
75+
.withValues(alpha: 0.8),
7676
fontWeight: subtitleTextWeight,
7777
),
7878
),
@@ -102,7 +102,7 @@ class VideoBar extends StatelessWidget {
102102
Theme.of(context)
103103
.colorScheme
104104
.onSurface
105-
.withOpacity(0.8),
105+
.withValues(alpha: 0.8),
106106
fontWeight: subtitleTextWeight,
107107
),
108108
),

lib/screens/home/stream_list/stream_card.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class StreamCard extends StatelessWidget {
151151
overflow: TextOverflow.ellipsis,
152152
style: TextStyle(
153153
fontSize: subFontSize,
154-
color: fontColor?.withOpacity(0.8),
154+
color: fontColor?.withValues(alpha: 0.8),
155155
),
156156
),
157157
),
@@ -179,7 +179,7 @@ class StreamCard extends StatelessWidget {
179179
overflow: TextOverflow.ellipsis,
180180
style: TextStyle(
181181
fontSize: subFontSize,
182-
color: fontColor?.withOpacity(0.8),
182+
color: fontColor?.withValues(alpha: 0.8),
183183
),
184184
),
185185
),
@@ -190,7 +190,7 @@ class StreamCard extends StatelessWidget {
190190
'${NumberFormat().format(streamInfo.viewerCount)} viewers',
191191
style: TextStyle(
192192
fontSize: subFontSize,
193-
color: fontColor?.withOpacity(0.8),
193+
color: fontColor?.withValues(alpha: 0.8),
194194
fontFeatures: const [FontFeature.tabularFigures()],
195195
),
196196
),

lib/widgets/alert_message.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class AlertMessage extends StatelessWidget {
1616
@override
1717
Widget build(BuildContext context) {
1818
final defaultColor =
19-
Theme.of(context).colorScheme.onSurface.withOpacity(0.5);
19+
Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.5);
2020

2121
return Row(
2222
mainAxisAlignment:

lib/widgets/loading_indicator.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ class LoadingIndicator extends StatelessWidget {
1919
Text(
2020
subtitle!,
2121
style: TextStyle(
22-
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.5),
22+
color:
23+
Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.5),
2324
),
2425
),
2526
],

0 commit comments

Comments
 (0)