Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
mafanwei authored Mar 4, 2022
2 parents 6e07c71 + 8039525 commit 75dc809
Show file tree
Hide file tree
Showing 37 changed files with 1,591 additions and 1,490 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Unreleased
# 3.7.0
* Fix #453

# 3.6.1+4
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright [2020] [OpenFlutter]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build status](https://img.shields.io/cirrus/github/OpenFlutter/fluwx/master)](https://cirrus-ci.com/github/OpenFlutter/fluwx)
======

![logo](https://gitee.com/OpenFlutter/resoures-repository/blob/master/fluwx/fluwx_logo.png)
![logo](https://gitee.com/OpenFlutter/resoures-repository/raw/master/fluwx/fluwx_logo.png)

[中文请移步此处](./README_CN.md)

Expand Down
232 changes: 124 additions & 108 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,26 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:fluwx/fluwx.dart';

import 'auth_by_qr_code_page.dart';
import 'launch_mini_program_page.dart';
import 'pay_page.dart';
import 'send_auth.dart';
import 'share_image_page.dart';
import 'share_mini_program.dart';
import 'share_music.dart';
import 'share_text.dart';
import 'share_video_page.dart';
import 'share_web_page.dart';
import 'sign_auto_deduct_page.dart';
import 'subscribe_message_page.dart';
import 'pages/auth_by_qr_code_page.dart';
import 'pages/launch_mini_program_page.dart';
import 'pages/pay_page.dart';
import 'pages/send_auth_page.dart';
import 'pages/share_image_page.dart';
import 'pages/share_mini_program_page.dart';
import 'pages/share_music_page.dart';
import 'pages/share_text_page.dart';
import 'pages/share_video_page.dart';
import 'pages/share_web_page.dart';
import 'pages/sign_auto_deduct_page.dart';
import 'pages/subscribe_message_page.dart';

void main() => runApp(new MyApp());
void main() => runApp(const MyApp());

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

@override
_MyAppState createState() => new _MyAppState();
_MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
Expand All @@ -32,39 +34,39 @@ class _MyAppState extends State<MyApp> {

_initFluwx() async {
await registerWxApi(
appId: "wxd930ea5d5a258f4f",
doOnAndroid: true,
doOnIOS: true,
universalLink: "https://your.univerallink.com/link/");
appId: 'wxd930ea5d5a258f4f',
doOnAndroid: true,
doOnIOS: true,
universalLink: 'https://your.univerallink.com/link/',
);
var result = await isWeChatInstalled;
print("is installed $result");
print('is installed $result');
}

// Platform messages are asynchronous, so we initialize in an async method.
Future<void> initPlatformState() async {}

@override
Widget build(BuildContext context) {
return new MaterialApp(
return MaterialApp(
routes: <String, WidgetBuilder>{
"shareText": (context) => ShareTextPage(),
"shareImage": (context) => ShareImagePage(),
"shareWebPage": (context) => ShareWebPagePage(),
"shareMusic": (context) => ShareMusicPage(),
"shareVideo": (context) => ShareVideoPage(),
"sendAuth": (context) => SendAuthPage(),
"shareMiniProgram": (context) => ShareMiniProgramPage(),
"pay": (context) => PayPage(),
"launchMiniProgram": (context) => LaunchMiniProgramPage(),
"subscribeMessage": (ctx) => SubscribeMessagePage(),
"AuthByQRCode": (ctx) => AuthByQRCodePage(),
'shareText': (context) => ShareTextPage(),
'shareImage': (context) => ShareImagePage(),
'shareWebPage': (context) => ShareWebPagePage(),
'shareMusic': (context) => ShareMusicPage(),
'shareVideo': (context) => ShareVideoPage(),
'sendAuth': (context) => SendAuthPage(),
'shareMiniProgram': (context) => ShareMiniProgramPage(),
'pay': (context) => PayPage(),
'launchMiniProgram': (context) => LaunchMiniProgramPage(),
'subscribeMessage': (ctx) => SubscribeMessagePage(),
'AuthByQRCode': (ctx) => AuthByQRCodePage(),
'AutoDeduct': (ctx) => SignAutoDeductPage(),
},
home: new Scaffold(
appBar: new AppBar(
title: const Text('Plugin example app'),
),
body: ShareSelectorPage()),
home: Scaffold(
appBar: AppBar(title: const Text('Plugin example app')),
body: ShareSelectorPage(),
),
);
}
}
Expand All @@ -73,120 +75,134 @@ class ShareSelectorPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Center(
child: new ListView(
child: ListView(
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: new OutlinedButton(
onPressed: () async {
String? extMsg = await getExtMsg();
print("extMsg:$extMsg\n");
},
child: const Text("Get ExtMessage")),
child: OutlinedButton(
onPressed: () async {
String? extMsg = await getExtMsg();
print('extMsg:$extMsg\n');
},
child: const Text('Get ExtMessage'),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: new OutlinedButton(
onPressed: () {
Navigator.of(context).pushNamed("shareText");
},
child: const Text("share text")),
child: OutlinedButton(
onPressed: () {
Navigator.of(context).pushNamed('shareText');
},
child: const Text('share text'),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: new OutlinedButton(
onPressed: () {
Navigator.of(context).pushNamed("shareImage");
},
child: const Text("share image")),
child: OutlinedButton(
onPressed: () {
Navigator.of(context).pushNamed('shareImage');
},
child: const Text('share image'),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: new OutlinedButton(
onPressed: () {
Navigator.of(context).pushNamed("shareWebPage");
},
child: const Text("share webpage")),
child: OutlinedButton(
onPressed: () {
Navigator.of(context).pushNamed('shareWebPage');
},
child: const Text('share webpage'),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: new OutlinedButton(
onPressed: () {
Navigator.of(context).pushNamed("shareMusic");
},
child: const Text("share music")),
child: OutlinedButton(
onPressed: () {
Navigator.of(context).pushNamed('shareMusic');
},
child: const Text('share music'),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: new OutlinedButton(
onPressed: () {
Navigator.of(context).pushNamed("shareVideo");
},
child: const Text("share video")),
child: OutlinedButton(
onPressed: () {
Navigator.of(context).pushNamed('shareVideo');
},
child: const Text('share video'),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: new OutlinedButton(
onPressed: () {
Navigator.of(context).pushNamed("shareMiniProgram");
},
child: const Text("share mini program")),
child: OutlinedButton(
onPressed: () {
Navigator.of(context).pushNamed('shareMiniProgram');
},
child: const Text('share mini program'),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: new OutlinedButton(
onPressed: () {
Navigator.of(context).pushNamed("sendAuth");
},
child: const Text("send auth")),
child: OutlinedButton(
onPressed: () {
Navigator.of(context).pushNamed('sendAuth');
},
child: const Text('send auth'),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: new OutlinedButton(
onPressed: () {
Navigator.of(context).pushNamed("pay");
},
child: const Text("pay")),
child: OutlinedButton(
onPressed: () {
Navigator.of(context).pushNamed('pay');
},
child: const Text('pay'),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: new OutlinedButton(
onPressed: () {
Navigator.of(context).pushNamed("launchMiniProgram");
},
child: const Text("Launch MiniProgram")),
child: OutlinedButton(
onPressed: () {
Navigator.of(context).pushNamed('launchMiniProgram');
},
child: const Text('Launch MiniProgram'),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: new OutlinedButton(
onPressed: () {
Navigator.of(context).pushNamed("subscribeMessage");
},
child: const Text("SubscribeMessage")),
child: OutlinedButton(
onPressed: () {
Navigator.of(context).pushNamed('subscribeMessage');
},
child: const Text('SubscribeMessage'),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: new OutlinedButton(
onPressed: () {
Navigator.of(context).pushNamed("AuthByQRCode");
},
child: const Text("AuthByQRCode")),
child: OutlinedButton(
onPressed: () {
Navigator.of(context).pushNamed('AuthByQRCode');
},
child: const Text('AuthByQRCode'),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: new OutlinedButton(
onPressed: () {
Navigator.of(context).pushNamed("AutoDeduct");
},
child: const Text("SignAuto-deduct")),
child: OutlinedButton(
onPressed: () {
Navigator.of(context).pushNamed('AutoDeduct');
},
child: const Text('SignAuto-deduct'),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: new OutlinedButton(
onPressed: () {
openWeChatApp();
},
child: const Text("Open WeChat App")),
child: OutlinedButton(
onPressed: () {
openWeChatApp();
},
child: const Text('Open WeChat App'),
),
),
],
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import 'dart:typed_data';

import 'package:flutter/material.dart';
import 'package:fluwx/fluwx.dart' as fluwx;

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

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

class _AuthByQRCodePageState extends State<AuthByQRCodePage> {
String _status = "status";
String _status = 'status';
Uint8List? _image;

@override
Expand All @@ -18,7 +19,7 @@ class _AuthByQRCodePageState extends State<AuthByQRCodePage> {

// fluwx.onAuthByQRCodeFinished.listen((data) {
// setState(() {
// _status = "errorCode=>${data.errorCode}\nauthCode=>${data.authCode}";
// _status = 'errorCode=>${data.errorCode}\nauthCode=>${data.authCode}';
// });
// });
// fluwx.onAuthGotQRCode.listen((image) {
Expand All @@ -29,7 +30,7 @@ class _AuthByQRCodePageState extends State<AuthByQRCodePage> {
//
// fluwx.onQRCodeScanned.listen((scanned) {
// setState(() {
// _status = "scanned";
// _status = 'scanned';
// });
// });
}
Expand All @@ -38,20 +39,20 @@ class _AuthByQRCodePageState extends State<AuthByQRCodePage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("AuthByQRCode"),
title: Text('AuthByQRCode'),
),
body: Column(
children: <Widget>[
RaisedButton(
ElevatedButton(
onPressed: () {
// fluwx.authByQRCode(
// appId: "wxd930ea5d5a258f4f",
// scope: "noncestr",
// nonceStr: "nonceStr",
// timeStamp: "1417508194",
// signature: "429eaaa13fd71efbc3fd344d0a9a9126835e7303");
// appId: 'wxd930ea5d5a258f4f',
// scope: 'noncestr',
// nonceStr: 'nonceStr',
// timeStamp: '1417508194',
// signature: '429eaaa13fd71efbc3fd344d0a9a9126835e7303');
},
child: Text("AUTH NOW"),
child: Text('AUTH NOW'),
),
Text(_status),
_qrCode()
Expand Down
Loading

0 comments on commit 75dc809

Please sign in to comment.