Skip to content

Commit 62863bc

Browse files
committed
fix(touchable): fixed bug where color cannot disappear after TouchableHighlight component is pressed
1 parent a444a0b commit 62863bc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/touchable.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,18 @@ class _TouchableHighlightState extends State<TouchableHighlight> {
2626
if (widget.onPressed != null) widget.onPressed();
2727
}
2828

29+
_onTapCancel(){
30+
setState(() {
31+
bg = Color(0xFFFFFFFF);
32+
});
33+
}
34+
2935
@override
3036
Widget build(BuildContext context) {
3137
return GestureDetector(
3238
onTapDown: this._onTapDown,
3339
onTapUp: this._onTapUp,
40+
onTapCancel: this._onTapCancel,
3441
child: Container(
3542
color: bg,
3643
child: widget.child,

0 commit comments

Comments
 (0)