

我刚开始从事新项目,并导致我将以前项目中的代码复制并粘贴到计时器按钮上。所以我开发了此程序包,以便大家都能使用


- 创建一个新的flutter项目并选择Flutter Package:


2.将您的代码添加到
lib / timer_button.dart
3.更新pubspec.yaml


4.发布包
发布之前,请确保检查pubspec.yaml , README.md和CHANGELOG.md文件,以确保其内容完整且正确。
接下来,运行dry-run命令以查看是否所有分析都通过:
flutter包pub publish --dry-run
最后,运行实际的发布命令:
flutter包pub发布
有关发布的详细信息,请参见Pub发布文档。


打开timer_button并选择“安装”选项卡,然后按照以下步骤进行操作


编码 :
新的 TimerButton(
标签:“再次发送OTP”,
timeOutInSeconds:3,
onPressed:(){},
颜色:颜色。 深紫色
),
新的 TimerButton(
标签:“再试一次”,
timeOutInSeconds:4,
onPressed:(){},
buttonType:ButtonType.OutlineButton,
),
新的 TimerButton(
标签:“ CLOSE”,
timeOutInSeconds:5
onPressed:(){},
buttonType:ButtonType.FlatButton,
disabledColor:颜色。 深橙色
颜色:颜色。 绿色
),
结果 :



