channel_io 0.0.5 copy "channel_io: ^0.0.5" to clipboard
channel_io: ^0.0.5 copied to clipboard

flutter plugin for channel io

example/lib/main.dart

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

import 'package:channel_io/channel_io.dart';

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

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

class _MyAppState extends State<MyApp> {
  final _channelIO = ChannelIO();

  bool _isBooted = false;

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

  Future<void> initPlatformState() async {
    // Boot ChannelIO
    await _channelIO.boot(
      pluginKey: "CHANNEL_IO_PLUGIN_KEY",
      profile: Profile(name: "GwonHyeok", email: "me@ghyeok.io"),
    );

    setState(() {
      _isBooted = true;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('ChannelIO example app'),
        ),
        body: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: [
            Center(child: Text('ChannelIO is booted : $_isBooted')),
            Padding(
              padding:
                  const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8),
              child: Wrap(
                children: [
                  RaisedButton(
                    child: Text('show'),
                    onPressed: () {
                      _channelIO.show();
                    },
                  ),
                  RaisedButton(
                    child: Text('hide'),
                    onPressed: () {
                      _channelIO.hide();
                    },
                  ),
                  RaisedButton(
                    child: Text('open'),
                    onPressed: () {
                      _channelIO.open();
                    },
                  )
                ],
              ),
            )
          ],
        ),
      ),
    );
  }
}
1
likes
30
pub points
0%
popularity

Publisher

unverified uploader

flutter plugin for channel io

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on channel_io