Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created a example app for hms_room_kit package #1613

Merged
merged 12 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions packages/hms_room_kit/example/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@

# HMSROOMKIT Example App 🚀


This contains a sample application built using `hms_room_kit`
Steps to get on local machine=
1. Clone the hms_flutter_sdk
2. Cd inside the hms_room_kit package.
3. Cd inside the example directory.
4. Run the main file.

Clone the Example app provided in the repo here.

The "example" folder contains code relevant to the Example app.

The Example application contains the implementation of hms_room_kit.



For more clear understanding refer these-
https://www.100ms.live/docs/flutter/v2/quickstart/prebuilt


To Change the Join With Mute or UnMute or other settings refer;
"packages\hms_room_kit\lib\src\service\app_debug_config.dart"


Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
package="com.example.sample_application">

<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.INTERNET" />

<application
android:label="sample_application"
Expand All @@ -15,7 +16,9 @@
android:supportsPictureInPicture="true"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize"

>
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
Expand All @@ -24,6 +27,7 @@
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>

<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down
64 changes: 3 additions & 61 deletions packages/hms_room_kit/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:hms_room_kit/hms_room_kit.dart';
import 'package:sample_application/presentation/features/home/home_main_view.dart';

void main() {
runApp(const MyApp());
Expand All @@ -17,7 +18,7 @@ class MyApp extends StatelessWidget {
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(),
home: const HomeMainView(),
themeMode: ThemeMode.dark,
darkTheme: ThemeData(
bottomSheetTheme: BottomSheetThemeData(
Expand All @@ -26,65 +27,6 @@ class MyApp extends StatelessWidget {
primaryColor: const Color.fromARGB(255, 13, 107, 184),
scaffoldBackgroundColor: Colors.black),
);
}
}

class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});

@override
State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
TextEditingController meetingLinkController = TextEditingController();
TextEditingController nameController = TextEditingController();

@override
Widget build(BuildContext context) {
double width = MediaQuery.of(context).size.width;
return SafeArea(
child: Scaffold(
body: Center(
child: SingleChildScrollView(
child: Column(
children: [
SvgPicture.asset(
'assets/welcome.svg',
width: width * 0.95,
),
const SizedBox(
height: 20,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 18),
child: Text('Experience the power of 100ms',
textAlign: TextAlign.center,
style: GoogleFonts.inter(
letterSpacing: 0.25,
color: themeDefaultColor,
height: 1.17,
fontSize: 34,
fontWeight: FontWeight.w600)),
),
const SizedBox(
height: 8,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 27),
child: Text('Try out the HMS Prebuilt SDK',
textAlign: TextAlign.center,
style: GoogleFonts.inter(
letterSpacing: 0.5,
color: themeSubHeadingColor,
height: 1.5,
fontSize: 16,
fontWeight: FontWeight.w400)),
),
],
),
),
)),
);
}
}

vinayakbot marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@


import 'package:flutter/material.dart';
import 'package:hms_room_kit/hms_room_kit.dart';

class DashboardMainView extends StatefulWidget {
final String roomCode;
final String? userName;
const DashboardMainView({super.key , required this.roomCode , this.userName });


@override
State<DashboardMainView> createState() => _DashboardMainViewState();
}

class _DashboardMainViewState extends State<DashboardMainView> {

late String userName;
late HMSPrebuiltOptions _options;



@override
void initState() {
userName = widget.userName ?? '';

_options = HMSPrebuiltOptions(

////for prefill the name of the user in previewBuilt
userName: userName,

);
// TODO: implement initState
super.initState();
}

@override
Widget build(BuildContext context) {
return HMSPrebuilt(

options: _options,
roomCode: widget.roomCode ,
onLeave: (){

/////onLeave do cleanup or any other task
},

);
}
}
Loading