diff --git a/lib/blip_ds.dart b/lib/blip_ds.dart index 624125b6..c7f25ac5 100644 --- a/lib/blip_ds.dart +++ b/lib/blip_ds.dart @@ -18,6 +18,7 @@ export 'src/extensions/ds_delivery_report_status.extension.dart' show DSDeliveryReportStatusExtension; export 'src/extensions/ds_string.extension.dart' show DSStringExtension; export 'src/models/ds_calls_media_message.model.dart' show DSCallsMediaMessage; +export 'src/models/ds_country.model.dart' show DSCountry; export 'src/models/ds_message_bubble_avatar_config.model.dart' show DSMessageBubbleAvatarConfig; export 'src/models/ds_message_bubble_style.model.dart' diff --git a/lib/src/widgets/fields/ds_phone_input.widget.dart b/lib/src/widgets/fields/ds_phone_input.widget.dart index bc72bbbb..a1f774c9 100644 --- a/lib/src/widgets/fields/ds_phone_input.widget.dart +++ b/lib/src/widgets/fields/ds_phone_input.widget.dart @@ -27,6 +27,7 @@ class DSPhoneInput extends StatefulWidget { this.errorText, this.onChanged, this.shouldFocus = false, + this.initialCountry, }); final TextEditingController controller; @@ -36,6 +37,7 @@ class DSPhoneInput extends StatefulWidget { final ValueChanged? onChanged; final bool shouldFocus; final void Function(DSCountry)? onChangeCountry; + final DSCountry? initialCountry; @override State createState() => _DSPhoneInputState(); @@ -65,7 +67,10 @@ class _DSPhoneInputState extends State { _borderColor.value = _color(); }); - DSBottomSheetCountries.selectedCountry.value = null; + _dropdownValue.value = + widget.initialCountry ?? (DSUtils.countriesList.first); + + DSBottomSheetCountries.selectedCountry.value = widget.initialCountry; widget.onChangeCountry?.call(_dropdownValue.value); } diff --git a/lib/src/widgets/utils/ds_bottomsheet_countries.widget.dart b/lib/src/widgets/utils/ds_bottomsheet_countries.widget.dart index d038983e..af5679ac 100644 --- a/lib/src/widgets/utils/ds_bottomsheet_countries.widget.dart +++ b/lib/src/widgets/utils/ds_bottomsheet_countries.widget.dart @@ -45,12 +45,12 @@ abstract class DSBottomSheetCountries { ), DSIconButton( onPressed: () { - Get.back( - result: selectedCountry.value, - ); + Get.back(); }, - icon: const Icon(DSIcons.close_outline, - color: DSColors.neutralDarkRooftop), + icon: const Icon( + DSIcons.close_outline, + color: DSColors.neutralDarkRooftop, + ), ), ], ),