saltedfish_weibo_plugin 0.0.4

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

saltedfish_weibo_plugin

新浪微博插件

  • 1 目前支持授权和分享
  • 2 由于本人是Android开发,不熟悉OC,所以暂时不支持IOS,空余时间会用Swift补上IOS,时间未知,如果有小伙伴能帮忙补全就最好不过了。
  • 3 由于新浪SDK开发实在太渣,aar没有适配好,所以Android插件放了一份arm64-v8a的so,如果有特殊适配要求的需要自行适配。

How to use

1. Install

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

dependencies:
  saltedfish_weibo_plugin: "^0.0.4"

2. Import

import 'package:saltedfish_weibo_plugin/saltedfish_weibo_plugin.dart';

3. Use

例子里面也有,可以看example/main.dart

  • 初始化
SaltedfishWeiboSharePlugin.install('你的appid', '回调地址', '权限');
  • web授权
SaltedfishWeiboSharePlugin.webAuth();
  • sso授权
SaltedfishWeiboSharePlugin.ssoAuth();
  • all in one授权
SaltedfishWeiboSharePlugin.allInOneAuth();
  • 分享

参数依次为标题,内容,图片(目前仅支持单张)

SaltedfishWeiboSharePlugin.shareToWeibo('我有一个小小的愿望,就是想和你……', '幸福,不是有多大的房子,也不是有多豪的车,幸福是生活中每个微小的愿望都成真。\n对于幸福的定义,不同的人有不同的理解于我而言,幸福就是和你一起去旅行。', 'http://www.17fxw.cn:4869/3efb5cfc0554461e18acf255cfd16733');
  • 状态说明

    0——成功

    -1——取消

    1——失败

License

Copyright 2018 LuoHao

Licensed 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.0.4

  • 更新状态说明

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:saltedfish_weibo_plugin/saltedfish_weibo_plugin.dart';

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

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

class _MyAppState extends State<MyApp> {
  final String WTS_SHARE_SINA_APP_KEY = "4078126022";
  final String WTS_SHARE_SINA_REDIRECT_URL = "http://www.17fxw.cn/";
  final String WTS_SHARE_SINA_SCOPE = "email,direct_messages_read,direct_messages_write,friendships_groups_read,friendships_groups_write,statuses_to_me_read,follow_app_official_microblog,invitation_write";
  @override
  void initState() {
    super.initState();
    SaltedfishWeiboPlugin.install(WTS_SHARE_SINA_APP_KEY, WTS_SHARE_SINA_REDIRECT_URL, WTS_SHARE_SINA_SCOPE);
  }



  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: const Text('Plugin example app'),
        ),
        body: new Column(
          children: <Widget>[
            InkWell(
              child: Container(child:Text('web授权'),padding: EdgeInsets.all(16.0),),onTap: (){
              SaltedfishWeiboPlugin.webAuth();
            },
            ),
            InkWell(
              child: Container(child:Text('sso授权'),padding: EdgeInsets.all(16.0),),onTap: (){
              SaltedfishWeiboPlugin.ssoAuth();
            },
            ),
            InkWell(
              child: Container(child:Text('all in one'),padding: EdgeInsets.all(16.0),),onTap: (){
              SaltedfishWeiboPlugin.allInOneAuth();
            },
            ),
            InkWell(
              child: Container(child:Text('分享'),padding: EdgeInsets.all(16.0),),onTap: (){
              SaltedfishWeiboPlugin.shareToWeibo('我有一个小小的愿望,就是想和你……', '幸福,不是有多大的房子,也不是有多豪的车,幸福是生活中每个微小的愿望都成真。\n对于幸福的定义,不同的人有不同的理解于我而言,幸福就是和你一起去旅行。', 'http://www.17fxw.cn:4869/3efb5cfc0554461e18acf255cfd16733');
            },
            ),
          ],
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  saltedfish_weibo_plugin: ^0.0.4

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:saltedfish_weibo_plugin/saltedfish_weibo_plugin.dart';
  
Version Uploaded Documentation Archive
0.0.4 Aug 4, 2018 Go to the documentation of saltedfish_weibo_plugin 0.0.4 Download saltedfish_weibo_plugin 0.0.4 archive
0.0.3 Aug 4, 2018 Go to the documentation of saltedfish_weibo_plugin 0.0.3 Download saltedfish_weibo_plugin 0.0.3 archive
0.0.2 Aug 4, 2018 Go to the documentation of saltedfish_weibo_plugin 0.0.2 Download saltedfish_weibo_plugin 0.0.2 archive
0.0.1 Aug 4, 2018 Go to the documentation of saltedfish_weibo_plugin 0.0.1 Download saltedfish_weibo_plugin 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
49
Health:
Code health derived from static analysis. [more]
96
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
73
Learn more about scoring.

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

  • Dart: 2.0.0
  • pana: 0.11.8
  • Flutter: 0.5.7

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Suggestions

The description is too short.

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Package is pre-v1 release.

While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction of the API.

Format lib/saltedfish_weibo_plugin.dart.

Run flutter format to format lib/saltedfish_weibo_plugin.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0-dev.28.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.6 1.14.11
meta 1.1.5 1.1.6
sky_engine 0.0.99
typed_data 1.1.5 1.1.6
vector_math 2.0.6 2.0.8