Skip to content

Commit

Permalink
Fix cannot click item dropdown menu
Browse files Browse the repository at this point in the history
  • Loading branch information
dab246 committed Aug 14, 2024
1 parent 920ea8a commit c34f1b4
Show file tree
Hide file tree
Showing 7 changed files with 186 additions and 165 deletions.
43 changes: 23 additions & 20 deletions lib/features/base/widget/drop_down_button_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,26 +78,29 @@ class DropDownButtonWidget<T> extends StatelessWidget {
items: items
.map((item) => DropdownMenuItem<T>(
value: item,
child: PointerInterceptor(
child: Container(
color: Colors.transparent,
height: heightItem,
child: Row(children: [
Expanded(child: Text(_getTextItemDropdown(context, item: item),
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.normal,
color: Colors.black),
maxLines: 1,
softWrap: CommonTextStyle.defaultSoftWrap,
overflow: CommonTextStyle.defaultTextOverFlow,
)),
if (supportSelectionIcon && item == itemSelected)
SvgPicture.asset(imagePaths.icChecked,
width: sizeIconChecked,
height: sizeIconChecked,
fit: BoxFit.fill)
]),
child: Semantics(
excludeSemantics: true,
child: PointerInterceptor(
child: Container(
color: Colors.transparent,
height: heightItem,
child: Row(children: [
Expanded(child: Text(_getTextItemDropdown(context, item: item),
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.normal,
color: Colors.black),
maxLines: 1,
softWrap: CommonTextStyle.defaultSoftWrap,
overflow: CommonTextStyle.defaultTextOverFlow,
)),
if (supportSelectionIcon && item == itemSelected)
SvgPicture.asset(imagePaths.icChecked,
width: sizeIconChecked,
height: sizeIconChecked,
fit: BoxFit.fill)
]),
),
),
),
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,15 @@ class DropDownMenuHeaderStyleWidget extends StatelessWidget {
items: items
.map((item) => DropdownMenuItem<HeaderStyleType>(
value: item,
child: PointerInterceptor(
child: Container(
color: Colors.transparent,
height: heightItem,
alignment: Alignment.centerLeft,
child: _buildItemDropdown(item),
child: Semantics(
excludeSemantics: true,
child: PointerInterceptor(
child: Container(
color: Colors.transparent,
height: heightItem,
alignment: Alignment.centerLeft,
child: _buildItemDropdown(item),
),
),
),
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,57 +68,60 @@ class FromComposerDropDownWidget extends StatelessWidget {
isExpanded: false,
items: items.map((item) => DropdownMenuItem<Identity>(
value: item,
child: PointerInterceptor(
child: Container(
color: Colors.transparent,
padding: FromComposerDropDownWidgetStyle.dropdownItemPadding,
child: Row(
children: [
Container(
width: FromComposerDropDownWidgetStyle.avatarSize,
height: FromComposerDropDownWidgetStyle.avatarSize,
alignment: Alignment.center,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: AppColor.avatarColor,
border: Border.all(
color: AppColor.colorShadowBgContentEmail,
width: FromComposerDropDownWidgetStyle.avatarBorderWidth
)
),
child: Text(
item.name!.isNotEmpty
? item.name!.firstLetterToUpperCase
: item.email!.firstLetterToUpperCase,
style: FromComposerDropDownWidgetStyle.avatarTextStyle,
),
),
const SizedBox(width: FromComposerDropDownWidgetStyle.dropdownItemSpace),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (item.name!.isNotEmpty)
Text(
item.name!,
maxLines: 1,
softWrap: CommonTextStyle.defaultSoftWrap,
overflow: CommonTextStyle.defaultTextOverFlow,
style: FromComposerDropDownWidgetStyle.dropdownItemTitleTextStyle,
),
if (item.email!.isNotEmpty)
Text(
item.email!,
maxLines: 1,
softWrap: CommonTextStyle.defaultSoftWrap,
overflow: CommonTextStyle.defaultTextOverFlow,
style: FromComposerDropDownWidgetStyle.dropdownItemSubTitleTextStyle,
)
],
child: Semantics(
excludeSemantics: true,
child: PointerInterceptor(
child: Container(
color: Colors.transparent,
padding: FromComposerDropDownWidgetStyle.dropdownItemPadding,
child: Row(
children: [
Container(
width: FromComposerDropDownWidgetStyle.avatarSize,
height: FromComposerDropDownWidgetStyle.avatarSize,
alignment: Alignment.center,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: AppColor.avatarColor,
border: Border.all(
color: AppColor.colorShadowBgContentEmail,
width: FromComposerDropDownWidgetStyle.avatarBorderWidth
)
),
child: Text(
item.name!.isNotEmpty
? item.name!.firstLetterToUpperCase
: item.email!.firstLetterToUpperCase,
style: FromComposerDropDownWidgetStyle.avatarTextStyle,
),
),
)
],
const SizedBox(width: FromComposerDropDownWidgetStyle.dropdownItemSpace),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (item.name!.isNotEmpty)
Text(
item.name!,
maxLines: 1,
softWrap: CommonTextStyle.defaultSoftWrap,
overflow: CommonTextStyle.defaultTextOverFlow,
style: FromComposerDropDownWidgetStyle.dropdownItemTitleTextStyle,
),
if (item.email!.isNotEmpty)
Text(
item.email!,
maxLines: 1,
softWrap: CommonTextStyle.defaultSoftWrap,
overflow: CommonTextStyle.defaultTextOverFlow,
style: FromComposerDropDownWidgetStyle.dropdownItemSubTitleTextStyle,
)
],
),
)
],
),
),
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,29 @@ class ItemMenuFontSizeWidget extends StatelessWidget {

@override
Widget build(BuildContext context) {
return PointerInterceptor(
child: Container(
alignment: Alignment.center,
color: Colors.transparent,
child: Stack(
return Semantics(
excludeSemantics: true,
child: PointerInterceptor(
child: Container(
alignment: Alignment.center,
children: [
Text(
'$value',
style: ItemMenuFontSizeWidgetStyle.labelTextStyle,
),
if (value == selectedValue)
Align(
alignment: AlignmentDirectional.centerStart,
child: Padding(
padding: ItemMenuFontSizeWidgetStyle.selectIconPadding,
child: SvgPicture.asset(_imagePaths.icSelectedSB),
color: Colors.transparent,
child: Stack(
alignment: Alignment.center,
children: [
Text(
'$value',
style: ItemMenuFontSizeWidgetStyle.labelTextStyle,
),
if (value == selectedValue)
Align(
alignment: AlignmentDirectional.centerStart,
child: Padding(
padding: ItemMenuFontSizeWidgetStyle.selectIconPadding,
child: SvgPicture.asset(_imagePaths.icSelectedSB),
)
)
)
],
],
),
),
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,29 +108,32 @@ class DateSelectionDropDownButton extends StatelessWidget {
) {
return DropdownMenuItem<EmailRecoveryTimeType>(
value: recoveryTime,
child: PointerInterceptor(
child: Container(
color: Colors.transparent,
height: DateSelectionDropdownButtonStyles.height,
child: Row(
children: [
Expanded(
child: Text(
recoveryTime.getTitle(context),
style: DateSelectionDropdownButtonStyles.selectedValueTexStyle,
maxLines: 1,
softWrap: CommonTextStyle.defaultSoftWrap,
overflow: CommonTextStyle.defaultTextOverFlow,
)
),
if (recoveryTime == recoveryTimeSelected)
SvgPicture.asset(
imagePaths.icChecked,
width: DateSelectionDropdownButtonStyles.checkedIconSize,
height: DateSelectionDropdownButtonStyles.checkedIconSize,
fit: BoxFit.fill
)
]
child: Semantics(
excludeSemantics: true,
child: PointerInterceptor(
child: Container(
color: Colors.transparent,
height: DateSelectionDropdownButtonStyles.height,
child: Row(
children: [
Expanded(
child: Text(
recoveryTime.getTitle(context),
style: DateSelectionDropdownButtonStyles.selectedValueTexStyle,
maxLines: 1,
softWrap: CommonTextStyle.defaultSoftWrap,
overflow: CommonTextStyle.defaultTextOverFlow,
)
),
if (recoveryTime == recoveryTimeSelected)
SvgPicture.asset(
imagePaths.icChecked,
width: DateSelectionDropdownButtonStyles.checkedIconSize,
height: DateSelectionDropdownButtonStyles.checkedIconSize,
fit: BoxFit.fill
)
]
),
),
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,30 +106,33 @@ class DateDropDownButton extends StatelessWidget {
) {
return DropdownMenuItem<EmailReceiveTimeType>(
value: receiveTime,
child: PointerInterceptor(
child: Container(
color: Colors.transparent,
height: 44,
child: Row(children: [
Expanded(child: Text(
receiveTime.getTitle(context),
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.normal,
color: Colors.black
),
maxLines: 1,
softWrap: CommonTextStyle.defaultSoftWrap,
overflow: CommonTextStyle.defaultTextOverFlow,
)),
if (receiveTime == receiveTimeSelected)
SvgPicture.asset(
imagePaths.icChecked,
width: 20,
height: 20,
fit: BoxFit.fill
)
]),
child: Semantics(
excludeSemantics: true,
child: PointerInterceptor(
child: Container(
color: Colors.transparent,
height: 44,
child: Row(children: [
Expanded(child: Text(
receiveTime.getTitle(context),
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.normal,
color: Colors.black
),
maxLines: 1,
softWrap: CommonTextStyle.defaultSoftWrap,
overflow: CommonTextStyle.defaultTextOverFlow,
)),
if (receiveTime == receiveTimeSelected)
SvgPicture.asset(
imagePaths.icChecked,
width: 20,
height: 20,
fit: BoxFit.fill
)
]),
),
),
),
);
Expand Down
Loading

0 comments on commit c34f1b4

Please sign in to comment.