Merge branch 'master' into master

This commit is contained in:
Salvatore Giordano
2020-10-11 11:56:10 +02:00
committed by GitHub
3 changed files with 30 additions and 14 deletions

View File

@@ -25,6 +25,15 @@ class CountryCodePicker extends StatefulWidget {
final TextOverflow textOverflow;
final Icon closeIcon;
/// Barrier color of ModalBottomSheet
final Color barrierColor;
/// Background color of ModalBottomSheet
final Color backgroundColor;
/// BoxDecoration for dialog
final BoxDecoration boxDecoration;
/// the size of the selection dialog
final Size dialogSize;
@@ -81,6 +90,9 @@ class CountryCodePicker extends StatefulWidget {
this.flagWidth = 32.0,
this.enabled = true,
this.textOverflow = TextOverflow.ellipsis,
this.barrierColor,
this.backgroundColor,
this.boxDecoration,
this.comparator,
this.countryFilter,
this.hideSearch = false,
@@ -230,8 +242,8 @@ class CountryCodePickerState extends State<CountryCodePicker> {
void showCountryCodePickerDialog() {
showMaterialModalBottomSheet(
barrierColor: Colors.grey.withOpacity(0.5),
backgroundColor: Colors.transparent,
barrierColor: widget.barrierColor ?? Colors.grey.withOpacity(0.5),
backgroundColor: widget.backgroundColor ?? Colors.transparent,
context: context,
builder: (context, scrollController) => SelectionDialog(
elements,
@@ -241,6 +253,7 @@ class CountryCodePickerState extends State<CountryCodePicker> {
searchDecoration: widget.searchDecoration,
searchStyle: widget.searchStyle,
textStyle: widget.dialogTextStyle,
boxDecoration: widget.boxDecoration,
showFlag: widget.showFlagDialog != null
? widget.showFlagDialog
: widget.showFlag,

View File

@@ -8,6 +8,7 @@ class SelectionDialog extends StatefulWidget {
final InputDecoration searchDecoration;
final TextStyle searchStyle;
final TextStyle textStyle;
final BoxDecoration boxDecoration;
final WidgetBuilder emptySearchBuilder;
final bool showFlag;
final double flagWidth;
@@ -27,6 +28,7 @@ class SelectionDialog extends StatefulWidget {
InputDecoration searchDecoration = const InputDecoration(),
this.searchStyle,
this.textStyle,
this.boxDecoration,
this.showFlag,
this.flagWidth = 32,
this.size,
@@ -53,18 +55,19 @@ class _SelectionDialogState extends State<SelectionDialog> {
width: widget.size?.width ?? MediaQuery.of(context).size.width,
height:
widget.size?.height ?? MediaQuery.of(context).size.height * 0.85,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(25.0)),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(1),
spreadRadius: 5,
blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow
decoration: widget.boxDecoration ??
BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(25.0)),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(1),
spreadRadius: 5,
blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow
),
],
),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [

View File

@@ -7,7 +7,7 @@ environment:
sdk: ">=2.2.2 <3.0.0"
dependencies:
modal_bottom_sheet: 0.2.0
modal_bottom_sheet: ^0.2.0
flutter:
sdk: flutter