add carton editor for mix carton
This commit is contained in:
33
lib/pages/widgets/local_radio.dart
Normal file
33
lib/pages/widgets/local_radio.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../helpers/theme.dart';
|
||||
|
||||
class LocalRadio<T> extends StatelessWidget {
|
||||
final Function(T?)? onChanged;
|
||||
final T value;
|
||||
final T? groupValue;
|
||||
|
||||
const LocalRadio(
|
||||
{super.key, this.onChanged, required this.value, this.groupValue});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Radio<T>(
|
||||
fillColor: MaterialStateProperty.resolveWith((states) {
|
||||
// active
|
||||
if (states.contains(MaterialState.selected)) {
|
||||
return primaryColor;
|
||||
}
|
||||
// inactive
|
||||
return labelColor;
|
||||
}),
|
||||
visualDensity: const VisualDensity(
|
||||
horizontal: VisualDensity.minimumDensity,
|
||||
vertical: VisualDensity.minimumDensity),
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
activeColor: primaryColor,
|
||||
groupValue: groupValue,
|
||||
value: value,
|
||||
onChanged: onChanged);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user