indigitall_flutter_plugin 2.19.4
indigitall_flutter_plugin: ^2.19.4 copied to clipboard
With the indigitall tool, you will be able to capture and communicate with the visitors of your website, the users of your app or your clients in general.
example/lib/main.dart
import 'package:flutter/material.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_URL_DEVICE_API:
"https://device-api.indigitall.com/v1",
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())});
Container _containerExample = Container(width: 550, height: 95);
IndigitallFlutterPlugin.showInAppWithConfig({
IndigitallParams.PARAM_INAPP_CODE: "YOUR_INAPP_CODE",
/*optionals params*/
IndigitallParams.PARAM_DOMAIN_INAPP: "URL_DOMAIN_INAPP",
IndigitallParams.PARAM_CLOSE_BUTTON: true,
IndigitallParams.PARAM_CLOSE_ICON_DISABLED: false,
IndigitallParams.PARAM_CLOSE_POPUP_WHEN_CLICKED: true,
IndigitallParams.PARAM_CUSTOM_TIME_SLIDE_FOR_CAROUSEL: 5000,
IndigitallParams.PARAM_INAPP_PROFILE: "YOOUR_PROFILE"
}, _containerExample, (inApp, action) {
print("InApp clicked action: ${action.url}");
print("InApp clicked: ${inApp.toMap()}");
}, (container, error) {
print("error didexpired: ${error.errorMessage}");
}, (inApp, error) {
print("error didShowManyTimes: ${error.errorMessage}");
}, (inApp, error) {
print("error didClickOut: ${error.errorMessage}");
}, (inApp, error) {
print("error dismissForever: ${error.errorMessage}");
}, (inApp, error) {
print("error didFormSubmit: ${error.errorMessage}");
}, (inApp, container) {
setState(() {
_containerExample = container;
print("InApp schema 2 loaded: ${inApp.inAppId}");
});
}, (error) {
print("InApp schema 2 error: ${error.errorMessage ?? "error general"}");
});
/// show popup
Map popUpParams = {
IndigitallParams.PARAM_INAPP_POPUP_CODE: "YOUR_SCHEMA_CODE",
/*optionals params*/
IndigitallParams.PARAM_DOMAIN_INAPP: "URL_DOMAIN_INAPP",
IndigitallParams.PARAM_CLOSE_BUTTON: true,
IndigitallParams.PARAM_CLOSE_ICON_DISABLED: false,
IndigitallParams.PARAM_CLOSE_POPUP_WHEN_CLICKED: true,
IndigitallParams.PARAM_CUSTOM_TIME_SLIDE_FOR_CAROUSEL: 5000,
IndigitallParams.PARAM_INAPP_PROFILE: "YOUR_PROFILE"
};
// IndigitallFlutterPlugin.showPopUp(popUpParams, (inApp) => {
// print("on Success inApp: ${inApp.toMap()}"),
// }, (error) => {
// print(error.errorMessage ?? "General error")
// });
IndigitallFlutterPlugin.showPopUpWithParams(
popUpParams,
(inApp) => {
print("on Success inApp: ${inApp.toMap()}"),
},
(inApp, action) => {
print(
"on didClicked action: ${action?.toMap()} inApp: ${inApp.toMap()}"),
},
() => {print("did closed")},
() => {print("didDismissed")},
() => {print("onShowTimeFinished")},
(inApp, error) => {
print(
"didClickOut inApp: ${inApp.inAppId} error: ${error.errorDescription}")
},
(inApp, error) => {
print(
"didShowManyTimes inApp: ${inApp.inAppId} error: ${error.errorDescription}")
},
(inApp, error) => {
print(
"didDismissForever inApp: ${inApp.inAppId} error: ${error.errorDescription}")
},
(inApp) => {print("didFormSubmit inApp: ${inApp.inAppId}")},
(error) => {print("didFormError: ${error.errorDescription}")},
(error) => {print(error.errorMessage ?? "General error")});
}
@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'),
),
),
);
}
}