animatedloginbutton 0.1.1

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

AnimatedLoginButton #

pub package

双平台通用,使用简单,动画炫酷,可自定义大小尺寸等,如果使用当中有什么问题,请在github里提出个issues,thankYou

It is a good widget,can compatible with Android and IOS,Adjustable progress,Customizable color and size, If there is any problem with the use, please submit an issue in github,thankYou

My organization's github:https://github.com/OpenFlutter

Contact Me :OpenFlutter QQ群 892398530 #

Usage #

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

dependencies:
  animatedloginbutton: "^0.1.1"

Add it to your dart file:

import 'package:animatedloginbutton/animatedloginbutton.dart';

Example #

import 'dart:io';
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:animatedloginbutton/animatedloginbutton.dart';

class LoginAnimationDemo extends StatefulWidget{

  @override
  State<StatefulWidget> createState() {
    return new LoginAnimationDemoState();
  }

}

class LoginAnimationDemoState extends State<LoginAnimationDemo>{

  //使用系统的请求
  var httpClient = new HttpClient();
  var url = "https://github.com/";
  var _result="";
  final LoginErrorMessageController loginErrorMessageController=LoginErrorMessageController();

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


  @override
  Widget build(BuildContext context) {

    return new Scaffold(
      appBar: new AppBar(
        title: new Text("登陆按钮动画"),
      ),
      body: new Center(
        child:new Container(
          child:new AnimatedLoginButton(
            loginErrorMessageController:loginErrorMessageController,
            onTap: () async {
              try {
                var request = await httpClient.getUrl(Uri.parse(url));
                var response = await request.close();
                if (response.statusCode == HttpStatus.ok) {
                  _result = await response.transform(utf8.decoder).join();

                  //拿到数据后,对数据进行梳理
                  loginErrorMessageController.showErrorMessage("网络异常");

                } else {
                  _result = 'ERROR CODE: ${response.statusCode}';
                  loginErrorMessageController.showErrorMessage("网络异常 $_result");
                }
              } catch (exception) {
                _result = '网络异常';
                loginErrorMessageController.showErrorMessage("网络异常");
              }
              print(_result);
            },
          ),
        ),
      ),
    );
  }
}

Properties #

propertiestypedescription
loginTipString登陆按钮提示 Login button prompt
widthdoublebutton的宽度 Button width
heightdoublebutton的高度 Button Height
indicatorStarRadiandouble弧形指标器的起始角度(旋转的那个带箭头的东西) The starting angle of the curved indicator (the one with the arrow that rotates)
indicatorWidthdouble指标器的宽度 Indicator width
buttonColorNormalColor未登陆时Button的颜色 Button color when not logged in
buttonColorErrorColor登陆异常Button的颜色 Button color when Login failed
indicatorColorColor指标器的颜色 Indicator color
textStyleNormalTextStyle未登录时Button文字的样式 Style of text when not logged in
textStyleErrorTextStyle登陆异常时Button文字的样式 The style of the text when the login fails
onTaptypedef点击事件 Click event
loginErrorMessageControllerLoginErrorMessageController用来显示异常信息 Used to display exception information
showErrorTimeDuration异常信息显示时间 The duration of show error message

[0.1.1] - 2019.01.18

  • initial release.

example/example.dart

import 'dart:io';
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:animatedloginbutton/animatedloginbutton.dart';

class LoginAnimationDemo extends StatefulWidget{

  @override
  State<StatefulWidget> createState() {
    return new LoginAnimationDemoState();
  }

}

class LoginAnimationDemoState extends State<LoginAnimationDemo>{

  //使用系统的请求
  var httpClient = new HttpClient();
  var url = "https://github.com/";
  var _result="";
  final LoginErrorMessageController loginErrorMessageController=LoginErrorMessageController();

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


  @override
  Widget build(BuildContext context) {

    return new Scaffold(
      appBar: new AppBar(
        title: new Text("登陆按钮动画"),
      ),
      body: new Center(
        child:new Container(
          child:new AnimatedLoginButton(
            loginErrorMessageController:loginErrorMessageController,
            onTap: () async {
              try {
                var request = await httpClient.getUrl(Uri.parse(url));
                var response = await request.close();
                if (response.statusCode == HttpStatus.ok) {
                  _result = await response.transform(utf8.decoder).join();

                  //拿到数据后,对数据进行梳理
                  loginErrorMessageController.showErrorMessage("网络异常");

                } else {
                  _result = 'ERROR CODE: ${response.statusCode}';
                  loginErrorMessageController.showErrorMessage("网络异常 $_result");
                }
              } catch (exception) {
                _result = '网络异常';
                loginErrorMessageController.showErrorMessage("网络异常");
              }
              print(_result);
            },
          ),
        ),
      ),
    );
  }

}

Use this package as a library

1. Depend on it

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


dependencies:
  animatedloginbutton: ^0.1.1

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:animatedloginbutton/animatedloginbutton.dart';
  
Version Uploaded Documentation Archive
0.1.1 Jan 18, 2019 Go to the documentation of animatedloginbutton 0.1.1 Download animatedloginbutton 0.1.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
3
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
51
Learn more about scoring.

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

  • Dart: 2.1.0
  • pana: 0.12.13+1
  • Flutter: 1.2.1

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/animatedloginbutton.dart. (-1 points)

Analysis of lib/animatedloginbutton.dart reported 2 hints:

line 4 col 9: The class 'Future' was not exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 186 col 15: The class 'Future' was not exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

Dependencies

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