45 lines
1.2 KiB
Dart
45 lines
1.2 KiB
Dart
import 'package:enaklo_pos/core/constants/colors.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
class VoidRadio extends StatelessWidget {
|
|
final String voidType;
|
|
final String value;
|
|
final Function(String?)? 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 ? AppColors.primary : Colors.grey[300]!,
|
|
width: voidType == value ? 2 : 1,
|
|
),
|
|
borderRadius: BorderRadius.circular(8),
|
|
),
|
|
child: RadioListTile<String>(
|
|
title: Text(
|
|
title,
|
|
style: TextStyle(fontWeight: FontWeight.w600),
|
|
),
|
|
subtitle: Text(
|
|
subtitle,
|
|
style: TextStyle(fontSize: 12, color: Colors.grey[600]),
|
|
),
|
|
value: value,
|
|
groupValue: voidType,
|
|
activeColor: AppColors.primary,
|
|
onChanged: onChanged),
|
|
);
|
|
}
|
|
}
|