transmedika_one_to_one_call 1.0.35 copy "transmedika_one_to_one_call: ^1.0.35" to clipboard
transmedika_one_to_one_call: ^1.0.35 copied to clipboard

Package video call dari Transmedika ini merupakan libary yang digunakan untuk developer untuk memudahkan memanggil fungsi video call dari dokter ke pasien transmedika

example/lib/main.dart

import 'dart:io';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:transmedika_one_to_one_call/webrtc/one_to_one_page.dart';


class MyHttpOverrides extends HttpOverrides {
  @override
  HttpClient createHttpClient(SecurityContext? context){
    return super.createHttpClient(context)
      ..badCertificateCallback = (X509Certificate cert, String host, int port)=> true;
  }
}

void main() {
  HttpOverrides.global = MyHttpOverrides();
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}): super(key: key);
  @override
  Widget build(BuildContext context) {

    const urlWebSocket = "";

    const iceServers = {
      'iceServers': [
        {
          'url': '',
        },
        {
          'url': '',
        },
        {
          'url': '',
        },
        {
          'url': '',
        },
        {
          'url': '',
        }
      ]
    };

    final mySelf = {
      'email': "maman@rskp.com",
      'name': 'TN, MAMAN',
      'uuid': '7bfb1588-fc6a-4878-a96f-126cd6a6692c',
      'profilePicture': 'https://upload.wikimedia.org/wikipedia/commons/0/04/Elon_Musk_and_Hans_Koenigsmann_at_the_SpaceX_CRS-8_post-launch_press_conference_%2826223624532%29_%28cropped%29.jpg',
      'token': 'xxxxxxxxxxxx'
    };

    final other = {
      'email': "dion@rskp.com",
      'name': 'dr. Dionisius Panji Wijanarko, Sp.B',
      'uuid': '42c6145f-8143-4d67-ad30-6f84571e0f65',
      'profilePicture': 'https://upload.wikimedia.org/wikipedia/commons/thumb/5/56/Donald_Trump_official_portrait.jpg/710px-Donald_Trump_official_portrait.jpg',
    };

    String consultationId = '224';

    /// Fcm token bisa kamu dapat dari request GET ke endpoint ini auth/check-device-id-multiple,
    /// Fcm token hanya digunakan jika kamu ingin menelepon saja, jadi optional
    /// OneToOneScreen(
    ///    mySelf: mySelf,
    ///    other: other,
    ///    consultationId: consultationId,
    ///    fcmTokens: fcmTokens
    ///  )
    List<String> fcmTokens = ['fYSu5ILSvcKFUwyPRo--kl:APA91bF7c3EVBX7jvGvhQZrFC-Y2t83sjZ79gljq03WE9finRILE608KHAZkrX0MRIjAZL2Fi2Cvy1orZY8C9sgNfTH_eHWJl0X7quGSyusbTDaCnwVtGuwT22H3PbQwhaPmAXgqX6Oq'];


    /// untuk menerima panggilan kamu cukup isi paramter construktor
    /// OneToOneScreen(
    ///    mySelf: mySelf,
    ///    other: other,
    ///    consultationId: consultationId
    ///  )
    /// untuk menerima panggilan mekanismenya aplikasi kamu akan menerima notifikasi, data myself, other, consultationId bisa kamu dapatkan
    /// dari data yang dikirim lewat notifikasi


    return MaterialApp(
        title: 'Flutter Demo',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: kIsWeb ? OneToOneScreen(
          mySelf: mySelf,
          other: other,
          consultationId: consultationId,
          fcmTokens: fcmTokens,
          urlWebSocket: urlWebSocket,
          iceServers: iceServers,
          onMessage: (message){
            ///put your toast or widget for display message
          },
        ) : OneToOneScreen(
          mySelf: other,
          other: mySelf,
          consultationId: consultationId,
          urlWebSocket: urlWebSocket,
          iceServers: iceServers,
          onMessage: (message){
            ///put your toast or widget for display message
          },
        )
    );
  }
}
2
likes
100
pub points
3%
popularity

Publisher

unverified uploader

Package video call dari Transmedika ini merupakan libary yang digunakan untuk developer untuk memudahkan memanggil fungsi video call dari dokter ke pasien transmedika

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (LICENSE)

Dependencies

bloc_concurrency, cached_network_image, cupertino_icons, equatable, flutter, flutter_bloc, flutter_webrtc, intl, stream_transform, web_socket_channel

More

Packages that depend on transmedika_one_to_one_call