import 'package:gluestack_ui/gluestack_ui.dart';
GSRadio<Value>(
size: GSRadioSizes.$md,
isDisabled: false,
isInvalid: false,
value: Value.four,
groupValue: groupValue,
onChanged: (p0) {
setState(() {
groupValue = p0!;
});
},
icon: const GSRadioIcon<Value>(),
label: const GSRadioText<Value>(text: 'text'),
style: GSStyle(margin: const EdgeInsets.only(right: $GSSpace.$2)),
)
import "package:gluestack_ui/gluestack_ui.dart"
Parameters | Type | Default | Description |
---|---|---|---|
value | string | - | The value to be used in the radio input. This is the value that will be returned on form submission. |
onChanged | function | - | Function called when the state of the radio changes. |
isDisabled | bool | false | To manually set disable to the radio. |
isInvalid | bool | false | To manually set invalid to the radio. |
Name | Value | Default |
---|---|---|
size | lg | md | sm | md |
import 'package:gluestack_ui/gluestack_ui.dart';
Value groupValueOne = Value.one;
GSVStack(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
GSRadio<Value>(
value: Value.one,
groupValue: groupValueOne,
onChanged: (p0) {
setState(() {
groupValueOne = p0!;
});
},
icon: const GSRadioIcon<Value>(),
label: const GSRadioText<Value>(text: 'English'),
style: GSStyle(margin: EdgeInsets.only(right: $GSSpace.$2)),
),
const SizedBox(
height: 20,
),
GSRadio<Value>(
value: Value.two,
groupValue: groupValueOne,
onChanged: (p0) {
setState(() {
groupValueOne = p0!;
});
},
icon: const GSRadioIcon<Value>(),
label: const GSRadioText<Value>(text: 'French'),
style: GSStyle(margin: EdgeInsets.only(right: $GSSpace.$2)),
),
const SizedBox(
height: 20,
),
GSRadio<Value>(
value: Value.three,
groupValue: groupValueOne,
onChanged: (p0) {
setState(() {
groupValueOne = p0!;
});
},
icon: const GSRadioIcon<Value>(),
label: const GSRadioText<Value>(text: 'German'),
style: GSStyle(margin: EdgeInsets.only(right: $GSSpace.$2)),
),
],
)
import 'package:gluestack_ui/gluestack_ui.dart';
GSHStack(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
GSRadio<Value>(
value: Value.one,
groupValue: groupValueOne,
onChanged: (p0) {
setState(() {
groupValueOne = p0!;
});
},
icon: const GSRadioIcon<Value>(),
label: const GSRadioText<Value>(text: 'Credit Card'),
style: GSStyle(margin: EdgeInsets.only(right: $GSSpace.$2)),
),
const SizedBox(
width: 20,
),
GSRadio<Value>(
value: Value.two,
groupValue: groupValueOne,
onChanged: (p0) {
setState(() {
groupValueOne = p0!;
});
},
icon: const GSRadioIcon<Value>(),
label: const GSRadioText<Value>(text: 'UPI'),
style: GSStyle(margin: EdgeInsets.only(right: $GSSpace.$2)),
),
const SizedBox(
width: 20,
),
GSRadio<Value>(
value: Value.three,
groupValue: groupValueOne,
onChanged: (p0) {
setState(() {
groupValueOne = p0!;
});
},
icon: const GSRadioIcon<Value>(),
label: const GSRadioText<Value>(text: 'Cash on Delivery'),
style: GSStyle(margin: EdgeInsets.only(right: $GSSpace.$2)),
),
],
)
import 'package:gluestack_ui/gluestack_ui.dart';
GSVStack(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
GSRadio<Value>(
value: Value.one,
groupValue: groupValueOne,
onChanged: (p0) {
setState(() {
groupValueOne = p0!;
});
},
icon: const GSRadioIcon<Value>(),
label: const GSVStack(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
GSRadioText<Value>(text: 'Extended Coverage'),
GSText(text: 'Extra services included'),
],
),
style: GSStyle(
margin: EdgeInsets.only(
right: $GSSpace.$4,
bottom: $GSSpace.$4,
),
),
),
const SizedBox(
height: 20,
),
GSRadio<Value>(
value: Value.two,
groupValue: groupValueOne,
onChanged: (p0) {
setState(() {
groupValueOne = p0!;
});
},
icon: const GSRadioIcon<Value>(),
label: const GSVStack(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
GSRadioText<Value>(text: 'Basic Coverage'),
GSText(text: 'Basic services'),
],
),
style: GSStyle(
margin: EdgeInsets.only(
right: $GSSpace.$4,
bottom: $GSSpace.$4,
),
),
),
],
)
import 'package:gluestack_ui/gluestack_ui.dart';
GSVStack(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const GSHeading(text: 'Which time slot works best for you?'),
const SizedBox(
height: 10,
),
GSRadio<Value>(
value: Value.one,
groupValue: groupValueOne,
onChanged: (p0) {
setState(() {
groupValueOne = p0!;
});
},
icon: const GSRadioIcon<Value>(),
label: const GSRadioText<Value>(text: 'Monday'),
style: GSStyle(
margin: EdgeInsets.only(
right: $GSSpace.$4,
),
),
),
const SizedBox(
height: 20,
),
GSRadio<Value>(
value: Value.two,
groupValue: groupValueOne,
onChanged: (p0) {
setState(() {
groupValueOne = p0!;
});
},
icon: const GSRadioIcon<Value>(),
label: const GSRadioText<Value>(text: 'Tuesday'),
style: GSStyle(
margin: EdgeInsets.only(
right: $GSSpace.$4,
),
),
),
const SizedBox(
height: 20,
),
GSRadio<Value>(
value: Value.three,
groupValue: groupValueOne,
onChanged: (p0) {
setState(() {
groupValueOne = p0!;
});
},
icon: const GSRadioIcon<Value>(),
label: const GSRadioText<Value>(text: 'Wednesday'),
style: GSStyle(
margin: EdgeInsets.only(
right: $GSSpace.$4,
),
),
),
const SizedBox(
height: 10,
),
const GSText(text: 'Choose a time slot for the meeting'),
],
)
import 'package:gluestack_ui/gluestack_ui.dart';
Value groupValueOne = Value.one;
GSVStack(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
GSRadio<Value>(
value: Value.one,
groupValue: groupValueOne,
onChanged: (p0) {
setState(() {
groupValueOne = p0!;
});
},
label: const GSRadioText<Value>(text: 'Apartments'),
icon: const GSRadioIcon<Value>(),
style: GSStyle(
margin: EdgeInsets.only(
right: $GSSpace.$4,
),
),
),
const SizedBox(
height: 20,
),
GSRadio<Value>(
value: Value.two,
groupValue: groupValueOne,
onChanged: (p0) {
setState(() {
groupValueOne = p0!;
});
},
icon: const GSRadioIcon<Value>(),
label: const GSRadioText<Value>(text: 'Houses'),
style: GSStyle(
margin: EdgeInsets.only(
right: $GSSpace.$4,
),
),
),
],
)