Skip to content

Commit

Permalink
Merge branch 'main' into shared-chat
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyxchow authored Dec 23, 2024
2 parents 2eb95d1 + 4f28408 commit bed4354
Show file tree
Hide file tree
Showing 11 changed files with 176 additions and 149 deletions.
10 changes: 8 additions & 2 deletions lib/models/irc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ 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),
fontFeatures: [FontFeature.tabularFigures()],
),
),
);
}
Expand All @@ -158,7 +161,10 @@ 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),
fontFeatures: [FontFeature.tabularFigures()],
),
),
);
}
Expand Down
7 changes: 4 additions & 3 deletions lib/screens/channel/channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/channel/chat/details/chat_modes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 3 additions & 2 deletions lib/screens/channel/chat/widgets/chat_message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -141,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(
Expand Down Expand Up @@ -436,7 +437,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),
),
Expand Down
16 changes: 13 additions & 3 deletions lib/screens/channel/video/video.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:frosty/screens/channel/video/video_store.dart';
import 'package:simple_pip_mode/simple_pip.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:webview_flutter_android/webview_flutter_android.dart';

/// Creates a [WebView] widget that shows a channel's video stream.
class Video extends StatefulWidget {
Expand Down Expand Up @@ -43,9 +44,18 @@ class _VideoState extends State<Video> with WidgetsBindingObserver {

@override
Widget build(BuildContext context) {
return WebViewWidget(
controller: widget.videoStore.videoWebViewController,
);
if (WebViewPlatform.instance is AndroidWebViewPlatform) {
return WebViewWidget.fromPlatformCreationParams(
params: AndroidWebViewWidgetCreationParams(
controller: widget.videoStore.videoWebViewController.platform,
displayWithHybridComposition: true,
),
);
} else {
return WebViewWidget(
controller: widget.videoStore.videoWebViewController,
);
}
}

@override
Expand Down
4 changes: 2 additions & 2 deletions lib/screens/channel/video/video_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class VideoBar extends StatelessWidget {
Theme.of(context)
.colorScheme
.onSurface
.withOpacity(0.8),
.withValues(alpha: 0.8),
fontWeight: subtitleTextWeight,
),
),
Expand Down Expand Up @@ -102,7 +102,7 @@ class VideoBar extends StatelessWidget {
Theme.of(context)
.colorScheme
.onSurface
.withOpacity(0.8),
.withValues(alpha: 0.8),
fontWeight: subtitleTextWeight,
),
),
Expand Down
6 changes: 3 additions & 3 deletions lib/screens/home/stream_list/stream_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
),
),
),
Expand Down Expand Up @@ -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),
),
),
),
Expand All @@ -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()],
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/alert_message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/loading_indicator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
),
),
],
Expand Down
Loading

0 comments on commit bed4354

Please sign in to comment.