28 lines
830 B
Dart
28 lines
830 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:niogu_app/core/constants/app_color.dart';
|
|
import 'package:sizer/sizer.dart';
|
|
|
|
class CheckboxButton extends StatelessWidget {
|
|
final bool isSelected;
|
|
const CheckboxButton({super.key, required this.isSelected});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AnimatedContainer(
|
|
duration: const Duration(milliseconds: 200),
|
|
width: 6.w,
|
|
height: 6.w,
|
|
decoration: BoxDecoration(
|
|
color: isSelected ? AppColor.primaryColor : Colors.white,
|
|
shape: BoxShape.circle,
|
|
border: Border.all(
|
|
color: isSelected ? AppColor.primaryColor : Colors.grey.shade400,
|
|
width: 2,
|
|
),
|
|
),
|
|
child: isSelected
|
|
? Icon(Icons.check, color: Colors.white, size: 4.w)
|
|
: null,
|
|
);
|
|
}
|
|
} |