Skip to content

Commit

Permalink
Source file directory layout adjustment.
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwebrtc committed Oct 25, 2024
1 parent 6039c64 commit df651f6
Show file tree
Hide file tree
Showing 45 changed files with 169 additions and 136 deletions.
79 changes: 40 additions & 39 deletions lib/livekit_components.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,49 +8,50 @@ export 'src/context/track_reference_context.dart';
export 'src/debug/logger.dart';

export 'src/ui/builder/camera_preview.dart';
export 'src/ui/builder/chat_toggle.dart';
export 'src/ui/builder/chat.dart';
export 'src/ui/builder/connection_quality_indicator.dart';
export 'src/ui/builder/disconnect_button.dart';
export 'src/ui/builder/e2e_encryption_indicator.dart';
export 'src/ui/builder/is_speaking_indicator.dart';
export 'src/ui/builder/join_button.dart';
export 'src/ui/builder/media_device_select_button.dart';
export 'src/ui/builder/media_device.dart';
export 'src/ui/builder/participant_attributes.dart';
export 'src/ui/builder/participant_loop.dart';
export 'src/ui/builder/participant_metadata.dart';
export 'src/ui/builder/participant_muted_indicator.dart';
export 'src/ui/builder/participant_name.dart';
export 'src/ui/builder/participant_permissions.dart';
export 'src/ui/builder/participant_transcription.dart';
export 'src/ui/builder/room_active_recording_indicator.dart';
export 'src/ui/builder/room_connection_state.dart';
export 'src/ui/builder/room_metadata.dart';
export 'src/ui/builder/room_name.dart';
export 'src/ui/builder/room_participants.dart';
export 'src/ui/builder/room.dart';
export 'src/ui/builder/room/chat_toggle.dart';
export 'src/ui/builder/room/chat.dart';
export 'src/ui/builder/track/connection_quality_indicator.dart';
export 'src/ui/builder/room/disconnect_button.dart';
export 'src/ui/builder/track/e2e_encryption_indicator.dart';
export 'src/ui/builder/track/is_speaking_indicator.dart';
export 'src/ui/builder/room/join_button.dart';
export 'src/ui/builder/room/media_device_select_button.dart';
export 'src/ui/builder/room/media_device.dart';
export 'src/ui/builder/participant/participant_attributes.dart';
export 'src/ui/builder/participant/participant_loop.dart';
export 'src/ui/builder/participant/participant_metadata.dart';
export 'src/ui/builder/participant/participant_muted_indicator.dart';
export 'src/ui/builder/participant/participant_name.dart';
export 'src/ui/builder/participant/participant_kind.dart';
export 'src/ui/builder/participant/participant_permissions.dart';
export 'src/ui/builder/participant/participant_transcription.dart';
export 'src/ui/builder/room/room_active_recording_indicator.dart';
export 'src/ui/builder/room/room_connection_state.dart';
export 'src/ui/builder/room/room_metadata.dart';
export 'src/ui/builder/room/room_name.dart';
export 'src/ui/builder/room/room_participants.dart';
export 'src/ui/builder/room/room.dart';
export 'src/ui/widgets/toast.dart';
export 'src/ui/builder/screenshare_toggle.dart';
export 'src/ui/builder/room/screenshare_toggle.dart';

export 'src/ui/widgets/camera_preview.dart';
export 'src/ui/widgets/camera_select_button.dart';
export 'src/ui/widgets/chat_toggle.dart';
export 'src/ui/widgets/chat_widget.dart';
export 'src/ui/widgets/connection_quality_indicator.dart';
export 'src/ui/widgets/control_bar.dart';
export 'src/ui/widgets/disconnect_button.dart';
export 'src/ui/widgets/focus_toggle.dart';
export 'src/ui/widgets/is_speaking_indicator.dart';
export 'src/ui/widgets/media_device_select_button.dart';
export 'src/ui/widgets/microphone_select_button.dart';
export 'src/ui/widgets/no_track_widget.dart';
export 'src/ui/widgets/participant_status_bar.dart';
export 'src/ui/widgets/participant_tile_widget.dart';
export 'src/ui/widgets/video_track_widget.dart';
export 'src/ui/widgets/screenshare_toggle.dart';
export 'src/ui/widgets/room/camera_select_button.dart';
export 'src/ui/widgets/room/chat_toggle.dart';
export 'src/ui/widgets/room/chat_widget.dart';
export 'src/ui/widgets/participant/connection_quality_indicator.dart';
export 'src/ui/widgets/room/control_bar.dart';
export 'src/ui/widgets/room/disconnect_button.dart';
export 'src/ui/widgets/track/focus_toggle.dart';
export 'src/ui/widgets/participant/is_speaking_indicator.dart';
export 'src/ui/widgets/room/media_device_select_button.dart';
export 'src/ui/widgets/room/microphone_select_button.dart';
export 'src/ui/widgets/track/no_track_widget.dart';
export 'src/ui/widgets/participant/participant_status_bar.dart';
export 'src/ui/widgets/participant/participant_tile_widget.dart';
export 'src/ui/widgets/track/video_track_widget.dart';
export 'src/ui/widgets/room/screenshare_toggle.dart';
export 'src/ui/widgets/theme.dart';
export 'src/ui/widgets/track_stats_widget.dart';
export 'src/ui/widgets/track/track_stats_widget.dart';

