event_tracker 0.0.4 event_tracker: ^0.0.4 copied to clipboard
The Lemnisk Flutter SDK allows you to track user event data from your Android app. The SDK can be easily imported into any Android or iOS app. Based on the data it receives from the user activity, it [...]
import 'package:event_tracker/LemniskFlutterTrack.dart';
import 'package:event_tracker/model/TrackBulider.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
track();
}
void track() {
TrackBulider trackBulider = TrackBulider();
//you can pass here track related properties in trackbuilder map
trackBulider.properties['properties'] = 'material';
trackBulider.properties['button'] = 'Track event from different app';
//you can pass here track id
OtherID otherID = OtherID();
otherID.trackId['trackerId'] = '6791c47a-0178-47bc-8711-86a2c67b2255';
//now you call LemniskFlutterTrack class and its static track() function and pass all parameters write key and server url not mandatory
LemniskFlutterTrack.track("MainDartFile", "http://serverurl.in", "witeKey", trackBulider, otherID);
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Lemnisk Flutter SDK'),
),
body: Center(
child: SingleChildScrollView(
child: Column(
children: [
Column(
children: [
Text('Hello world'),
],
),
],
),
),
),
),
);
}
}