Skip to main content

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

PropertyDescriptionType
childThe content displayed inside the button.Widget
disabledIf true, the button is disabled and does not respond to taps.bool
onPressedCallback function invoked when the button is tapped.void Function()?
activeOpacityOpacity level when the button is active. Default is 0.5.double?
onLongPressCallback function invoked on a long press of the button.void Function()?