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

The Lemnisk Flutter Wrapper 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 t [...]

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_wrapper/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 MethodChannelFlutterWrapper.track("testEvent", {
      "eventType": 'product-click',
      "category": 'loans',
      "subCategory": 'personal-loan',
    }, {});
  }

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

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

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

  void _createLemniskEvent() async {
    await MethodChannelFlutterWrapper.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),
          ],
        ),
      ),
    );
  }
}
1
likes
110
pub points
0%
popularity

Publisher

verified publisherlemnisk.co

The Lemnisk Flutter Wrapper 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.

Documentation

API reference

License

unknown (LICENSE)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on flutter_wrapper