48 lines
1.2 KiB
Dart
48 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../../../../common/theme/theme.dart';
|
|
import '../../../../common/types/void_type.dart';
|
|
|
|
class VoidRadio extends StatelessWidget {
|
|
final VoidType voidType;
|
|
final VoidType value;
|
|
final Function(VoidType?)? onChanged;
|
|
final String title;
|
|
final String subtitle;
|
|
const VoidRadio({
|
|
super.key,
|
|
required this.voidType,
|
|
required this.value,
|
|
this.onChanged,
|
|
required this.title,
|
|
required this.subtitle,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
decoration: BoxDecoration(
|
|
border: Border.all(
|
|
color: voidType == value ? AppColor.primary : Colors.grey[300]!,
|
|
width: voidType == value ? 2 : 1,
|
|
),
|
|
borderRadius: BorderRadius.circular(8),
|
|
),
|
|
child: RadioListTile<VoidType>(
|
|
title: Text(
|
|
title,
|
|
style: AppStyle.md.copyWith(fontWeight: FontWeight.w600),
|
|
),
|
|
subtitle: Text(
|
|
subtitle,
|
|
style: AppStyle.sm.copyWith(color: AppColor.textSecondary),
|
|
),
|
|
value: value,
|
|
groupValue: voidType,
|
|
activeColor: AppColor.primary,
|
|
onChanged: onChanged,
|
|
),
|
|
);
|
|
}
|
|
}
|