diff --git a/lib/features/user-library/ui/user_library_page.dart b/lib/features/user-library/ui/user_library_page.dart index 64ad47f..60bb1ba 100644 --- a/lib/features/user-library/ui/user_library_page.dart +++ b/lib/features/user-library/ui/user_library_page.dart @@ -3,8 +3,13 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:varanasi_mobile_app/features/user-library/cubit/user_library_cubit.dart'; +import 'package:varanasi_mobile_app/features/user-library/ui/widgets/add_playlist_button.dart'; +import 'package:varanasi_mobile_app/gen/assets.gen.dart'; +import 'package:varanasi_mobile_app/utils/extensions/extensions.dart'; import 'package:varanasi_mobile_app/utils/routes.dart'; +import 'widgets/empty.dart'; + class UserLibraryPage extends StatelessWidget { const UserLibraryPage({super.key}); @@ -12,8 +17,20 @@ class UserLibraryPage extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: const Text('Your Library'), + title: Row( + children: [ + Assets.icon.appIconMonotone.svg(width: 36, height: 36), + const SizedBox(width: 8), + Text( + 'Your Library', + style: context.textTheme.titleLarge + ?.copyWith(fontWeight: FontWeight.bold), + ), + ], + ), centerTitle: false, + actions: const [AddPlaylistButton()], + elevation: 10, ), body: BlocBuilder( builder: (context, state) { @@ -21,6 +38,7 @@ class UserLibraryPage extends StatelessWidget { return const Center(child: CircularProgressIndicator()); } final library = state.library; + if (library.isEmpty) return const EmptyUserLibrary(); return ListView.builder( itemBuilder: (context, index) { final item = library[index]; diff --git a/lib/features/user-library/ui/widgets/add_playlist_button.dart b/lib/features/user-library/ui/widgets/add_playlist_button.dart new file mode 100644 index 0000000..9ef3769 --- /dev/null +++ b/lib/features/user-library/ui/widgets/add_playlist_button.dart @@ -0,0 +1,15 @@ +import 'package:flutter/material.dart'; + +class AddPlaylistButton extends StatelessWidget { + const AddPlaylistButton({ + super.key, + }); + + @override + Widget build(BuildContext context) { + return IconButton( + onPressed: () {}, + icon: const Icon(Icons.add_rounded), + ); + } +} diff --git a/lib/features/user-library/ui/widgets/empty.dart b/lib/features/user-library/ui/widgets/empty.dart new file mode 100644 index 0000000..10a34c8 --- /dev/null +++ b/lib/features/user-library/ui/widgets/empty.dart @@ -0,0 +1,32 @@ +import 'package:flutter/material.dart'; +import 'package:varanasi_mobile_app/utils/extensions/extensions.dart'; +import 'package:varanasi_mobile_app/utils/extensions/media_query.dart'; + +class EmptyUserLibrary extends StatelessWidget { + const EmptyUserLibrary({super.key}); + + @override + Widget build(BuildContext context) { + return SizedBox( + width: context.width, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "Add music to your library", + style: context.textTheme.titleLarge?.copyWith( + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 8), + Text( + "Collect your favorites so that you can listen\nwhenever you want", + style: context.textTheme.titleSmall, + textAlign: TextAlign.center, + ), + ], + ), + ); + } +} diff --git a/pubspec.yaml b/pubspec.yaml index f3efa44..4576fea 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 0.1.1+14 +version: 0.1.2+15 environment: sdk: ">=3.0.6 <4.0.0"