add hideMainText property

This commit is contained in:
Salvatore Giordano
2020-05-16 13:12:56 +02:00
parent c46aa1c40e
commit 7056cc1ffa
2 changed files with 14 additions and 9 deletions

View File

@@ -42,6 +42,8 @@ class CountryCodePicker extends StatefulWidget {
/// shows the flag
final bool showFlag;
final bool hideMainText;
final bool showFlagMain;
final bool showFlagDialog;
@@ -71,6 +73,7 @@ class CountryCodePicker extends StatefulWidget {
this.alignLeft = false,
this.showFlag = true,
this.showFlagDialog,
this.hideMainText = false,
this.showFlagMain,
this.builder,
this.flagWidth = 32.0,
@@ -149,16 +152,17 @@ class CountryCodePickerState extends State<CountryCodePicker> {
),
),
),
Flexible(
fit: widget.alignLeft ? FlexFit.tight : FlexFit.loose,
child: Text(
widget.showOnlyCountryWhenClosed
? selectedItem.toCountryStringOnly()
: selectedItem.toString(),
style: widget.textStyle ?? Theme.of(context).textTheme.button,
overflow: widget.textOverflow,
if (!widget.hideMainText)
Flexible(
fit: widget.alignLeft ? FlexFit.tight : FlexFit.loose,
child: Text(
widget.showOnlyCountryWhenClosed
? selectedItem.toCountryStringOnly()
: selectedItem.toString(),
style: widget.textStyle ?? Theme.of(context).textTheme.button,
overflow: widget.textOverflow,
),
),
),
],
),
);