52 lines
1.4 KiB
Dart
52 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class CustomRadioButtonWrapper extends StatefulWidget {
|
|
final bool isFocused;
|
|
final bool isDesktop;
|
|
final List<String> options;
|
|
final String selectedValue;
|
|
final Function(String) onChanged;
|
|
|
|
const CustomRadioButtonWrapper({
|
|
Key? key,
|
|
required this.isFocused,
|
|
required this.isDesktop,
|
|
required this.options,
|
|
required this.selectedValue,
|
|
required this.onChanged,
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
_CustomRadioButtonWrapperState createState() => _CustomRadioButtonWrapperState();
|
|
}
|
|
|
|
class _CustomRadioButtonWrapperState extends State<CustomRadioButtonWrapper> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
"Select Destination",
|
|
style: TextStyle(fontSize: 12, fontWeight: FontWeight.bold, color: Colors.black),
|
|
),
|
|
SizedBox(height: 5),
|
|
Column(
|
|
children: widget.options.map((option) {
|
|
return RadioListTile<String>(
|
|
title: Text(option, style: TextStyle(fontSize: 12)),
|
|
value: option,
|
|
groupValue: widget.selectedValue,
|
|
onChanged: (value) {
|
|
if (value != null) {
|
|
widget.onChanged(value);
|
|
}
|
|
},
|
|
);
|
|
}).toList(),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|