# ali_auth **Repository Path**: john_tp/Flutter-ali_auth ## Basic Information - **Project Name**: ali_auth - **Description**: 一个实现支付宝授权功能的flutter插件 - **Primary Language**: Dart - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-07-31 - **Last Updated**: 2022-09-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ali_auth A new Flutter plugin 支付宝授权 ## Getting Started 1.导入插件-在pubspec.yaml中加入包,代码如下 ``` ali_auth: git: url: https://gitee.com/john_tp/flutter_plugin.git path: ali_auth ``` 执行 flutter pub get 命令更新插件包 2.Android配置修改-app下的build.gradle中,修改如下 ``` allprojects { repositories { google() mavenCentral() /**子模块含有aar:添加全局引用*/ flatDir { // 由于Flutter插件 module中引用了 aar, // 其他工程编译时会报错,所以需要在所有工程的repositories // 下把Library module中的libs目录添加到依赖关系中 dirs project(':ali_auth').file('libs') //注意:project后面是aar包的模块名 } maven { url 'https://maven.aliyun.com/nexus/content/repositories/releases/' } ... } } ``` ## 授权参数组成 代码示例中的 authInfo 根据商户的授权请求信息生成,详见[授权请求参数](https://opendocs.alipay.com/open/218/105327)或参考支付宝 SDK Demo中的实现。 ## 插件功能实现参考[完整版授权 SDK 调用方法](https://opendocs.alipay.com/open/218/105325) This project is a starting point for a Flutter [plug-in package](https://flutter.dev/developing-packages/), a specialized package that includes platform-specific implementation code for Android and/or iOS. For help getting started with Flutter, view our [online documentation](https://flutter.dev/docs), which offers tutorials, samples, guidance on mobile development, and a full API reference.