Skip to content
This repository has been archived by the owner on Jul 20, 2022. It is now read-only.

add isDialog #166

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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: 6 additions & 1 deletion lib/country_code_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ class CountryCodePicker extends StatefulWidget {
final TextOverflow textOverflow;
final Icon closeIcon;

// allow user to keep showing dialog instead of bottom sheet for their own login
final bool isDialog;

/// Barrier color of ModalBottomSheet
final Color? barrierColor;

Expand Down Expand Up @@ -117,6 +120,7 @@ class CountryCodePicker extends StatefulWidget {
this.dialogSize,
this.dialogBackgroundColor,
this.closeIcon = const Icon(Icons.close),
this.isDialog = false,
this.countryList = codes,
Key? key,
}) : super(key: key);
Expand Down Expand Up @@ -282,7 +286,8 @@ class CountryCodePickerState extends State<CountryCodePicker> {
}

void showCountryCodePickerDialog() {
if (!UniversalPlatform.isAndroid && !UniversalPlatform.isIOS) {
if ((!UniversalPlatform.isAndroid && !UniversalPlatform.isIOS) ||
widget.isDialog) {
showDialog(
barrierColor: widget.barrierColor ?? Colors.grey.withOpacity(0.5),
// backgroundColor: widget.backgroundColor ?? Colors.transparent,
Expand Down