@@ -161,7 +161,7 @@ class _MaterialControlsState extends State<MaterialControls>
161
161
);
162
162
}
163
163
164
- Widget _buildOptionsButton ( ) {
164
+ List < OptionItem > _buildOptions ( BuildContext context ) {
165
165
final options = < OptionItem > [
166
166
OptionItem (
167
167
onTap: (context) async {
@@ -178,7 +178,10 @@ class _MaterialControlsState extends State<MaterialControls>
178
178
chewieController.additionalOptions !(context).isNotEmpty) {
179
179
options.addAll (chewieController.additionalOptions !(context));
180
180
}
181
+ return options;
182
+ }
181
183
184
+ Widget _buildOptionsButton () {
182
185
return AnimatedOpacity (
183
186
opacity: notifier.hideStuff ? 0.0 : 1.0 ,
184
187
duration: const Duration (milliseconds: 250 ),
@@ -187,14 +190,14 @@ class _MaterialControlsState extends State<MaterialControls>
187
190
_hideTimer? .cancel ();
188
191
189
192
if (chewieController.optionsBuilder != null ) {
190
- await chewieController.optionsBuilder !(context, options );
193
+ await chewieController.optionsBuilder !(context, _buildOptions (context) );
191
194
} else {
192
195
await showModalBottomSheet <OptionItem >(
193
196
context: context,
194
197
isScrollControlled: true ,
195
198
useRootNavigator: chewieController.useRootNavigator,
196
199
builder: (context) => OptionsDialog (
197
- options: options ,
200
+ options: _buildOptions (context) ,
198
201
cancelButtonText:
199
202
chewieController.optionsTranslation? .cancelButtonText,
200
203
),
0 commit comments