Skip to content

Commit

Permalink
fix analyze.
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwebrtc committed Dec 16, 2024
1 parent 4993f7c commit fe30ada
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 33 deletions.
8 changes: 4 additions & 4 deletions example/lib/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,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 @@ -59,13 +59,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 @@ -87,7 +87,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
33 changes: 16 additions & 17 deletions example/lib/widgets/participant.dart
Original file line number Diff line number Diff line change
Expand Up @@ -176,19 +176,19 @@ abstract class _ParticipantWidgetState<T extends ParticipantWidget>
right: 30,
child: ParticipantStatsWidget(
participant: widget.participant,
)),
if(activeAudioTrack != null && !activeAudioTrack!.muted) Positioned(
top: 10,
right: 10,
left: 10,
bottom: 10,
child: SoundWaveformWidget(
key: ValueKey(activeAudioTrack!.hashCode),
audioTrack: activeAudioTrack!,
width: 8,
),
),

)),
if (activeAudioTrack != null && !activeAudioTrack!.muted)
Positioned(
top: 10,
right: 10,
left: 10,
bottom: 10,
child: SoundWaveformWidget(
key: ValueKey(activeAudioTrack!.hashCode),
audioTrack: activeAudioTrack!,
width: 8,
),
),
],
),
);
Expand Down Expand Up @@ -279,7 +279,7 @@ class RemoteTrackPublicationMenuWidget extends StatelessWidget {

@override
Widget build(BuildContext context) => Material(
color: Colors.black.withOpacity(0.3),
color: Colors.black.withValues(alpha: 0.3),
child: PopupMenuButton<Function>(
tooltip: 'Subscribe menu',
icon: Icon(icon,
Expand Down Expand Up @@ -317,7 +317,7 @@ class RemoteTrackFPSMenuWidget extends StatelessWidget {

@override
Widget build(BuildContext context) => Material(
color: Colors.black.withOpacity(0.3),
color: Colors.black.withValues(alpha: 0.3),
child: PopupMenuButton<Function>(
tooltip: 'Preferred FPS',
icon: Icon(icon, color: Colors.white),
Expand Down Expand Up @@ -351,7 +351,7 @@ class RemoteTrackQualityMenuWidget extends StatelessWidget {

@override
Widget build(BuildContext context) => Material(
color: Colors.black.withOpacity(0.3),
color: Colors.black.withValues(alpha: 0.3),
child: PopupMenuButton<Function>(
tooltip: 'Preferred Quality',
icon: Icon(icon, color: Colors.white),
Expand All @@ -373,4 +373,3 @@ class RemoteTrackQualityMenuWidget extends StatelessWidget {
),
);
}

2 changes: 1 addition & 1 deletion example/lib/widgets/participant_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ParticipantInfoWidget extends StatelessWidget {

@override
Widget build(BuildContext context) => Container(
color: Colors.black.withOpacity(0.3),
color: Colors.black.withValues(alpha: 0.3),
padding: const EdgeInsets.symmetric(
vertical: 7,
horizontal: 10,
Expand Down
2 changes: 1 addition & 1 deletion example/lib/widgets/participant_stats.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class _ParticipantStatsWidgetState extends State<ParticipantStatsWidget> {
@override
Widget build(BuildContext context) {
return Container(
color: Colors.black.withOpacity(0.3),
color: Colors.black.withValues(alpha: 0.3),
padding: const EdgeInsets.symmetric(
vertical: 8,
horizontal: 8,
Expand Down
2 changes: 1 addition & 1 deletion example/lib/widgets/text_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class LKTextField extends StatelessWidget {
decoration: BoxDecoration(
border: Border.all(
width: 1,
color: Colors.white.withOpacity(.3),
color: Colors.white.withValues(alpha: .3),
),
borderRadius: BorderRadius.circular(8),
),
Expand Down
10 changes: 4 additions & 6 deletions lib/src/core/engine.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1087,12 +1087,10 @@ extension EnginePrivateMethods on Engine {

extension EngineInternalMethods on Engine {
@internal
List<lk_rtc.DataChannelInfo> dataChannelInfo() =>
[_reliableDCPub, _lossyDCPub]
.whereNotNull()
.where((e) => e.id != -1)
.map((e) => e.toLKInfoType())
.toList();
List<lk_rtc.DataChannelInfo> dataChannelInfo() => [
_reliableDCPub,
_lossyDCPub
].nonNulls.where((e) => e.id != -1).map((e) => e.toLKInfoType()).toList();
@internal
Future<rtc.RTCRtpSender> createSimulcastTransceiverSender(
LocalVideoTrack track,
Expand Down
5 changes: 2 additions & 3 deletions lib/src/publication/remote.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import 'dart:math';

import 'package:flutter/widgets.dart';

import 'package:collection/collection.dart';
import 'package:meta/meta.dart';

import '../core/signal_client.dart';
Expand Down Expand Up @@ -155,9 +154,9 @@ class RemoteTrackPublication<T extends RemoteTrack>
// filter visible build contexts
final viewSizes = videoTrack.viewKeys
.map((e) => e.currentContext)
.whereNotNull()
.nonNulls
.map((e) => e.findRenderObject() as RenderBox?)
.whereNotNull()
.nonNulls
.where((e) => e.hasSize)
.map((e) => e.size);

Expand Down

0 comments on commit fe30ada

Please sign in to comment.