代码拉取完成,页面将自动刷新
阿里百川旗舰版插件
为买什么都省app提供淘宝授权、登录、跳转等功能
目前暂未发布到pub,所以使用本地依赖package模式
pubspec.yaml
文件中添加dependencies:
...
alibc_plugin:
path: ../alibc_plugin/
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打开淘宝')),
],
)),
);
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。