v0.5.0tap_builder
一个用于构建交互区域的简单小部件。
113喜欢 9060近 30 天下载140Pub 分数
AndroidiOSWebmacOSWindowsLinux
一个用于构建交互区域的简单小部件。
以下为英文项目原文快照,最新内容请访问 GitHub。
A simple widget for building interactive areas. It is an alternative to the material's Inkwell that allows customizing the visual effects.
@override
Widget build(BuildContext context) {
return TapBuilder(
onTap: () {},
builder: (context, state, isFocused) => AnimatedContainer(
padding: EdgeInsets.symmetric(
vertical: 10,
horizontal: 20,
),
duration: const Duration(milliseconds: 500),
decoration: BoxDecoration(
border: Border.all(
color: Colors.white.withOpacity(isFocused ? 0.2 : 0.0),
width: 2,
),
color: () {
switch (state) {
case TapState.disabled:
return Colors.grey;
case TapState.hover:
return Colors.blue;
case TapState.inactive:
return Colors.amberAccent;
case TapState.pressed:
return Colors.red;
}
}(),
),
child: Text('Button'),
),
);
}
依赖清单 3 项
{"sdk":"flutter"}^1.0.0{"sdk":"flutter"}先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