@@ -119,6 +119,11 @@ final class GenericDropdown extends StatefulWidget {
119
119
/// you need to ensure that the mouse events are passed to the dropdown.
120
120
final ToggleBuilder toggleBuilder;
121
121
122
+ /// The color of the barrier that is shown when the dropdown is open.
123
+ /// Defaults to `Colors.transparent` .
124
+ /// This spans the entire screen.
125
+ final Color barrierColor;
126
+
122
127
const GenericDropdown (
123
128
{super .key,
124
129
required this .contentBuilder,
@@ -127,6 +132,7 @@ final class GenericDropdown extends StatefulWidget {
127
132
required this .toggleBuilder,
128
133
this .closeOnOutsideTap = true ,
129
134
this .openOnRender = false ,
135
+ this .barrierColor = Colors .transparent,
130
136
this .offset = Offset .zero});
131
137
132
138
@override
@@ -445,7 +451,7 @@ final class _GenericDropdownState extends State<GenericDropdown> {
445
451
onTap: () => widget.closeOnOutsideTap ? _close () : null ,
446
452
child: Container (
447
453
alignment: Alignment .topLeft,
448
- color: Colors .transparent ,
454
+ color: widget.barrierColor ,
449
455
child: Stack (
450
456
children: [
451
457
StatefulBuilder (builder: (context, setState) {
0 commit comments