fluwx 0.1.7

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 86

logo

中文请移步此处

Fluwx makes easier using WeChatSDK on Flutter.

Before

Before usingFluwx,I highly recommond you read this article, this'll help you。

What does Fluwx support?

  • Share Text.
  • Share WebPage.
  • Share Image.
  • Share Music.
  • Share Video.
  • Share MiniProgram.
  • Send Auth(Login).
  • Pay.

Tech Used In Fluwx

For Android,kotlin-1.2.60 is included:

    api 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:5.1.4'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.24.0'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:0.24.0'
    implementation 'top.zibin:Luban:1.1.8'
    implementation 'com.squareup.okhttp3:okhttp:3.11.0'

For iOS:

    s.dependency 'WechatOpenSDK','~> 1.8.2'

For Flutter:<br> Flutter 0.8.2 • channel beta • https://github.com/flutter/flutter.git<br> Framework • revision 5ab9e70727 (11 days ago) • 2018-09-07 12:33:05 -0700<br> Engine • revision 58a1894a1c<br> Tools • Dart 2.1.0-dev.3.1.flutter-760a9690c2<br>

Import

add the following in your pubspec.yaml file:

dependencies:
  fluwx: ^0.1.7

Init Fluwx

Before usingFluwx,you should init FLuwx

    Fluwx.register(appId:"wxd930ea5d5a258f4f",doOnAndroid: true,doOnIOS: true,enableMTA: false);
  • appId:the appId you applied from WeChat.
  • doOnAndroid:whether init for Android.
  • doOnIOS:whether init for iOS Each param isn't necessary.However,if appIdis blank, or doOnAndroid: false, or doOnIOS: false,you must register your WXApi on the particular platform in order to ensure Fluwx can work. After tha,add the following code before using Fluwx on the particular platform: For Android:
 FluwxShareHandler.setWXApi(wxapi)

For iOS:

isWeChatRegistered = YES;

NOTE:Although we can register WXApi via Fluwx,but there's still some work you have to do on the particular platform.For example, creat a WXEntryActivity for android and add a URLSchema for iOS.

More

Waiting

LICENSE

Copyright 2018 OpenFlutter Project

Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements.  See the NOTICE file distributed with this work for
additional information regarding copyright ownership.  The ASF licenses this
file to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License.  You may obtain a copy of
the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
License for the specific language governing permissions and limitations under
the License.

0.1.7

  • 删除Fluwx.registerApp(RegisterModel),现在使用Fluwx.register()

0.1.6

  • 修复transitive dependencies。

0.1.5

  • 增加了本地图片的支持

0.1.4

  • 修复了iOS分享去处错误的问题

0.1.3

  • ResponseType 更名为WeChatResponseType

0.1.2

  • 修复iOS中FluwxShareHandler.h的导入问题

0.1.1

  • 修复iOS分享去处错误的bug

0.1.0

  • 增加了MTA选项
  • Android部分的微信SDK提供方式由implementation更换为api

0.0.8

  • 修复了iOS无法分享小程序的bug
  • 修复了iOS分享音乐崩溃的问题
  • 修复了iOS发送Auth偶尔会崩溃的问题

0.0.7

  • 修复了iOS回调崩溃的bug

0.0.6

  • 修复iOS拉起支付崩溃的问题

0.0.5

  • 格式化代码

0.0.4

  • 支付
  • demo

0.0.3

  • 发送Auth认证。

0.0.2

  • 文本分享。
  • 网站分享。
  • 图片分享。
  • 音乐分享。
  • 视频分享。
  • 小程序分享。

0.0.1

  • Android部分的分享已完成.

example/lib/main.dart

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:fluwx/fluwx.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_image.dart';
import 'share_video_page.dart';
import 'share_web_page.dart';

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    Fluwx.register(appId:"wxd930ea5d5a258f4f",doOnAndroid: true,doOnIOS: true,enableMTA: false);
  }

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

  @override
  Widget build(BuildContext context) {
    return new 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(),
      },
      home: new Scaffold(
          appBar: new AppBar(
            title: const Text('Plugin example app'),
          ),
          body: ShareSelectorPage()),
    );
  }
}

class ShareSelectorPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: new ListView(
        children: <Widget>[
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: new OutlineButton(
                onPressed: () {
                  Navigator.of(context).pushNamed("shareText");
                },
                child: const Text("share text")),
          ),
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: new OutlineButton(
                onPressed: () {
                  Navigator.of(context).pushNamed("shareImage");
                },
                child: const Text("share image")),
          ),
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: new OutlineButton(
                onPressed: () {
                  Navigator.of(context).pushNamed("shareWebPage");
                },
                child: const Text("share webpage")),
          ),
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: new OutlineButton(
                onPressed: () {
                  Navigator.of(context).pushNamed("shareMusic");
                },
                child: const Text("share music")),
          ),
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: new OutlineButton(
                onPressed: () {
                  Navigator.of(context).pushNamed("shareVideo");
                },
                child: const Text("share video")),
          ),
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: new OutlineButton(
                onPressed: () {
                  Navigator.of(context).pushNamed("shareMiniProgram");
                },
                child: const Text("share mini program")),
          ),
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: new OutlineButton(
                onPressed: () {
                  Navigator.of(context).pushNamed("sendAuth");
                },
                child: const Text("send auth")),
          ),
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: new OutlineButton(
                onPressed: () {
                  Navigator.of(context).pushNamed("pay");
                },
                child: const Text("pay")),
          ),
        ],
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  fluwx: ^0.1.7

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:fluwx/fluwx.dart';
  
Version Uploaded Documentation Archive
0.1.7 Sep 20, 2018 Go to the documentation of fluwx 0.1.7 Download fluwx 0.1.7 archive
0.1.6 Sep 19, 2018 Go to the documentation of fluwx 0.1.6 Download fluwx 0.1.6 archive
0.1.5 Sep 18, 2018 Go to the documentation of fluwx 0.1.5 Download fluwx 0.1.5 archive
0.1.4 Sep 6, 2018 Go to the documentation of fluwx 0.1.4 Download fluwx 0.1.4 archive
0.1.3 Sep 5, 2018 Go to the documentation of fluwx 0.1.3 Download fluwx 0.1.3 archive
0.1.2 Sep 4, 2018 Go to the documentation of fluwx 0.1.2 Download fluwx 0.1.2 archive
0.1.1 Sep 3, 2018 Go to the documentation of fluwx 0.1.1 Download fluwx 0.1.1 archive
0.1.0 Sep 3, 2018 Go to the documentation of fluwx 0.1.0 Download fluwx 0.1.0 archive
0.0.8 Aug 29, 2018 Go to the documentation of fluwx 0.0.8 Download fluwx 0.0.8 archive
0.0.7 Aug 29, 2018 Go to the documentation of fluwx 0.0.7 Download fluwx 0.0.7 archive

All 16 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
72
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]
86
Learn more about scoring.

We analyzed this package on Sep 20, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.3
  • Flutter: 0.8.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.58.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8