leanplum_flutter 0.0.3
leanplum_flutter: ^0.0.3

Flutter Android iOS

A flutter plugin for the Leanplum SDK - https://www.leanplum.com

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:leanplum_flutter/leanplum_flutter.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    initSDK();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initSDK() async {
    LeanplumFlutter.setDeviceId('yourCustomDeviceId');
    LeanplumFlutter.start(userId: '12345');
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Leanplun SDK'),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: () {
            LeanplumFlutter.setAppVersion('1.0');
            LeanplumFlutter.setUserId('122121');
            },
          child: Icon(Icons.star),
          backgroundColor: Colors.green,
        ),
      ),
    );
  }
}
4
likes
90
pub points
0%
popularity

A flutter plugin for the Leanplum SDK - https://www.leanplum.com

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

xdrchakalx@gmail.com

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on leanplum_flutter