Flutter 闪动按钮效果

Flutter 闪动按钮效果pub仓库地址
Flutter 闪动按钮效果github仓库地址

效果如下:

在这里插入图片描述

下载安装:

在 pubspec.yaml 中添加依赖

dependencies:
  ...
  twinkle_button: ^0.0.1

在命令行中执行这句话

flutter packages get

使用方法:

import 'package:twinkle_button/twinkle_button.dart';
TwinkleButton(
  buttonTitle: Text(
    'Subscribe with Free Trial',
    style: TextStyle(
      color: Colors.white,
          fontWeight: FontWeight.w300,
          fontSize: 17.0,
        ),
    ),
    buttonColor: Color(0xff3dce89),
    onclickButtonFunction: () {
      print('hello');
    }
);

参数

Parameter Default Description
buttonTitle null 按钮的文字,不能为空。
buttonColor null 按钮的颜色,不能为空。
buttonHeight 50.0 按钮的高度。
buttonWidth 200.0 按钮的宽度。
durationTime 3 闪烁间隔时间。
twinkleTime 300 闪烁时间。
onclickButtonFunction null 点击按钮触发的事件,不能为空。
发布了18 篇原创文章 · 获赞 7 · 访问量 4875

猜你喜欢

转载自blog.csdn.net/weixin_43766269/article/details/103888216
今日推荐