Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BrnSimpleSelection add themeData #420

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/src/components/selection/brn_simple_selection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:bruno/src/components/selection/bean/brn_filter_entity.dart';
import 'package:bruno/src/components/selection/bean/brn_selection_common_entity.dart';
import 'package:bruno/src/components/selection/brn_selection_view.dart';
import 'package:bruno/src/constants/brn_constants.dart';
import 'package:bruno/src/theme/configs/brn_selection_config.dart';
import 'package:flutter/material.dart';

typedef BrnSimpleSelectionOnSelectionChanged = void Function(
Expand Down Expand Up @@ -35,6 +36,9 @@ class BrnSimpleSelection extends StatefulWidget {
/// 是否单选 默认 radio模式 is true , checkbox模式 is false
final bool isRadio;

/// SelectionView 配置
final BrnSelectionConfig? themeData;

/// 单选构造函数
BrnSimpleSelection.radio({
Key? key,
Expand All @@ -44,6 +48,7 @@ class BrnSimpleSelection extends StatefulWidget {
required this.items,
required this.onSimpleSelectionChanged,
this.onMenuItemClick,
this.themeData,
}) : this.isRadio = true,
this.maxSelectedCount = BrnSelectionConstant.maxSelectCount,
super(key: key);
Expand All @@ -58,6 +63,7 @@ class BrnSimpleSelection extends StatefulWidget {
required this.items,
required this.onSimpleSelectionChanged,
this.onMenuItemClick,
this.themeData,
}) : this.isRadio = false,
super(key: key);

Expand Down Expand Up @@ -103,6 +109,7 @@ class BrnSimpleSelectionState extends State<BrnSimpleSelection> {
@override
Widget build(BuildContext context) {
return BrnSelectionView(
themeData: widget.themeData,
originalSelectionData: selectionEntityList,
onSelectionChanged:
(menuIndex, selectedParams, customParams, setCustomTitleFunction) {
Expand Down