CPButton constructor
CPButton({
- required String image,
- required VoidCallback onPress,
- String? title,
- bool isEnabled = true,
- String? id,
Implementation
CPButton({
required this.image,
required this.onPress,
this.title,
this.isEnabled = true,
String? id,
}) : uniqueId = id ?? const Uuid().v4() {
if (uniqueId.trim().isEmpty ||
image.trim().isEmpty ||
(title != null && title!.trim().isEmpty)) {
throw ArgumentError(
'Button identifiers, images and supplied titles must not be empty.',
);
}
}