lemnisk_flutter 1.0.0 copy "lemnisk_flutter: ^1.0.0" to clipboard
lemnisk_flutter: ^1.0.0 copied to clipboard

The Lemnisk Flutter Plugin allows you to track user event data from your Android or IOS app. The Plugin can be easily imported into any Android or iOS app. Based on the data it receives from the user [...]

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:lemnisk_flutter/flutter_wrapper_method_channel.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: MyButtonScreen(),
    );
  }
}

class MyButtonScreen extends StatefulWidget {
  @override
  _MyButtonScreenState createState() => _MyButtonScreenState();
}

class _MyButtonScreenState extends State<MyButtonScreen> {

  void _trackEvent() async {
    await LemniskFlutter.track("testEvent", {
      "eventType": 'product-click',
      "category": 'loans',
      "subCategory": 'personal-loan',
    }, {});
  }

  void _screenEvent() async {
    await LemniskFlutter.screen("Home Page", {
      "pageType": 'personal-loan-product',
      "category": 'loans',
      "subCategory": 'personal-loan',
    }, {});
  }

  void _identifyEvent() async {
    await LemniskFlutter.identify("27te87test", {
      "name": 'test',
      "Email": 'test@test.com',
      "Phone": '1234567890',
    }, {});
  }

  void _registerForPush() async {
    await LemniskFlutter.registerForPushNotifications(null, null);
  }

  void _createLemniskEvent() async {
    await LemniskFlutter.createLemniskEvent("test event", {
      "pageType": 'personal-loan-product',
      "category": 'loans',
      "subCategory": 'personal-loan'
    });
  }


  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Lemnisk Tracking and Push Testing Example'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            ElevatedButton(
              onPressed: _trackEvent,
              child: Text('Track Event'),
            ),
            SizedBox(height: 16),
            ElevatedButton(
              onPressed: _screenEvent,
              child: Text('Screen Event'),
            ),
            SizedBox(height: 16),
            ElevatedButton(
              onPressed: _identifyEvent,
              child: Text('Identify Event'),
            ),
            SizedBox(height: 16),
            ElevatedButton(
              onPressed: _registerForPush,
              child: Text('Register For Push'),
            ),
            SizedBox(height: 16),
            ElevatedButton(
              onPressed: _createLemniskEvent,
              child: Text('Create Event'),
            ),
            SizedBox(height: 16),
          ],
        ),
      ),
    );
  }
}
0
likes
0
pub points
77%
popularity

Publisher

verified publisherlemnisk.co

The Lemnisk Flutter Plugin allows you to track user event data from your Android or IOS app. The Plugin can be easily imported into any Android or iOS app. Based on the data it receives from the user activity, it sends real-time personalized push notifications to the users about the services and products that our clients provide.

License

unknown (LICENSE)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on lemnisk_flutter