void
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
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,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user