@@ -23,9 +23,10 @@ class PlayerControls extends StatelessWidget {
2323
2424 const PlayerControls ({super .key, this .mediaPlayerCubit});
2525
26- showPlaybackSpeedSelection (BuildContext context, MediaPlayerCubit player) {
26+ Future <void > showPlaybackSpeedSelection (
27+ BuildContext context, MediaPlayerCubit player) async {
2728 Navigator .of (context).pop ();
28- showModalBottomSheet (
29+ showSafeModalBottomSheet (
2930 isScrollControlled: true ,
3031 showDragHandle: true ,
3132 context: context,
@@ -69,10 +70,11 @@ class PlayerControls extends StatelessWidget {
6970 );
7071 }
7172
72- showPlayerTrackSelection (BuildContext context, PlayerControlsState _,
73+ Future <void > showPlayerTrackSelection (
74+ BuildContext context, PlayerControlsState _,
7375 {required List <String > tracks,
7476 required int selected,
75- required Function (int index) onSelected}) {
77+ required Function (int index) onSelected}) async {
7678 List <ListTile > widgets = [];
7779
7880 for (int i = 0 ; i < tracks.length; i++ ) {
@@ -86,7 +88,7 @@ class PlayerControls extends StatelessWidget {
8688 title: Text (tracks[i])));
8789 }
8890
89- showModalBottomSheet (
91+ showSafeModalBottomSheet (
9092 showDragHandle: true ,
9193 isScrollControlled: true ,
9294 context: context,
@@ -101,7 +103,7 @@ class PlayerControls extends StatelessWidget {
101103 );
102104 }
103105
104- showOptionMenu (BuildContext context, PlayerControlsState controls) {
106+ void showOptionMenu (BuildContext context, PlayerControlsState controls) {
105107 late MediaPlayerCubit pc;
106108 var player = context.read <PlayerCubit >();
107109 if (mediaPlayerCubit != null ) {
@@ -116,7 +118,7 @@ class PlayerControls extends StatelessWidget {
116118 var audioTracks = pc.getAudioTracks ();
117119 var subtitles = pc.getSubtitles ();
118120
119- showModalBottomSheet (
121+ showSafeModalBottomSheet (
120122 isScrollControlled: true ,
121123 showDragHandle: true ,
122124 context: context,
@@ -227,7 +229,7 @@ class PlayerControls extends StatelessWidget {
227229 inactiveTrackColor: darkColorScheme.secondaryContainer),
228230 progressIndicatorTheme: ProgressIndicatorThemeData (
229231 circularTrackColor:
230- darkColorScheme.secondaryContainer.withOpacity ( 0.8 ))),
232+ darkColorScheme.secondaryContainer.withValues (alpha : 0.8 ))),
231233 child: BlocProvider (
232234 create: (context) =>
233235 PlayerControlsCubit (const PlayerControlsState (), player),
@@ -308,7 +310,7 @@ class PlayerControls extends StatelessWidget {
308310 child: Container (
309311 padding: const EdgeInsets .all (8 ),
310312 decoration: BoxDecoration (
311- color: Colors .black.withOpacity ( 0.5 ),
313+ color: Colors .black.withValues (alpha : 0.5 ),
312314 borderRadius: BorderRadius .circular (20 )),
313315 child: Row (
314316 children: [
@@ -426,7 +428,7 @@ class PlayerControls extends StatelessWidget {
426428 )),
427429 if (playerState.errored)
428430 Container (
429- color: Colors .black.withOpacity ( 0.8 ),
431+ color: Colors .black.withValues (alpha : 0.8 ),
430432 child: const Center (
431433 child: Icon (Icons .error),
432434 ),
@@ -445,7 +447,8 @@ class PlayerControls extends StatelessWidget {
445447 decoration: BoxDecoration (
446448 borderRadius:
447449 BorderRadius .circular (0 ),
448- color: Colors .black.withOpacity (0.4 )),
450+ color: Colors .black
451+ .withValues (alpha: 0.4 )),
449452 child: Column (
450453 children: [
451454 Row (
@@ -467,8 +470,9 @@ class PlayerControls extends StatelessWidget {
467470 style: textTheme.bodyMedium
468471 ? .copyWith (
469472 color: Colors .white
470- .withOpacity (
471- 0.8 )),
473+ .withValues (
474+ alpha:
475+ 0.8 )),
472476 ),
473477 )),
474478 IconButton (
@@ -552,8 +556,8 @@ class PlayerControls extends StatelessWidget {
552556 begin: Alignment .bottomCenter,
553557 end: Alignment .topCenter,
554558 colors: [
555- Colors .black.withOpacity ( 1 ),
556- Colors .black.withOpacity ( 0 )
559+ Colors .black.withValues (alpha : 1 ),
560+ Colors .black.withValues (alpha : 0 )
557561 ]))
558562 : null ,
559563 child: Padding (
@@ -772,7 +776,7 @@ class DoubleTapButton extends StatelessWidget {
772776 curve: Curves .easeInOutQuad,
773777 margin: EdgeInsets .all (opacity == 1 ? 50 : 0 ),
774778 decoration: BoxDecoration (
775- color: Colors .black.withOpacity ( opacity == 1 ? 0.3 : 0 ),
779+ color: Colors .black.withValues (alpha : opacity == 1 ? 0.3 : 0 ),
776780 shape: BoxShape .circle),
777781 duration: const Duration (milliseconds: 150 ),
778782 height: double .infinity,
@@ -790,7 +794,7 @@ class DoubleTapButton extends StatelessWidget {
790794 Text (
791795 stepText,
792796 style: textTheme.bodySmall
793- ? .copyWith (color: Colors .white.withOpacity ( 0.8 )),
797+ ? .copyWith (color: Colors .white.withValues (alpha : 0.8 )),
794798 )
795799 ],
796800 ),
0 commit comments