indigitall_flutter_plugin 0.1.1 copy "indigitall_flutter_plugin: ^0.1.1" to clipboard
indigitall_flutter_plugin: ^0.1.1 copied to clipboard

outdated

indigitall flutter plugin

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:indigitall_flutter_plugin/core/utils/IndigitallParams.dart';
import 'package:indigitall_flutter_plugin/indigitall_flutter_plugin.dart';

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

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

class _MyAppState extends State<MyApp> {
  String? _deviceId = 'Unknown';

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

    Map params = {
      IndigitallParams.PARAM_APP_KEY : "YOUR_APP_KEY",
      IndigitallParams.PARAM_SENDER_ID : "YOUR_SENDER_ID",
      IndigitallParams.PARAM_REQUEST_LOCATION : true,
      IndigitallParams.PARAM_WIFI_FILTER_ENABLED : true,
      IndigitallParams.PARAM_LOG_DEBUG : false
    };

    IndigitallFlutterPlugin.init(params, (device) => {
      print("init device "+ device.deviceId.toString()),
      _deviceId = device.deviceId,
    }, (device) => {
      print("init onnew device "+ device.deviceId.toString()),
      _deviceId = device.deviceId,
    }, (error) => {
      print("error init device "+ error.errorMessage.toString())
    });

  }


  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Device Id: $_deviceId\n'),
        ),
      ),
    );
  }
}