1 Star 2 Fork 0

franky / alibc_plugin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

alibc_plugin

阿里百川旗舰版插件

说明

为买什么都省app提供淘宝授权、登录、跳转等功能

使用

目前暂未发布到pub,所以使用本地依赖package模式

step

    1. 下载插件让插件与主项目在同一目录下
    1. 在项目pubspec.yaml文件中添加
dependencies:
  ...
  
  alibc_plugin:
    path: ../alibc_plugin/
    1. 使用
import 'package:alibc_plugin/alibc_plugin.dart';
import 'package:flutter/material.dart';

class MePage extends StatefulWidget {
  const MePage({Key? key}) : super(key: key);

  @override
  MePageState createState() => MePageState();
}

class MePageState extends State<MePage> {

  final _alibcPlugin = AlibcPlugin();

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

  void authLogin() async {
    await _alibcPlugin.authLogin();
  }

  void openTbByUrl() async {
    var result = await _alibcPlugin.launcherTbByUrl("https://m.tb.cn/h.fEytOTf?tk=xOGv2LIlQRT");
    debugPrint('openTbByUrl:$result');
  }

  void openTbByCode() async {
    var result = await _alibcPlugin.launcherTbByCode("0", "0", "0", "0","0","0");
    debugPrint('openTbByCode:$result');
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        elevation: 0,
        centerTitle: true,
        title: Text(
          '我的',
          style: TextStyle(
              color: Theme.of(context).brightness.name == 'dark'
                  ? Colors.white
                  : Colors.black87),
        ),
        backgroundColor: Theme.of(context).brightness.name == 'dark'
            ? Colors.black.withOpacity(0)
            : Colors.white.withOpacity(0),
      ),
      body: Center(child: Column(
        children: [
          TextButton(onPressed: authLogin, child: Text('淘宝授权登录')),
          TextButton(onPressed: openTbByUrl, child: Text('url打开淘宝')),
          TextButton(onPressed: openTbByCode, child: Text('code打开淘宝')),
        ],
      )),
    );
  }
}

空文件

简介

flutter阿里百川旗舰版SDK plugin,支持Android和iOS 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/franky_lee/alibc_plugin.git
git@gitee.com:franky_lee/alibc_plugin.git
franky_lee
alibc_plugin
alibc_plugin
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891