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

outdated

A auth for lemapay.

flulm_auth #

A auth for lemapay for android.

Getting Started #

import 'package:flulm_auth/flulm_auth.dart' as flulmAuth;
import 'package:flutter/material.dart';

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

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

class _MyAppState extends State<MyApp> {
  String _code = 'Unknown';
  String _appId = "666";

  @override
  void initState() {
    super.initState();
    flulmAuth.register(appId: _appId);
    flulmAuth.responseFromAuth.listen((data) {
      setState(() {
        _code = data.code;
      });
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('callback code= $_code\n'),
        ),
        floatingActionButton: FloatingActionButton(
            child: Icon(Icons.add),
            onPressed: () {
              flulmAuth.isLemaPayInstalled().then((install) {
                if (install) {
                  flulmAuth.isLemaPaySupportAPI().then((version) {
                    if (version <= 1) {
                      print("当前乐马国际App版本较低,请升级后再操作。");
                    } else {
                      flulmAuth.sendAuth(scope: "login");
                    }
                  });
                } else {
                  print("没有安装乐马国际App");
                }
              });
            }),
      ),
    );
  }
}
 
2
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A auth for lemapay.

Homepage

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flulm_auth