Skip to content

Commit

Permalink
fix deprecated member use.
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwebrtc committed Dec 17, 2024
1 parent b341c97 commit 371c536
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/src/ui/widgets/participant/participant_status_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class ParticipantStatusBar extends StatelessWidget {
var isScreenShare = trackCtx?.isScreenShare ?? false;
return Container(
padding: const EdgeInsets.symmetric(horizontal: 6),
color: Colors.black.withOpacity(0.6),
color: Colors.black.withValues(alpha: 0.6),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
Expand Down
3 changes: 2 additions & 1 deletion lib/src/ui/widgets/room/camera_switch_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class CameraSwitchButton extends StatelessWidget {
Widget build(BuildContext context) {
return ElevatedButton(
style: ButtonStyle(
backgroundColor: WidgetStateProperty.all(Colors.grey.withOpacity(0.9)),
backgroundColor:
WidgetStateProperty.all(Colors.grey.withValues(alpha: 0.9)),
foregroundColor: WidgetStateProperty.all(Colors.white),
overlayColor: WidgetStateProperty.all(Colors.grey),
shape: WidgetStateProperty.all(const RoundedRectangleBorder(
Expand Down
2 changes: 1 addition & 1 deletion lib/src/ui/widgets/room/chat_toggle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ChatToggleWidget extends StatelessWidget {
return ElevatedButton(
style: ButtonStyle(
backgroundColor: WidgetStateProperty.all(
isChatOpen ? LKColors.lkBlue : Colors.grey.withOpacity(0.9)),
isChatOpen ? LKColors.lkBlue : Colors.grey.withValues(alpha: 0.9)),
foregroundColor: WidgetStateProperty.all(Colors.white),
overlayColor: WidgetStateProperty.all(
isChatOpen ? LKColors.lkLightBlue : Colors.grey),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/ui/widgets/room/disconnect_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class DisconnectButtonWidget extends StatelessWidget {
return ElevatedButton(
style: ButtonStyle(
backgroundColor: WidgetStateProperty.all(
connected ? Colors.red : Colors.grey.withOpacity(0.9)),
connected ? Colors.red : Colors.grey.withValues(alpha: 0.9)),
foregroundColor: WidgetStateProperty.all(Colors.white),
overlayColor:
WidgetStateProperty.all(connected ? Colors.redAccent : Colors.grey),
Expand Down
7 changes: 4 additions & 3 deletions lib/src/ui/widgets/room/media_device_select_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ class MediaDeviceSelectWidget extends StatelessWidget {
return Row(mainAxisSize: MainAxisSize.min, children: [
ElevatedButton(
style: ButtonStyle(
backgroundColor: WidgetStateProperty.all(
deviceIsOpened ? LKColors.lkBlue : Colors.grey.withOpacity(0.9)),
backgroundColor: WidgetStateProperty.all(deviceIsOpened
? LKColors.lkBlue
: Colors.grey.withValues(alpha: 0.9)),
foregroundColor: WidgetStateProperty.all(Colors.white),
overlayColor: WidgetStateProperty.all(
deviceIsOpened ? LKColors.lkLightBlue : Colors.grey),
Expand Down Expand Up @@ -92,7 +93,7 @@ class MediaDeviceSelectWidget extends StatelessWidget {
0, ((deviceList.isNotEmpty ? deviceList.length : 1) * -55.0)),
style: ButtonStyle(
backgroundColor:
WidgetStateProperty.all(Colors.grey.withOpacity(0.9)),
WidgetStateProperty.all(Colors.grey.withValues(alpha: 0.9)),
foregroundColor: WidgetStateProperty.all(Colors.white),
overlayColor: WidgetStateProperty.all(Colors.grey),
elevation: WidgetStateProperty.all(20),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/ui/widgets/room/screenshare_toggle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ScreenShareToggleWidget extends StatelessWidget {
style: ButtonStyle(
backgroundColor: WidgetStateProperty.all(screenShareEnabled
? LKColors.lkBlue
: Colors.grey.withOpacity(0.9)),
: Colors.grey.withValues(alpha: 0.9)),
foregroundColor: WidgetStateProperty.all(Colors.white),
overlayColor: WidgetStateProperty.all(
screenShareEnabled ? LKColors.lkLightBlue : Colors.grey),
Expand Down
3 changes: 2 additions & 1 deletion lib/src/ui/widgets/room/speaker_switch_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class SpeakerSwitchButton extends StatelessWidget {
Widget build(BuildContext context) {
return ElevatedButton(
style: ButtonStyle(
backgroundColor: WidgetStateProperty.all(Colors.grey.withOpacity(0.9)),
backgroundColor:
WidgetStateProperty.all(Colors.grey.withValues(alpha: 0.9)),
foregroundColor: WidgetStateProperty.all(Colors.white),
overlayColor: WidgetStateProperty.all(Colors.grey),
shape: WidgetStateProperty.all(const RoundedRectangleBorder(
Expand Down
8 changes: 4 additions & 4 deletions lib/src/ui/widgets/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class LiveKitTheme {
// backgroundColor: WidgetStateProperty.all<Color>(accentColor),
backgroundColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.disabled)) {
return accentColor.withOpacity(0.5);
return accentColor.withValues(alpha: 0.5);
}
return accentColor;
}),
Expand All @@ -75,13 +75,13 @@ class LiveKitTheme {
if (states.contains(WidgetState.selected)) {
return accentColor;
}
return accentColor.withOpacity(0.3);
return accentColor.withValues(alpha: 0.3);
}),
thumbColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.selected)) {
return Colors.white;
}
return Colors.white.withOpacity(0.3);
return Colors.white.withValues(alpha: 0.3);
}),
),
dialogTheme: DialogTheme(
Expand All @@ -103,7 +103,7 @@ class LiveKitTheme {
color: LKColors.lkBlue,
),
hintStyle: TextStyle(
color: LKColors.lkBlue.withOpacity(.5),
color: LKColors.lkBlue.withValues(alpha: .5),
),
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/ui/widgets/track/track_stats_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class TrackStatsWidget extends StatelessWidget {
children: [
trackCtx.showStatistics && stats.isNotEmpty
? Container(
color: Colors.black.withOpacity(0.3),
color: Colors.black.withValues(alpha: 0.3),
padding: const EdgeInsets.symmetric(
vertical: 8,
horizontal: 8,
Expand Down

0 comments on commit 371c536

Please sign in to comment.