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 ↗