mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 16:05:18 +00:00
feat: add create playlist button in add playlist dialog
This commit is contained in:
parent
8184555ee8
commit
2168a640af
@ -1,9 +1,11 @@
|
|||||||
import 'package:fl_query_hooks/fl_query_hooks.dart';
|
import 'package:fl_query_hooks/fl_query_hooks.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
|
import 'package:gap/gap.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
|
|
||||||
import 'package:spotify/spotify.dart';
|
import 'package:spotify/spotify.dart';
|
||||||
|
import 'package:spotube/components/playlist/playlist_create_dialog.dart';
|
||||||
import 'package:spotube/components/shared/image/universal_image.dart';
|
import 'package:spotube/components/shared/image/universal_image.dart';
|
||||||
import 'package:spotube/extensions/context.dart';
|
import 'package:spotube/extensions/context.dart';
|
||||||
import 'package:spotube/provider/spotify_provider.dart';
|
import 'package:spotube/provider/spotify_provider.dart';
|
||||||
@ -22,6 +24,7 @@ class PlaylistAddTrackDialog extends HookConsumerWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, ref) {
|
Widget build(BuildContext context, ref) {
|
||||||
|
final ThemeData(:textTheme) = Theme.of(context);
|
||||||
final spotify = ref.watch(spotifyProvider);
|
final spotify = ref.watch(spotifyProvider);
|
||||||
final userPlaylists = useQueries.playlist.ofMineAll(ref);
|
final userPlaylists = useQueries.playlist.ofMineAll(ref);
|
||||||
|
|
||||||
@ -69,7 +72,18 @@ class PlaylistAddTrackDialog extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: Text(context.l10n.add_to_playlist),
|
insetPadding: EdgeInsets.zero,
|
||||||
|
title: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
context.l10n.add_to_playlist,
|
||||||
|
style: textTheme.titleMedium,
|
||||||
|
),
|
||||||
|
const Gap(20),
|
||||||
|
const PlaylistCreateDialogButton(),
|
||||||
|
],
|
||||||
|
),
|
||||||
actions: [
|
actions: [
|
||||||
OutlinedButton(
|
OutlinedButton(
|
||||||
child: Text(context.l10n.cancel),
|
child: Text(context.l10n.cancel),
|
||||||
|
@ -94,9 +94,8 @@ class PlaylistMutations {
|
|||||||
|
|
||||||
return playlist;
|
return playlist;
|
||||||
},
|
},
|
||||||
refreshInfiniteQueries: [
|
refreshInfiniteQueries: ["current-user-playlists"],
|
||||||
"current-user-playlists",
|
refreshQueries: ["current-user-all-playlists"],
|
||||||
],
|
|
||||||
ref: ref,
|
ref: ref,
|
||||||
onError: (error, recoveryData) {
|
onError: (error, recoveryData) {
|
||||||
onError?.call(error);
|
onError?.call(error);
|
||||||
@ -135,6 +134,7 @@ class PlaylistMutations {
|
|||||||
"playlist/$playlistId",
|
"playlist/$playlistId",
|
||||||
"current-user-playlists",
|
"current-user-playlists",
|
||||||
],
|
],
|
||||||
|
refreshQueries: ["current-user-all-playlists"],
|
||||||
ref: ref,
|
ref: ref,
|
||||||
onError: (error, recoveryData) {
|
onError: (error, recoveryData) {
|
||||||
onError?.call(error);
|
onError?.call(error);
|
||||||
|
Loading…
Reference in New Issue
Block a user