This repository has been archived on 2024-10-18. You can view files and clone it, but cannot push or open issues or pull requests.
ftc_patient_app/lib/view/custom_widgets/custom_check_box.dart

52 lines
1.2 KiB
Dart

import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class CustomCheckBox extends StatelessWidget {
final bool checkBoxValue;
final String titleText;
final VoidCallback? onTap;
const CustomCheckBox({
super.key,
required this.checkBoxValue,
required this.titleText,
this.onTap,
});
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(
height: 25.h,
width: 25.w,
child: Checkbox(
value: checkBoxValue,
activeColor: CustomAppColors.kSecondaryColor,
onChanged: (_) {
if(onTap!=null) {
onTap!();
}
},
),
),
Padding(
padding: EdgeInsets.only(left: 8.0.w),
child: GestureDetector(
onTap: onTap,
child: CustomTextWidget(
text: titleText,
isExpanded: false,
fontWeight: FontWeight.w500,
fontSize: 12.sp,
),
),
),
],
);
}
}