Files
Redesnigned-Finamp/lib/screens/add_to_playlist_screen.dart
Zakaria d0ca84d8d2
Build / Build for Android (push) Has been cancelled
Build / Build for iOS (push) Has been cancelled
redesign app phase 1
2026-05-18 14:34:41 -04:00

49 lines
1.5 KiB
Dart

import 'package:flutter/material.dart';
import 'package:finamp/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();
}
},
),
);
}
}