opatech_clearsale_flutter 2.0.0 copy "opatech_clearsale_flutter: ^2.0.0" to clipboard
opatech_clearsale_flutter: ^2.0.0 copied to clipboard

A flutter plugin to integrate clearsale behaviour android and ios.

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:opatech_clearsale_flutter/opatech_clearsale_flutter.dart';

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

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

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';

  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    String sessionId;
    // Platform messages may fail, so we use a try/catch PlatformException.
    try {
      await OpatechClearsaleFlutter.config(
          "INSERIR O FINGERPRINT DA CLEARSELE"); // fingerprint id
      sessionId = await OpatechClearsaleFlutter.sessionId;
    } on PlatformException catch (e) {
      sessionId = 'Failed. ${e.message}';
    }

    try {
      await OpatechClearsaleFlutter.config(
          "INSERIR O FINGERPRINT DA CLEARSELE"); // fingerprint id
      sessionId += '\n' + await OpatechClearsaleFlutter.sessionId;
    } on PlatformException catch (e) {
      sessionId += '\n' + 'Failed. ${e.message}';
    }

    try {
      await OpatechClearsaleFlutter.config(
          "INSERIR O FINGERPRINT DA CLEARSELE"); // fingerprint id
      sessionId += '\n' + await OpatechClearsaleFlutter.sessionId;
    } on PlatformException catch (e) {
      sessionId += '\n' + 'Failed. ${e.message}';
    }

    if (!mounted) return;

    setState(() {
      _platformVersion = sessionId;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Session Id: $_platformVersion\n'),
        ),
      ),
    );
  }
}
2
likes
130
points
4
downloads

Publisher

verified publishersuperopa.com

Weekly Downloads

A flutter plugin to integrate clearsale behaviour android and ios.

Homepage

Documentation

API reference

License

unknown (license)

Dependencies

flutter

More

Packages that depend on opatech_clearsale_flutter

Packages that implement opatech_clearsale_flutter