Skip to main content

Touchable

The C2CTouchable widget is a customizable button component for Flutter apps. It supports adaptive styling, making it suitable for both Material (Android) and Cupertino (iOS) design themes. This widget extends StatefulWidget and provides flexibility through various properties like background colors, padding, border radius, and handling of disabled states. It also supports different types of user interactions such as tap and long press.

Example Usage

C2CTouchable(
onPressed: () {
// Handle button press
},
backgroundColor: Colors.blue,
disabledBackgroundColor: Colors.grey,
padding: EdgeInsets.all(10),
borderRadius: BorderRadius.circular(8),
child: Text('Click Me'),
)

Properties

PropertyDescriptionType
childThe widget inside the button. Can be a String or a Widget.dynamic
backgroundColorThe button's background color.Color?
disabledBackgroundColorBackground color when the button is disabled.Color?
disabledWhether the button is disabled.bool
onPressedCallback function when the button is pressed.void Function()?
onLongPressCallback function when the button is long-pressed.void Function()?
typeThe button style type (adaptive, material, cupertino).StyleType
focusedBackgroundColor(iOS only) Background color when the button is focused.Color?
paddingPadding around the button's child.EdgeInsets?
borderRadiusThe radius of the button's corners.BorderRadius?
clipBehaviorWhat to do with visuals outside the button's bounds.Clip