Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion lib/country_code_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class CountryCodePicker extends StatefulWidget {
/// Background color of selection dialog
final Color? dialogBackgroundColor;

final Color? dialogBorderColor;

/// used to customize the country list
final List<String>? countryFilter;

Expand Down Expand Up @@ -116,6 +118,7 @@ class CountryCodePicker extends StatefulWidget {
this.showDropDownButton = false,
this.dialogSize,
this.dialogBackgroundColor,
this.dialogBorderColor,
this.closeIcon = const Icon(Icons.close),
this.countryList = codes,
Key? key,
Expand Down Expand Up @@ -285,7 +288,6 @@ class CountryCodePickerState extends State<CountryCodePicker> {
if (!UniversalPlatform.isAndroid && !UniversalPlatform.isIOS) {
showDialog(
barrierColor: widget.barrierColor ?? Colors.grey.withOpacity(0.5),
// backgroundColor: widget.backgroundColor ?? Colors.transparent,
context: context,
builder: (context) => Center(
child: Container(
Expand All @@ -306,6 +308,7 @@ class CountryCodePickerState extends State<CountryCodePicker> {
flagWidth: widget.flagWidth,
size: widget.dialogSize,
backgroundColor: widget.dialogBackgroundColor,
borderColor: widget.dialogBorderColor,
barrierColor: widget.barrierColor,
hideSearch: widget.hideSearch,
closeIcon: widget.closeIcon,
Expand Down
15 changes: 7 additions & 8 deletions lib/selection_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class SelectionDialog extends StatefulWidget {
/// Boxshaow color of SelectionDialog that matches CountryCodePicker barrier color
final Color? barrierColor;

final Color? borderColor;

/// elements passed as favorite
final List<CountryCode> favoriteElements;

Expand All @@ -43,6 +45,7 @@ class SelectionDialog extends StatefulWidget {
this.size,
this.backgroundColor,
this.barrierColor,
this.borderColor,
this.hideSearch = false,
this.closeIcon,
}) : this.searchDecoration = searchDecoration.prefixIcon == null
Expand All @@ -69,15 +72,11 @@ class _SelectionDialogState extends State<SelectionDialog> {
decoration: widget.boxDecoration ??
BoxDecoration(
color: widget.backgroundColor ?? Colors.white,
border: Border.all(
width: 3.0,
color: widget.borderColor ?? Colors.transparent,
),
borderRadius: BorderRadius.all(Radius.circular(8.0)),
boxShadow: [
BoxShadow(
color: widget.barrierColor ?? Colors.grey.withOpacity(1),
spreadRadius: 5,
blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow
),
],
),
child: Column(
mainAxisSize: MainAxisSize.min,
Expand Down