Skip to content

Commit

Permalink
remove video like buttom from mini controls because it is broken
Browse files Browse the repository at this point in the history
fix first time wizard that could not play videos after set up without restarting the app
  • Loading branch information
lamarios committed Apr 5, 2023
1 parent 2b5f3c6 commit d403818
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 41 deletions.
6 changes: 3 additions & 3 deletions lib/controllers/playlistController.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ class PlaylistController extends GetxController {
Future<bool> removeVideoFromPlayList(VideoInList v) async {
await service.deleteUserPlaylistVideo(playlist.playlistId, v.indexId ?? '');
PlaylistListController.to(tag: PlaylistListController.getTag(userPlayListTag))?.refreshPlaylists();

playlist.videos.remove(v);
update();

return false;
}

play(){
MiniPlayerController.to()?.playVideo(playlist.videos, goBack: false);
play() {
MiniPlayerController.to()?.playVideo(playlist.videos, goBack: false);
}

getAllVideos() async {
Expand Down
1 change: 0 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ class _HomeState extends State<Home> with AfterLayoutMixin {
IconButton(
onPressed: () => openSettings(context),
icon: const Icon(Icons.settings),
color: colorScheme.secondary,
),
],
),
Expand Down
3 changes: 1 addition & 2 deletions lib/views/components/videoAddToPlaylistButton.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class VideoAddToPlaylistButton extends StatelessWidget {
onPressed: () => AddToPlaylist.showAddToPlaylistDialog(context, _.videoId!),
icon: Icon(
Icons.add,
color: colors.secondary,
),
),
_.playListCount > 0
Expand All @@ -33,7 +32,7 @@ class VideoAddToPlaylistButton extends StatelessWidget {
right: 10,
child: Text(
_.playListCount.toString(),
style: TextStyle(color: colors.secondary, fontSize: 8),
style: const TextStyle(fontSize: 8),
),
)
: const SizedBox.shrink()
Expand Down
1 change: 0 additions & 1 deletion lib/views/components/videoLikeButton.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class VideoLikeButton extends StatelessWidget {
iconSize: size,
onPressed: _.toggleLike,
icon: _.isVideoLiked ? const Icon(Icons.favorite) : const Icon(Icons.favorite_border),
color: colors.secondary,
),
),
);
Expand Down
16 changes: 8 additions & 8 deletions lib/views/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ class Settings extends StatelessWidget {
const Settings({super.key});

manageServers(BuildContext context) {
navigatorKey.currentState?.push( MaterialPageRoute(settings: ROUTE_SETTINGS_MANAGE_SERVERS, builder: (context) => const ManageServers()));
navigatorKey.currentState?.push(MaterialPageRoute(settings: ROUTE_SETTINGS_MANAGE_SERVERS, builder: (context) => const ManageServers()));
}

openSponsorBlockSettings(BuildContext context) {
Navigator.push(context, MaterialPageRoute(settings: ROUTE_SETTINGS_SPONSOR_BLOCK, builder: (context) => const SponsorBlockSettings()));
navigatorKey.currentState?.push(MaterialPageRoute(settings: ROUTE_SETTINGS_SPONSOR_BLOCK, builder: (context) => const SponsorBlockSettings()));
}

searchCountry(BuildContext context, SettingsController controller) {
Expand Down Expand Up @@ -116,16 +116,16 @@ class Settings extends StatelessWidget {
title: Text(locals.useDash),
description: Text(locals.useDashDescription),
),

SettingsTile.switchTile(
initialValue: _.useProxy,
onToggle: _.toggleProxy,
title: Text(locals.useProxy),
description: Text(locals.useProxyDescription),
),
SettingsTile.navigation(
title: Text('SponsorBlock'),
description: Text(locals.sponsorBlockDescription),onPressed: openSponsorBlockSettings,
description: Text(locals.useProxyDescription),
),
SettingsTile.navigation(
title: Text('SponsorBlock'),
description: Text(locals.sponsorBlockDescription),
onPressed: openSponsorBlockSettings,
)
]),
SettingsSection(
Expand Down
44 changes: 21 additions & 23 deletions lib/views/settings/sponsorBlockSettings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,27 @@ class SponsorBlockSettings extends StatelessWidget {
init: SponsorBlockSettingsController(),
global: false,
builder: (_) {
return MiniPlayerAware(
child: Scaffold(
appBar: AppBar(
scrolledUnderElevation: 0,
title: const Text('SponsorBlock'),
),
backgroundColor: colorScheme.background,
body: SafeArea(
bottom: false,
child: SettingsList(lightTheme: theme, darkTheme: theme, sections: [
SettingsSection(
title: Text(locals.sponsorBlockSettingsQuickDescription),
tiles: SponsorSegmentType.values
.map((t) => SettingsTile.switchTile(
initialValue: _.value(t),
onToggle: (bool value) => _.setValue(t, value),
title: Text(SponsorSegmentType.getLabel(t, locals)),
description: Text(SponsorSegmentType.getDescription(t, locals)),
))
.toList()),
]),
)),
);
return Scaffold(
appBar: AppBar(
scrolledUnderElevation: 0,
title: const Text('SponsorBlock'),
),
backgroundColor: colorScheme.background,
body: SafeArea(
bottom: false,
child: SettingsList(lightTheme: theme, darkTheme: theme, sections: [
SettingsSection(
title: Text(locals.sponsorBlockSettingsQuickDescription),
tiles: SponsorSegmentType.values
.map((t) => SettingsTile.switchTile(
initialValue: _.value(t),
onToggle: (bool value) => _.setValue(t, value),
title: Text(SponsorSegmentType.getLabel(t, locals)),
description: Text(SponsorSegmentType.getDescription(t, locals)),
))
.toList()),
]),
));
},
);
}
Expand Down
1 change: 0 additions & 1 deletion lib/views/video.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class VideoView extends StatelessWidget {
child: IconButton(
onPressed: () => showSharingSheet(context, _.video!),
icon: const Icon(Icons.share),
color: colorScheme.secondary,
),
),
VideoLikeButton(videoId: _.video?.videoId),
Expand Down
2 changes: 1 addition & 1 deletion lib/views/videoPlayer/miniPlayerControls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class MiniPlayerControls extends StatelessWidget {
builder: (_) => Stack(
alignment: Alignment.center,
children: [
Positioned(left: 0, child: VideoLikeButton(videoId: videoId, style: buttonStyle)),
// Positioned(left: 0, child: VideoLikeButton(videoId: videoId, style: buttonStyle)),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expand Down
2 changes: 1 addition & 1 deletion lib/views/welcomeWizard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class WelcomeWizard extends StatelessWidget {
child: FilledButton.tonal(
onPressed: _.selected != null
? () {
navigatorKey.currentState?.pushReplacement(MaterialPageRoute(
navigatorKey.currentState?.push(MaterialPageRoute(
builder: (context) => const Home(),
));
}
Expand Down

0 comments on commit d403818

Please sign in to comment.