easy_agora_uikit 0.0.1 copy "easy_agora_uikit: ^0.0.1" to clipboard
easy_agora_uikit: ^0.0.1 copied to clipboard

outdated

agora made simple

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);
  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      /*
      create two buttons and call VideoCall with separate properties
       */
      body: SafeArea(
        child: Center(
          child: Column(
            children: [
              FloatingActionButton(
                child: const Text("Open Front Camera"),
                onPressed: () {
                  Navigator.push(
                    context,
                    MaterialPageRoute(
                      builder: (context) => 
                      VideoCall(
                        serverLink:
                            "https://agora-node-tokenserver.davidcaleb.repl.co/access_token?channelName",
                        channelName: "test",
                        appID: "63a29f76b5704dd0bf01316fc9f8f736",
                      ),
                    ),
                  );
                },
              ),
              FloatingActionButton(
                onPressed: () {
                  Navigator.push(
                    context,
                    MaterialPageRoute(
                      builder: (context) => VideoCallRear(
                        serverLink:
                            "https://agora-node-tokenserver.davidcaleb.repl.co/access_token?channelName",
                        channelName: "test",
                        appID: "63a29f76b5704dd0bf01316fc9f8f736",
                      ),
                    ),
                  );
                },
                child: const Text("Open Rear Camera"),
              ),
            ],
          ),
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
    );
  }
}
3
likes
0
points
48
downloads

Publisher

unverified uploader

Weekly Downloads

agora made simple

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

agora_uikit, flutter, http

More

Packages that depend on easy_agora_uikit