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

outdated

The version of the flutter SDK licensed by lemapay is currently only available for the Android system, to be added to the iOS system call.

example/lib/main.dart

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 = "申请的key";

  @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
20%
popularity

Publisher

unverified uploader

The version of the flutter SDK licensed by lemapay is currently only available for the Android system, to be added to the iOS system call.

Homepage

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flulm_auth