2024-08-29 08:42:48 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
import 'package:rhythm_box/providers/auth.dart';
|
|
|
|
import 'package:rhythm_box/widgets/no_login_fallback.dart';
|
|
|
|
import 'package:rhythm_box/widgets/playlist/user_playlist_list.dart';
|
2024-08-29 14:39:54 +00:00
|
|
|
import 'package:rhythm_box/widgets/sized_container.dart';
|
2024-08-29 08:42:48 +00:00
|
|
|
|
|
|
|
class LibraryScreen extends StatefulWidget {
|
|
|
|
const LibraryScreen({super.key});
|
|
|
|
|
|
|
|
@override
|
|
|
|
State<LibraryScreen> createState() => _LibraryScreenState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _LibraryScreenState extends State<LibraryScreen> {
|
|
|
|
late final AuthenticationProvider _authenticate = Get.find();
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Material(
|
|
|
|
color: Theme.of(context).colorScheme.surface,
|
2024-08-29 14:39:54 +00:00
|
|
|
child: Scaffold(
|
|
|
|
appBar: AppBar(
|
|
|
|
title: const Text('Library'),
|
|
|
|
centerTitle: MediaQuery.of(context).size.width >= 720,
|
|
|
|
),
|
|
|
|
body: Obx(() {
|
2024-08-29 08:42:48 +00:00
|
|
|
if (_authenticate.auth.value == null) {
|
|
|
|
return const NoLoginFallback();
|
|
|
|
}
|
|
|
|
|
2024-08-29 14:39:54 +00:00
|
|
|
return const CenteredContainer(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Expanded(child: UserPlaylistList()),
|
|
|
|
],
|
|
|
|
),
|
2024-08-29 08:42:48 +00:00
|
|
|
);
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|