Skip to main content

Radio

C2CRadio is a customizable radio button widget for Flutter applications. It allows for various customizations including colors, borders, text, and error handling. This widget can be used in forms and settings where a user needs to select a single option from a group.

Installation

cpub add c2c_radio

or

flutter pub add c2c_radio --hosted-url=https://pub.csp.scrum-dev.com

Example

C2CRadio(
label: 'Option 1',
checked: true,
onChanged: (bool value) {
// Handle radio button change
},
// Additional customizations
);

Properties

PropertyDescriptionType
labelThe text displayed next to the radio button.dynamic
labelTextStyleStyle applied to the label text.TextStyle?
checkedWhether the radio button is selected or not.bool
disabledWhether the radio button is disabled or not.bool
onChangedCallback function when the radio button is toggled.Function(bool)?
errorError message displayed below the radio button.dynamic
errorTextStyleStyle applied to the error message text.TextStyle?
descriptionDescription text displayed below the label.dynamic
descriptionTextStyleStyle applied to the description text.TextStyle?
errorTextSpacingSpacing between the error message and the radio button.double?
labelSpacingLeftLeft spacing applied to the label text.double?
backgroundColorBackground color of the radio button.Color?
borderSideBorder style applied to the radio button.BorderSide?
checkColorColor of the check mark inside the radio button.Color?
activeBackgroundColorBackground color when the radio button is selected.Color?
activeBorderSideBorder style when the radio button is selected.BorderSide?
disabledCheckColorCheck mark color when the radio button is disabled.Color?
disabledBackgroundColorBackground color when the radio button is disabled.Color?
disabledBorderSideBorder style when the radio button is disabled.BorderSide?
errorCheckColorCheck mark color when there is an error.Color?
errorBackgroundColorBackground color when there is an error.Color?
errorBorderSideBorder style when there is an error.BorderSide?
radioSizeSize of the radio button.double?
errorShadowShadow applied to the radio button when there is an error.BoxShadow?
showErrorMessageDetermines whether the error message is displayed.bool