iot_notification 0.3.18 copy "iot_notification: ^0.3.18" to clipboard
iot_notification: ^0.3.18 copied to clipboard

outdated

A new Flutter plugin.

example/lib/main.dart

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

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

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

class _MyAppState extends State<MyApp> {
  String cafile = '''your-certificate-here''';

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Iot Notification Example'),
        ),
        body: Center(
            child: Column(children: <Widget>[
          RaisedButton(
              child: Text("Start Service"),
              onPressed: () {
                IotNotification.startService(
                    "id",
                    "id",
                    "id",
                    "id",
                    "ini-id-hanya-untuk-testing-mqtt-bos",
                    "iot.samelement.com",
                    "ssl",
                    8883,
                    "https://iot.samelement.com",
                    cafile);
              }),
          RaisedButton(
              child: Text("Scan Barcode"),
              onPressed: () async {
                String result = await IotNotification.scan();
                print("QR CODE $result");
              }),
          RaisedButton(
              child: Text("Get Keys"),
              onPressed: () async {
                List<String> keys = await IotNotification.getKeys();
                print(keys[0]);
                print(keys[1]);
              }),
          RaisedButton(
              child: Text("Stop service"),
              onPressed: () async {
                IotNotification.stopService();
              })
        ])),
      ),
    );
  }
}
0
likes
0
points
35
downloads

Publisher

unverified uploader

Weekly Downloads

A new Flutter plugin.

Homepage

License

unknown (license)

Dependencies

flutter

More

Packages that depend on iot_notification