Coder Social home page Coder Social logo

countdown_text's Introduction

countdown_text

A Flutter plugin about countdown

初始化

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: const Text('Plugin example app'),
        ),
        body: new Center(
          child: CountdownText(
            '获取验证码',
            onPressed: () {
              return true;
            },
          ),
        ),
       ),
    );
  }
}

属性值

属性 说明
width 宽度
height 高度
count 倒计时数值
radius 圆角
color 按钮背景颜色
disabledColor 按钮点击后不可用状态背景颜色
textColor 字体大小
fontSize 字体颜色
class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: const Text('Plugin example app'),
        ),
        body: new Center(
          child: CountdownText(
            '获取验证码',
            count: 10,
            textColor: Colors.deepOrange,
            fontSize: 20.0,
            color: Colors.amber,
            radius: 20.0,
            disabledColor: Colors.black,
            width: 200.0,
            onPressed: () {
              return true;
            },
          ),
        ),
      ),
    );
  }
}

Tips

  • onPressed 有时候会遇到手机号不对,抑或没有输入手机号等等,当不执行倒计时,此时返回false

Getting Started

For help getting started with Flutter, view our online documentation.

For help on editing plugin code, view the documentation.

countdown_text's People

Contributors

kevinroy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.