export 'src/ui/layout/layouts.dart';
export 'src/ui/layout/grid_layout.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/src/context/participant_context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,6 @@ class ParticipantContext extends ChangeNotifier {

List<TranscriptionSegment> _segments = [];
List<TranscriptionSegment> get segments => _segments;

ParticipantKind get kind => _participant.kind;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import '../../context/participant_context.dart';
import '../../debug/logger.dart';
import '../../../context/participant_context.dart';
import '../../../debug/logger.dart';

class ParticipantAttributes extends StatelessWidget {
const ParticipantAttributes({
Expand Down
30 changes: 30 additions & 0 deletions lib/src/ui/builder/participant/participant_kind.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import 'package:flutter/material.dart';

import 'package:provider/provider.dart';
import 'package:livekit_client/livekit_client.dart' as lk;

import '../../../context/participant_context.dart';
import '../../../debug/logger.dart';

class ParticipantKind extends StatelessWidget {
const ParticipantKind({
super.key,
required this.builder,
});

final Widget Function(BuildContext context, lk.ParticipantKind kind) builder;

@override
Widget build(BuildContext context) {
return Consumer<ParticipantContext>(
builder: (context, participantContext, child) {
Debug.log('====> ParticipantKind for ${participantContext.kind}');
return Selector<ParticipantContext, lk.ParticipantKind>(
selector: (context, name) => participantContext.kind,
builder: (context, kind, child) {
return builder(context, kind);
},
);
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import 'package:flutter/material.dart';
import 'package:livekit_client/livekit_client.dart';
import 'package:provider/provider.dart';

import '../../context/participant_context.dart';
import '../../context/room_context.dart';
import '../../context/track_reference_context.dart';
import '../../debug/logger.dart';
import '../layout/grid_layout.dart';
import '../layout/layouts.dart';
import '../../../context/participant_context.dart';
import '../../../context/room_context.dart';
import '../../../context/track_reference_context.dart';
import '../../../debug/logger.dart';
import '../../layout/grid_layout.dart';
import '../../layout/layouts.dart';

class ParticipantLoop extends StatelessWidget {
const ParticipantLoop({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import '../../context/participant_context.dart';
import '../../debug/logger.dart';
import '../../../context/participant_context.dart';
import '../../../debug/logger.dart';

class ParticipantMetadata extends StatelessWidget {
const ParticipantMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import '../../context/participant_context.dart';
import '../../debug/logger.dart';
import '../../../context/participant_context.dart';
import '../../../debug/logger.dart';

class ParticipantMutedIndicator extends StatelessWidget {
const ParticipantMutedIndicator({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import '../../context/participant_context.dart';
import '../../context/track_reference_context.dart';
import '../../debug/logger.dart';
import '../../../context/participant_context.dart';
import '../../../context/track_reference_context.dart';
import '../../../debug/logger.dart';

class ParticipantName extends StatelessWidget {
const ParticipantName({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import 'package:flutter/material.dart';
import 'package:livekit_client/livekit_client.dart' as lk;
import 'package:provider/provider.dart';

import '../../context/participant_context.dart';
import '../../debug/logger.dart';
import '../../../context/participant_context.dart';
import '../../../debug/logger.dart';

class ParticipantPermissions extends StatelessWidget {
const ParticipantPermissions({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import 'package:flutter/material.dart';
import 'package:livekit_client/livekit_client.dart';
import 'package:provider/provider.dart';

import '../../context/participant_context.dart';
import '../../debug/logger.dart';
import '../../../context/participant_context.dart';
import '../../../debug/logger.dart';

class ParticipantTranscription extends StatelessWidget {
const ParticipantTranscription({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import '../../context/chat_context.dart';
import '../../context/room_context.dart';
import '../../../context/chat_context.dart';
import '../../../context/room_context.dart';

class ChatBuilder extends StatelessWidget {
const ChatBuilder({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import '../../context/room_context.dart';
import '../../../context/room_context.dart';

class ChatToggle extends StatelessWidget {
const ChatToggle({super.key, required this.builder});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import '../../context/room_context.dart';
import '../../../context/room_context.dart';

class DisconnectButton extends StatelessWidget {
const DisconnectButton({super.key, required this.builder});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import '../../context/room_context.dart';
import '../../../context/room_context.dart';

class JoinButton extends StatelessWidget {
const JoinButton({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import '../../context/media_device_context.dart';
import '../../context/room_context.dart';
import '../../../context/media_device_context.dart';
import '../../../context/room_context.dart';

class MediaDeviceContextBuilder extends StatelessWidget {
const MediaDeviceContextBuilder({super.key, required this.builder});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import '../../context/media_device_context.dart';
import '../../context/room_context.dart';
import '../../../context/media_device_context.dart';
import '../../../context/room_context.dart';

class MediaDeviceSelectButton extends StatelessWidget {
const MediaDeviceSelectButton({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import '../../context/room_context.dart';
import '../../../context/room_context.dart';
import 'media_device.dart';

class LivekitRoom extends StatelessWidget {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import '../../context/participant_context.dart';
import '../../context/room_context.dart';
import '../../debug/logger.dart';
import '../../../context/participant_context.dart';
import '../../../context/room_context.dart';
import '../../../debug/logger.dart';

class RoomActiveRecording extends StatelessWidget {
const RoomActiveRecording({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import 'package:flutter/material.dart' hide ConnectionState;
import 'package:livekit_client/livekit_client.dart';
import 'package:provider/provider.dart';

import '../../context/room_context.dart';
import '../../debug/logger.dart';
import '../../../context/room_context.dart';
import '../../../debug/logger.dart';

class RoomConnectionState extends StatelessWidget {
const RoomConnectionState({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import '../../context/participant_context.dart';
import '../../context/room_context.dart';
import '../../debug/logger.dart';
import '../../../context/participant_context.dart';
import '../../../context/room_context.dart';
import '../../../debug/logger.dart';

class RoomMetadata extends StatelessWidget {
const RoomMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import '../../context/participant_context.dart';
import '../../context/room_context.dart';
import '../../debug/logger.dart';
import '../../../context/participant_context.dart';
import '../../../context/room_context.dart';
import '../../../debug/logger.dart';

class RoomName extends StatelessWidget {
const RoomName({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import 'package:flutter/material.dart';
import 'package:livekit_client/livekit_client.dart';
import 'package:provider/provider.dart';

import '../../context/participant_context.dart';
import '../../context/room_context.dart';
import '../../debug/logger.dart';
import '../../../context/participant_context.dart';
import '../../../context/room_context.dart';
import '../../../debug/logger.dart';

class RoomParticipants extends StatelessWidget {
const RoomParticipants({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import '../../context/media_device_context.dart';
import '../../context/room_context.dart';
import '../../../context/media_device_context.dart';
import '../../../context/room_context.dart';

class ScreenShareToggle extends StatelessWidget {
const ScreenShareToggle({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import 'package:flutter/material.dart';
import 'package:livekit_client/livekit_client.dart';
import 'package:provider/provider.dart';

import '../../context/participant_context.dart';
import '../../debug/logger.dart';
import '../../../context/participant_context.dart';
import '../../../debug/logger.dart';

class ConnectionQualityIndicator extends StatelessWidget {
const ConnectionQualityIndicator({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import '../../context/participant_context.dart';
import '../../debug/logger.dart';
import '../../../context/participant_context.dart';
import '../../../debug/logger.dart';

class E2EEncryptionIndicator extends StatelessWidget {
const E2EEncryptionIndicator({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import '../../context/participant_context.dart';
import '../../context/track_reference_context.dart';
import '../../debug/logger.dart';
import '../../../context/participant_context.dart';
import '../../../context/track_reference_context.dart';
import '../../../debug/logger.dart';

class IsSpeakingIndicator extends StatelessWidget {
const IsSpeakingIndicator({
Expand Down
Loading

0 comments on commit df651f6

Please sign in to comment.