medea_flutter_webrtc 0.8.0-dev+rev.6749e566134dd8a11e0080b7cc1fabcfcad6e6f3 copy "medea_flutter_webrtc: ^0.8.0-dev+rev.6749e566134dd8a11e0080b7cc1fabcfcad6e6f3" to clipboard
medea_flutter_webrtc: ^0.8.0-dev+rev.6749e566134dd8a11e0080b7cc1fabcfcad6e6f3 copied to clipboard

retractedoutdated

Flutter WebRTC plugin for iOS/Android/Desktop/Web, based on GoogleWebRTC.

example/lib/main.dart

import 'dart:core';

import 'package:flutter/material.dart';

import 'src/create_peer_connection.dart';
import 'src/get_display_media.dart';
import 'src/get_sources.dart';
import 'src/get_user_media.dart'
    if (dart.library.html) 'src/get_user_media_sample_web.dart';
import 'src/loopback.dart';
import 'src/on_device_change.dart';
import 'src/route_item.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  late List<RouteItem> items;

  @override
  void initState() {
    super.initState();
    _initItems();
  }

  ListBody _buildRow(context, item) {
    return ListBody(children: <Widget>[
      ListTile(
        title: Text(item.title),
        onTap: () => item.push(context),
        trailing: const Icon(Icons.arrow_right),
      ),
      const Divider()
    ]);
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
          appBar: AppBar(
            title: const Text('Flutter-WebRTC example'),
          ),
          body: ListView.builder(
              shrinkWrap: true,
              padding: const EdgeInsets.all(0.0),
              itemCount: items.length,
              itemBuilder: (context, i) {
                return _buildRow(context, items[i]);
              })),
    );
  }

  void _initItems() {
    items = <RouteItem>[
      RouteItem(
          title: 'GetUserMedia',
          push: (BuildContext context) {
            Navigator.push(
                context,
                MaterialPageRoute(
                    builder: (BuildContext context) =>
                        const GetUserMediaSample()));
          }),
      RouteItem(
          title: 'GetDisplayMedia',
          push: (BuildContext context) {
            Navigator.push(
                context,
                MaterialPageRoute(
                    builder: (BuildContext context) =>
                        const GetDisplayMediaSample()));
          }),
      RouteItem(
          title: 'LoopBack Sample',
          push: (BuildContext context) {
            Navigator.push(
                context,
                MaterialPageRoute(
                    builder: (BuildContext context) => const Loopback()));
          }),
      RouteItem(
          title: 'getSources',
          push: (BuildContext context) {
            Navigator.push(
                context,
                MaterialPageRoute(
                    builder: (BuildContext context) =>
                        const GetSourcesSample()));
          }),
      RouteItem(
          title: 'Basic RtcPeerConnection',
          push: (BuildContext context) {
            Navigator.push(
                context,
                MaterialPageRoute(
                    builder: (BuildContext context) =>
                        const PeerConnectionSample()));
          }),
      RouteItem(
          title: 'onDeviceChange notifier',
          push: (BuildContext context) {
            Navigator.push(
                context,
                MaterialPageRoute(
                    builder: (BuildContext context) =>
                        const OnDeviceChangeNotifierSample()));
          }),
    ];
  }
}
10
likes
0
pub points
64%
popularity

Publisher

verified publisherinstrumentisto.com

Flutter WebRTC plugin for iOS/Android/Desktop/Web, based on GoogleWebRTC.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_rust_bridge, freezed_annotation

More

Packages that depend on medea_flutter_webrtc