Touchable Opacity
C2CTouchableOpacity is a Flutter widget designed to provide an opacity effect on user interactions such as tap and long press. This widget changes its opacity to indicate an active state, enhancing the user experience by providing visual feedback. It's ideal for creating buttons and interactive elements in a Flutter app.
Example Usage
C2CTouchableOpacity(
onPressed: () {
// Action on button tap
},
activeOpacity: 0.7,
child: Text('Tap Me'),
)
Properties
| Property | Description | Type |
|---|---|---|
child | The content displayed inside the button. | Widget |
disabled | If true, the button is disabled and does not respond to taps. | bool |
onPressed | Callback function invoked when the button is tapped. | void Function()? |
activeOpacity | Opacity level when the button is active. Default is 0.5. | double? |
onLongPress | Callback function invoked on a long press of the button. | void Function()? |