|
@@ -1,5 +1,6 @@
|
|
|
import 'package:cs_resources/constants/color_constants.dart';
|
|
|
import 'package:cs_resources/generated/assets.dart';
|
|
|
+import 'package:cs_resources/theme/app_colors_theme.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:shared/utils/log_utils.dart';
|
|
|
import 'package:widgets/ext/ex_widget.dart';
|
|
@@ -12,7 +13,8 @@ class CustomCheckBox extends StatefulWidget {
|
|
|
final List<String> selectedOptions; // 已选中的选项列表
|
|
|
final Color textColor;
|
|
|
|
|
|
- const CustomCheckBox({super.key,
|
|
|
+ const CustomCheckBox({
|
|
|
+ super.key,
|
|
|
required this.options,
|
|
|
required this.onOptionsSelected,
|
|
|
required this.selectedOptions,
|
|
@@ -62,7 +64,6 @@ class _CustomCheckBoxState extends State<CustomCheckBox> {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
return Wrap(
|
|
@@ -73,6 +74,7 @@ class _CustomCheckBoxState extends State<CustomCheckBox> {
|
|
|
String option = entry.value;
|
|
|
return _buildCheckBoxWithIconAndText(
|
|
|
path: _selectedIndexes.contains(index) ? Assets.baseServiceCheckBoxChecked : Assets.baseServiceCheckBoxUncheck,
|
|
|
+ iconColor: _selectedIndexes.contains(index) ? context.appColors.textPrimary : Colors.transparent,
|
|
|
text: option,
|
|
|
value: _selectedIndexes.contains(index),
|
|
|
onChanged: (isChecked) {
|
|
@@ -96,6 +98,7 @@ class _CustomCheckBoxState extends State<CustomCheckBox> {
|
|
|
|
|
|
Widget _buildCheckBoxWithIconAndText({
|
|
|
required String path,
|
|
|
+ Color? iconColor,
|
|
|
required String text,
|
|
|
required bool value,
|
|
|
required Function(bool) onChanged,
|
|
@@ -103,7 +106,12 @@ class _CustomCheckBoxState extends State<CustomCheckBox> {
|
|
|
return Row(
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
children: <Widget>[
|
|
|
- MyAssetImage(path, width: 15.5, height: 15.5),
|
|
|
+ MyAssetImage(
|
|
|
+ path,
|
|
|
+ color: iconColor,
|
|
|
+ width: 15.5,
|
|
|
+ height: 15.5,
|
|
|
+ ),
|
|
|
const SizedBox(width: 10),
|
|
|
MyTextView(
|
|
|
text,
|