leanplum_flutter 0.0.1 copy "leanplum_flutter: ^0.0.1" to clipboard
leanplum_flutter: ^0.0.1 copied to clipboard

outdated

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
0
pub points
0%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on leanplum_flutter