flutterjanus 0.0.2 copy "flutterjanus: ^0.0.2" to clipboard
flutterjanus: ^0.0.2 copied to clipboard

outdated

Flutter plugin for Janus Gateway. Janus Gateway project provides janus.js a javascript library which encapsulates all the callbacks for janus. Janus.js make things simple and the application needs to [...]

example/lib/main.dart

import 'dart:core';

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

import 'src/api_test/api_test_menu.dart';
import 'src/route_item.dart';
import 'src/janus_demo/janus_demo_menu.dart';

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

enum DialogDemoAction {
  cancel,
  connect,
}

class _MyAppState extends State<MyApp> {
  List<RouteItem> items;
  // SharedPreferences _prefs;

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

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

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

  _initItems() {
    items = <RouteItem>[
      RouteItem(
          title: 'API Tests',
          subtitle: 'API Tests.',
          push: (BuildContext context) {
            Navigator.push(
                context,
                new MaterialPageRoute(
                    builder: (BuildContext context) => new ApiTestMenu()));
          }),
      RouteItem(
          title: 'Janus Demos',
          subtitle: 'Janus Demos.',
          push: (BuildContext context) {
            Navigator.push(
                context,
                new MaterialPageRoute(
                    builder: (BuildContext context) => new JanusDemoMenu()));
          }),
    ];
  }
}
5
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Flutter plugin for Janus Gateway. Janus Gateway project provides janus.js a javascript library which encapsulates all the callbacks for janus. Janus.js make things simple and the application needs to be written on top of janus.js. FlutterJanus is a port of janus.js in flutter, the functionality of janus.js is reproduced in flutterjanus.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_webrtc, http, logger, random_string, sdp_transform, web_socket_channel

More

Packages that depend on flutterjanus