flulm_auth 0.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 70

flulm_auth #

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.

0.1.0 #

  • Improve plugin information and add demo.

example/README.md

flulm_auth_example #

Demonstrates how to use the flulm_auth plugin.

Getting Started #

This project is a starting point for a Flutter application.

dependencies: #

flulm_auth: ^0.0.1

plugin used #

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");
                }
              });
            }),
      ),
    );
  }
}
 

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flulm_auth: ^0.1.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flulm_auth/flulm_auth.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
41
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
70
Learn more about scoring.

We analyzed this package on Oct 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/flulm_auth.dart.

Run flutter format to format lib/flulm_auth.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test