first commit
Build / Build for Android (push) Has been cancelled
Build / Build for iOS (push) Has been cancelled

This commit is contained in:
Zakaria
2026-05-18 14:15:38 -04:00
commit 1563409cb1
382 changed files with 45347 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import '../components/AddToPlaylistScreen/add_to_playlist_list.dart';
import '../components/AddToPlaylistScreen/new_playlist_dialog.dart';
class AddToPlaylistScreen extends StatefulWidget {
const AddToPlaylistScreen({Key? key}) : super(key: key);
static const routeName = "/music/addtoplaylist";
@override
State<AddToPlaylistScreen> createState() => _AddToPlaylistScreenState();
}
class _AddToPlaylistScreenState extends State<AddToPlaylistScreen> {
@override
Widget build(BuildContext context) {
final itemId = ModalRoute.of(context)!.settings.arguments as String;
return Scaffold(
appBar: AppBar(
title: Text(AppLocalizations.of(context)!.addToPlaylistTitle),
),
body: AddToPlaylistList(
itemToAddId: itemId,
),
floatingActionButton: FloatingActionButton(
child: const Icon(Icons.add),
onPressed: () async {
// The dialog returns true if a playlist is created. If this is the
// case, we also pop this page. It will return false if the user
// cancels the dialog.
final result = await showDialog<bool>(
context: context,
builder: (context) => NewPlaylistDialog(itemToAdd: itemId),
);
if (!mounted) return;
if (result == true) {
Navigator.of(context).pop();
}
},
),
);
}
}