Skip to content

Commit

Permalink
fixup! Fix cannot change language in setting view
Browse files Browse the repository at this point in the history
  • Loading branch information
dab246 committed Aug 21, 2024
1 parent 850905a commit c15cc6a
Showing 1 changed file with 42 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,57 +34,55 @@ class _LanguageMenuPopupDialogWidgetState extends State<LanguageMenuPopupDialogW

@override
Widget build(BuildContext context) {
return Semantics(
excludeSemantics: true,
return PortalTarget(
visible: _visible,
portalFollower: GestureDetector(
behavior: HitTestBehavior.opaque,
excludeFromSemantics: true,
onTap: () => setState(() => _visible = false)
),
child: PortalTarget(
visible: _visible,
portalFollower: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () => setState(() => _visible = false)
),
child: PortalTarget(
anchor: const Aligned(
anchor: const Aligned(
follower: Alignment.topRight,
target: Alignment.bottomRight,
widthFactor: 1,
backup: Aligned(
follower: Alignment.topRight,
target: Alignment.bottomRight,
widthFactor: 1,
backup: Aligned(
follower: Alignment.topRight,
target: Alignment.bottomRight,
widthFactor: 1,
),
),
portalFollower: LanguageRegionOverlay(
listSupportedLanguages: LocalizationService.supportedLocales,
localeSelected: widget.languageSelected,
maxWidth: widget.maxWidth,
onSelectLanguageAction: (locale) {
widget.onSelectLanguageAction(locale);
setState(() => _visible = false);
},
),
portalFollower: LanguageRegionOverlay(
listSupportedLanguages: LocalizationService.supportedLocales,
localeSelected: widget.languageSelected,
maxWidth: widget.maxWidth,
onSelectLanguageAction: (locale) {
setState(() => _visible = false);
widget.onSelectLanguageAction(locale);
},
),
visible: _visible,
child: TMailButtonWidget(
text: widget.languageSelected.getLanguageNameByCurrentLocale(context),
icon: _imagePaths.icDropDown,
textStyle: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.normal,
color: Colors.black
),
maxWidth: widget.maxWidth,
iconAlignment: TextDirection.rtl,
borderRadius: 10,
expandedText: true,
backgroundColor: AppColor.colorItemSelected,
padding: const EdgeInsetsDirectional.all(10),
border: Border.all(
color: AppColor.colorInputBorderCreateMailbox,
width: 0.5,
),
visible: _visible,
child: TMailButtonWidget(
text: widget.languageSelected.getLanguageNameByCurrentLocale(context),
icon: _imagePaths.icDropDown,
textStyle: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.normal,
color: Colors.black
),
maxWidth: widget.maxWidth,
iconAlignment: TextDirection.rtl,
borderRadius: 10,
expandedText: true,
backgroundColor: AppColor.colorItemSelected,
padding: const EdgeInsetsDirectional.all(10),
border: Border.all(
color: AppColor.colorInputBorderCreateMailbox,
width: 0.5,
),
onTapActionCallback: () => setState(() => _visible = true)
)
onTapActionCallback: () => setState(() => _visible = true)
)
),
)
);
}
}

0 comments on commit c15cc6a

Please sign in to comment.