refs #59: add dialog size
This commit is contained in:
@@ -22,6 +22,9 @@ class CountryCodePicker extends StatefulWidget {
|
|||||||
final bool enabled;
|
final bool enabled;
|
||||||
final TextOverflow textOverflow;
|
final TextOverflow textOverflow;
|
||||||
|
|
||||||
|
/// the size of the selection dialog
|
||||||
|
final Size dialogSize;
|
||||||
|
|
||||||
/// used to customize the country list
|
/// used to customize the country list
|
||||||
final List<String> customList;
|
final List<String> customList;
|
||||||
|
|
||||||
@@ -74,6 +77,7 @@ class CountryCodePicker extends StatefulWidget {
|
|||||||
this.textOverflow = TextOverflow.ellipsis,
|
this.textOverflow = TextOverflow.ellipsis,
|
||||||
this.comparator,
|
this.comparator,
|
||||||
this.customList,
|
this.customList,
|
||||||
|
this.dialogSize,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -213,6 +217,7 @@ class _CountryCodePickerState extends State<CountryCodePicker> {
|
|||||||
searchStyle: widget.searchStyle,
|
searchStyle: widget.searchStyle,
|
||||||
showFlag: widget.showFlag || (widget.showFlagDialog == true),
|
showFlag: widget.showFlag || (widget.showFlagDialog == true),
|
||||||
flagWidth: widget.flagWidth,
|
flagWidth: widget.flagWidth,
|
||||||
|
size: widget.dialogSize,
|
||||||
),
|
),
|
||||||
).then((e) {
|
).then((e) {
|
||||||
if (e != null) {
|
if (e != null) {
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ class SelectionDialog extends StatefulWidget {
|
|||||||
final WidgetBuilder emptySearchBuilder;
|
final WidgetBuilder emptySearchBuilder;
|
||||||
final bool showFlag;
|
final bool showFlag;
|
||||||
final double flagWidth;
|
final double flagWidth;
|
||||||
|
final Size size;
|
||||||
|
|
||||||
/// elements passed as favorite
|
/// elements passed as favorite
|
||||||
final List<CountryCode> favoriteElements;
|
final List<CountryCode> favoriteElements;
|
||||||
@@ -24,6 +25,7 @@ class SelectionDialog extends StatefulWidget {
|
|||||||
this.searchStyle,
|
this.searchStyle,
|
||||||
this.showFlag,
|
this.showFlag,
|
||||||
this.flagWidth = 32,
|
this.flagWidth = 32,
|
||||||
|
this.size,
|
||||||
}) : assert(searchDecoration != null, 'searchDecoration must not be null!'),
|
}) : assert(searchDecoration != null, 'searchDecoration must not be null!'),
|
||||||
this.searchDecoration =
|
this.searchDecoration =
|
||||||
searchDecoration.copyWith(prefixIcon: Icon(Icons.search)),
|
searchDecoration.copyWith(prefixIcon: Icon(Icons.search)),
|
||||||
@@ -64,8 +66,9 @@ class _SelectionDialogState extends State<SelectionDialog> {
|
|||||||
),
|
),
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: MediaQuery.of(context).size.width,
|
width: widget.size?.width ?? MediaQuery.of(context).size.width,
|
||||||
height: MediaQuery.of(context).size.height * 0.7,
|
height:
|
||||||
|
widget.size?.height ?? MediaQuery.of(context).size.height * 0.7,
|
||||||
child: ListView(
|
child: ListView(
|
||||||
children: [
|
children: [
|
||||||
widget.favoriteElements.isEmpty
|
widget.favoriteElements.isEmpty
|
||||||
|
|||||||
Reference in New Issue
Block a user