finbox_dc_plugin 0.0.5
finbox_dc_plugin: ^0.0.5 copied to clipboard
Device Connect Flutter SDK is used to collect anonymised non-PII data from the devices of the users after taking explicit user consent
example/lib/main.dart
import 'package:finbox_dc_plugin/finbox_dc_plugin.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: HomePage(),
);
}
}
class HomePage extends StatelessWidget {
String _deviceConnectValue = "";
static String customerId = 'customer_id';
static String apiKey = 'api_key';
Future _createUser() async {
try {
_deviceConnectValue = await FinBoxDcPlugin.createUser(apiKey, customerId);
} on PlatformException catch (e) {
_deviceConnectValue = 'Failed to fetch data';
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Sample"),
),
body: Center(
child: RaisedButton(
onPressed: _createUser,
child: Text("Load DeviceConnect"),
),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
}