register user detail
This commit is contained in:
42
lib/shared/components/checkbox_widget.dart
Normal file
42
lib/shared/components/checkbox_widget.dart
Normal file
@@ -0,0 +1,42 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:tanami_app/core/styles/app_color.dart';
|
||||
|
||||
import 'bloc/checkbox/checkbox_bloc.dart';
|
||||
import 'bloc/checkbox/checkbox_event.dart';
|
||||
import 'bloc/checkbox/checkbox_state.dart';
|
||||
|
||||
class CheckBoxWidget extends StatelessWidget {
|
||||
const CheckBoxWidget({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<CheckboxBloc, CheckBoxState>(
|
||||
builder: (context, state) {
|
||||
return Checkbox(
|
||||
activeColor: AppColor.checkBoxActiveColor,
|
||||
checkColor: Colors.white,
|
||||
side: MaterialStateBorderSide.resolveWith(
|
||||
(states) {
|
||||
if (states.contains(MaterialState.selected)) {
|
||||
return const BorderSide(
|
||||
color: AppColor.checkBoxActiveColor, width: 2);
|
||||
}
|
||||
return const BorderSide(
|
||||
color: AppColor.strokeColor,
|
||||
width: 2,
|
||||
);
|
||||
},
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(6), // Custom radius
|
||||
),
|
||||
value: state is CheckboxChecked,
|
||||
onChanged: (value) {
|
||||
context.read<CheckboxBloc>().add(ToggleCheckbox());
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user