Skip to content
This repository was archived by the owner on Jan 29, 2026. It is now read-only.

Commit 7bc33fd

Browse files
author
logit
committed
fix issues with modal sheets
refactor SharePlus deprecated code fix deprecated code
1 parent 301635e commit 7bc33fd

40 files changed

+152
-103
lines changed

lib/app/views/components/player_placeholder.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class PlayerPlaceHolder extends StatelessWidget {
2424
padding: const EdgeInsets.symmetric(horizontal: 7),
2525
child: Container(
2626
decoration: BoxDecoration(
27-
color: colors.secondaryContainer.withOpacity(0.5),
27+
color: colors.secondaryContainer.withValues(alpha: 0.5),
2828
borderRadius: BorderRadius.circular(10),
2929
),
3030
child: Center(
@@ -33,7 +33,8 @@ class PlayerPlaceHolder extends StatelessWidget {
3333
opacity: showPlaceHolder ? 1 : 0,
3434
child: Icon(
3535
Icons.play_arrow_outlined,
36-
color: colors.onSecondaryContainer.withOpacity(0.3),
36+
color:
37+
colors.onSecondaryContainer.withValues(alpha: 0.3),
3738
)),
3839
),
3940
)),

lib/app/views/tv/screens/tv_home.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class TvHomeScreen extends StatelessWidget {
9999
curve: Curves.easeInOutQuad,
100100
decoration: BoxDecoration(
101101
color: homeState
102-
? colors.secondaryContainer.withOpacity(0.5)
102+
? colors.secondaryContainer.withValues(alpha: 0.5)
103103
: Colors.transparent),
104104
child: Padding(
105105
padding: EdgeInsets.only(
@@ -161,7 +161,7 @@ class TvHomeScreen extends StatelessWidget {
161161
},
162162
unfocusedColor: colors
163163
.secondaryContainer
164-
.withOpacity(0.0),
164+
.withValues(alpha: 0.0),
165165
child: Padding(
166166
padding:
167167
const EdgeInsets.all(8),
@@ -188,7 +188,7 @@ class TvHomeScreen extends StatelessWidget {
188188
homeCubit.menuItemFocusChanged,
189189
onPressed: (context) => openSettings(context),
190190
unfocusedColor: colors.secondaryContainer
191-
.withOpacity(0.0),
191+
.withValues(alpha: 0.0),
192192
child: Padding(
193193
padding: const EdgeInsets.all(8),
194194
child: Row(

lib/channels/models/channel.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@ class Channel implements ShareLinks {
4545
Map<String, dynamic> toJson() => _$ChannelToJson(this);
4646

4747
@override
48-
String getInvidiousLink(Server server, int? timestamp) {
49-
return '${server.url}/channel/$authorId';
48+
Uri getInvidiousLink(Server server, int? timestamp) {
49+
return Uri.parse('${server.url}/channel/$authorId');
5050
}
5151

5252
@override
53-
getRedirectLink(int? timestamp) {
54-
return 'https://redirect.invidious.io/channel/$authorId';
53+
Uri getRedirectLink(int? timestamp) {
54+
return Uri.parse('https://redirect.invidious.io/channel/$authorId');
5555
}
5656

5757
@override
58-
String getYoutubeLink(int? timestamp) {
59-
return 'https://www.youtube.com/channel/$authorId';
58+
Uri getYoutubeLink(int? timestamp) {
59+
return Uri.parse('https://www.youtube.com/channel/$authorId');
6060
}
6161
}

lib/channels/views/tv/screens/channel.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ class TvChannelScreen extends StatelessWidget {
8585
sigmaY: value,
8686
),
8787
child: AnimatedContainer(
88-
color: colors.surface.withOpacity(
89-
tv.showBackground
88+
color: colors.surface.withValues(
89+
alpha: tv.showBackground
9090
? overlayBackgroundOpacity
9191
: 0),
9292
duration: animationDuration,
@@ -107,9 +107,11 @@ class TvChannelScreen extends StatelessWidget {
107107
decoration: BoxDecoration(
108108
color: tv.showBackground
109109
? colors.surface
110-
.withOpacity(0)
110+
.withValues(
111+
alpha: 0)
111112
: colors.surface
112-
.withOpacity(1),
113+
.withValues(
114+
alpha: 1),
113115
borderRadius:
114116
BorderRadius.circular(
115117
35)),

lib/downloads/views/components/downloaded_video.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'package:clipious/utils.dart';
12
import 'package:flutter/material.dart';
23
import 'package:flutter_bloc/flutter_bloc.dart';
34
import 'package:clipious/l10n/generated/app_localizations.dart';
@@ -17,7 +18,7 @@ class DownloadedVideoView extends StatelessWidget {
1718
openVideoSheet(BuildContext context, DownloadedVideo v) {
1819
var cubit = context.read<DownloadManagerCubit>();
1920
final locals = AppLocalizations.of(context)!;
20-
showModalBottomSheet(
21+
showSafeModalBottomSheet(
2122
enableDrag: true,
2223
showDragHandle: true,
2324
context: context,

lib/home/views/screens/edit_layout.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ class SourceSwitcher extends StatelessWidget {
229229
child: Text(
230230
e.getLabel(locals),
231231
style: !enabled
232-
? TextStyle(color: colors.secondary.withOpacity(0.5))
232+
? TextStyle(color: colors.secondary.withValues(alpha: 0.5))
233233
: null,
234234
));
235235
}).toList(),

lib/main.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ class MyApp extends StatelessWidget {
262262
inactiveTrackColor: lightColorScheme.secondaryContainer),
263263
progressIndicatorTheme: ProgressIndicatorThemeData(
264264
circularTrackColor: lightColorScheme.secondaryContainer
265-
.withOpacity(0.8))),
265+
.withValues(alpha: 0.8))),
266266
darkTheme: ThemeData(
267267
useMaterial3: true,
268268
colorScheme: darkColorScheme,
@@ -272,8 +272,8 @@ class MyApp extends StatelessWidget {
272272
sliderTheme: sliderTheme.copyWith(
273273
inactiveTrackColor: darkColorScheme.secondaryContainer),
274274
progressIndicatorTheme: ProgressIndicatorThemeData(
275-
circularTrackColor:
276-
darkColorScheme.secondaryContainer.withOpacity(0.8))),
275+
circularTrackColor: darkColorScheme.secondaryContainer
276+
.withValues(alpha: 0.8))),
277277
);
278278
});
279279
});

lib/player/states/video_player.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ class VideoPlayerCubit extends MediaPlayerCubit<VideoPlayerState> {
355355
fit: fillVideo ? BoxFit.cover : BoxFit.contain,
356356
subtitlesConfiguration: BetterPlayerSubtitlesConfiguration(
357357
backgroundColor: settings.state.subtitlesBackground
358-
? Colors.black.withOpacity(0.8)
358+
? Colors.black.withValues(alpha: 0.8)
359359
: Colors.transparent,
360360
fontSize: settings.state.subtitleSize,
361361
outlineEnabled: true,

lib/player/views/components/mini_player_progress.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class MiniPlayerProgress extends StatelessWidget {
2525
constraints: const BoxConstraints(maxWidth: 300),
2626
height: 2,
2727
decoration: BoxDecoration(
28-
color: colors.primary.withOpacity(0.2),
28+
color: colors.primary.withValues(alpha: 0.2),
2929
borderRadius: BorderRadius.circular(20),
3030
),
3131
child: AnimatedFractionallySizedBox(

lib/player/views/components/player_controls.dart

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)