Skip to content

Commit

Permalink
format files using dart format
Browse files Browse the repository at this point in the history
  • Loading branch information
gabiborlea committed Aug 25, 2023
1 parent ef178bf commit 8edfc33
Show file tree
Hide file tree
Showing 13 changed files with 205 additions and 218 deletions.
1 change: 0 additions & 1 deletion example/integration_test/plugin_integration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// For more information about Flutter integration tests, please see
// https://docs.flutter.dev/cookbook/testing/integration/introduction


import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';

Expand Down
161 changes: 68 additions & 93 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import 'package:flutter/material.dart';

import 'package:jitsi_meet_flutter_sdk/jitsi_meet_flutter_sdk.dart';
Expand All @@ -21,13 +20,13 @@ class _MyAppState extends State<MyApp> {
List<String> participants = [];
final _jitsiMeetPlugin = JitsiMeet();

join() async{
join() async {
var options = JitsiMeetConferenceOptions(
room: "testgabigabi",
configOverrides: {
"startWithAudioMuted": false,
"startWithVideoMuted": false,
"subject" : "Lipitori"
"subject": "Lipitori"
},
featureFlags: {
"unsaferoomwarning.enabled": false,
Expand All @@ -36,71 +35,57 @@ class _MyAppState extends State<MyApp> {
userInfo: JitsiMeetUserInfo(
displayName: "Gabi",
email: "[email protected]",
avatar: "https://avatars.githubusercontent.com/u/57035818?s=400&u=02572f10fe61bca6fc20426548f3920d53f79693&v=4"
),
avatar:
"https://avatars.githubusercontent.com/u/57035818?s=400&u=02572f10fe61bca6fc20426548f3920d53f79693&v=4"),
);

var listener = JitsiMeetEventListener(
conferenceJoined: (url) {
debugPrint("conferenceJoined: url: $url");
},

conferenceTerminated: (url, error) {
debugPrint("conferenceTerminated: url: $url, error: $error");
},

conferenceWillJoin: (url) {
debugPrint("conferenceWillJoin: url: $url");
},

participantJoined: (email, name, role, participantId) {
debugPrint(
"participantJoined: email: $email, name: $name, role: $role, "
"participantId: $participantId",
"participantId: $participantId",
);
participants.add(participantId!);
},

participantLeft: (participantId) {
debugPrint("participantLeft: participantId: $participantId");
},

audioMutedChanged: (muted) {
debugPrint("audioMutedChanged: isMuted: $muted");
},

videoMutedChanged: (muted) {
debugPrint("videoMutedChanged: isMuted: $muted");
},

endpointTextMessageReceived: (senderId, message) {
debugPrint(
"endpointTextMessageReceived: senderId: $senderId, message: $message"
);
"endpointTextMessageReceived: senderId: $senderId, message: $message");
},

screenShareToggled: (participantId, sharing) {
debugPrint(
"screenShareToggled: participantId: $participantId, "
"isSharing: $sharing",
"isSharing: $sharing",
);
},

chatMessageReceived: (senderId, message, isPrivate, timestamp) {
debugPrint(
"chatMessageReceived: senderId: $senderId, message: $message, "
"isPrivate: $isPrivate, timestamp: $timestamp",
"isPrivate: $isPrivate, timestamp: $timestamp",
);
},

chatToggled: (isOpen) => debugPrint("chatToggled: isOpen: $isOpen"),

participantsInfoRetrieved: (participantsInfo) {
debugPrint(
"participantsInfoRetrieved: participantsInfo: $participantsInfo, "
);
"participantsInfoRetrieved: participantsInfo: $participantsInfo, ");
},

readyToClose: () {
debugPrint("readyToClose");
},
Expand All @@ -111,46 +96,47 @@ class _MyAppState extends State<MyApp> {
hangUp() async {
await _jitsiMeetPlugin.hangUp();
}
setAudioMuted(bool? muted) async{

setAudioMuted(bool? muted) async {
var a = await _jitsiMeetPlugin.setAudioMuted(muted!);
debugPrint("$a");
setState(() {
audioMuted = muted;
});
}

setVideoMuted(bool? muted) async{
setVideoMuted(bool? muted) async {
var a = await _jitsiMeetPlugin.setVideoMuted(muted!);
debugPrint("$a");
setState(() {
videoMuted = muted;
});
}

sendEndpointTextMessage() async{
sendEndpointTextMessage() async {
var a = await _jitsiMeetPlugin.sendEndpointTextMessage(message: "HEY");
debugPrint("$a");

for (var p in participants) {
var b = await _jitsiMeetPlugin.sendEndpointTextMessage(to: p, message: "HEY");
var b =
await _jitsiMeetPlugin.sendEndpointTextMessage(to: p, message: "HEY");
debugPrint("$b");
}
}

toggleScreenShare(bool? enabled) async{
toggleScreenShare(bool? enabled) async {
await _jitsiMeetPlugin.toggleScreenShare(enabled!);

setState(() {
screenShareOn = enabled;
});
}

openChat() async{
openChat() async {
await _jitsiMeetPlugin.openChat();
}

sendChatMessage() async{
sendChatMessage() async {
var a = await _jitsiMeetPlugin.sendChatMessage(message: "HEY1");
debugPrint("$a");

Expand All @@ -160,11 +146,11 @@ class _MyAppState extends State<MyApp> {
}
}

closeChat() async{
closeChat() async {
await _jitsiMeetPlugin.closeChat();
}

retrieveParticipantsInfo() async{
retrieveParticipantsInfo() async {
var a = await _jitsiMeetPlugin.retrieveParticipantsInfo();
debugPrint("$a");
}
Expand All @@ -173,65 +159,54 @@ class _MyAppState extends State<MyApp> {
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[

TextButton(
onPressed: join,
child: const Text("Join"),
),
TextButton(
onPressed: hangUp,
child: const Text("Hang Up")
),
Row(children: [
const Text("Set Audio Muted"),
Checkbox(
value: audioMuted,
onChanged: setAudioMuted,
),
]),
Row(children: [
const Text("Set Video Muted"),
Checkbox(
value: videoMuted,
onChanged: setVideoMuted,
),
]),
TextButton(
onPressed: sendEndpointTextMessage,
child: const Text("Send Hey Endpoint Message To All")
),
Row(children: [
const Text("Toggle Screen Share"),
Checkbox(
value: screenShareOn,
onChanged: toggleScreenShare,
),
]),
TextButton(
onPressed: openChat,
child: const Text("Open Chat")
),
TextButton(
onPressed: sendChatMessage,
child: const Text("Send Chat Message to All")
),
TextButton(
onPressed: closeChat,
child: const Text("Close Chat")
),

TextButton(
onPressed: retrieveParticipantsInfo,
child: const Text("Retrieve Participants Info")
),
]),
)),
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
TextButton(
onPressed: join,
child: const Text("Join"),
),
TextButton(onPressed: hangUp, child: const Text("Hang Up")),
Row(children: [
const Text("Set Audio Muted"),
Checkbox(
value: audioMuted,
onChanged: setAudioMuted,
),
]),
Row(children: [
const Text("Set Video Muted"),
Checkbox(
value: videoMuted,
onChanged: setVideoMuted,
),
]),
TextButton(
onPressed: sendEndpointTextMessage,
child: const Text("Send Hey Endpoint Message To All")),
Row(children: [
const Text("Toggle Screen Share"),
Checkbox(
value: screenShareOn,
onChanged: toggleScreenShare,
),
]),
TextButton(
onPressed: openChat, child: const Text("Open Chat")),
TextButton(
onPressed: sendChatMessage,
child: const Text("Send Chat Message to All")),
TextButton(
onPressed: closeChat, child: const Text("Close Chat")),
TextButton(
onPressed: retrieveParticipantsInfo,
child: const Text("Retrieve Participants Info")),
]),
)),
);
}
}
4 changes: 2 additions & 2 deletions example/test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ void main() {
// Verify that platform version is retrieved.
expect(
find.byWidgetPredicate(
(Widget widget) => widget is Text &&
widget.data!.startsWith('Running on:'),
(Widget widget) =>
widget is Text && widget.data!.startsWith('Running on:'),
),
findsOneWidget,
);
Expand Down
2 changes: 1 addition & 1 deletion lib/jitsi_meet_flutter_sdk.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export 'src/jitsi_meet.dart' show JitsiMeet;
export 'src/jitsi_meet_conference_options.dart' show JitsiMeetConferenceOptions;
export 'src/jitsi_meet_event_listener.dart' show JitsiMeetEventListener;
export 'src/jitsi_meet_user_info.dart' show JitsiMeetUserInfo;
export 'src/jitsi_meet_user_info.dart' show JitsiMeetUserInfo;
Loading

0 comments on commit 8edfc33

Please sign in to comment.