mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-14 16:25:16 +00:00

Configuration File Removals: .vscode/c_cpp_properties.json: Removed the entire configuration for C/C++ properties. .vscode/launch.json: Removed the Dart launch configurations for different environments and modes. .vscode/settings.json: Removed settings related to CMake, spell checking, file nesting, and Dart Flutter SDK path. .vscode/snippets.code-snippets: Removed code snippets for Dart, including PaginatedState and PaginatedNotifier templates. .vscode/tasks.json: Removed the tasks configuration file. Documentation Updates: CONTRIBUTION.md: Removed heart emoji from the introductory text. README.md: Updated the logo image and made minor text adjustments, including removing emojis and updating section titles. [1] [2] [3] [4] [5] Asset Removals: lib/collections/assets.gen.dart: Removed multiple unused asset references, including images related to Spotube logos and banners. [1] [2] [3] Minor Code Cleanups: cli/commands/build/linux.dart, cli/commands/build/windows.dart, cli/commands/translated.dart, cli/commands/untranslated.dart: Adjusted import statements for consistency. [1] [2] [3] [4] integration_test/app_test.dart: Removed an unnecessary blank line. lib/collections/routes.dart: Commented out the TrackRoute configuration.
84 lines
3.3 KiB
Dart
84 lines
3.3 KiB
Dart
import 'package:auto_route/auto_route.dart';
|
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
import 'package:shadcn_flutter/shadcn_flutter.dart';
|
|
import 'package:shadcn_flutter/shadcn_flutter_extension.dart';
|
|
import 'package:spotube/collections/assets.gen.dart';
|
|
import 'package:spotube/collections/routes.gr.dart';
|
|
import 'package:spotube/collections/spotube_icons.dart';
|
|
import 'package:spotube/components/titlebar/titlebar.dart';
|
|
import 'package:spotube/extensions/constrains.dart';
|
|
import 'package:spotube/models/database/database.dart';
|
|
import 'package:spotube/modules/connect/connect_device.dart';
|
|
import 'package:spotube/modules/home/sections/featured.dart';
|
|
import 'package:spotube/modules/home/sections/feed.dart';
|
|
import 'package:spotube/modules/home/sections/friends.dart';
|
|
import 'package:spotube/modules/home/sections/genres/genres.dart';
|
|
import 'package:spotube/modules/home/sections/made_for_user.dart';
|
|
import 'package:spotube/modules/home/sections/new_releases.dart';
|
|
import 'package:spotube/modules/home/sections/recent.dart';
|
|
import 'package:spotube/provider/user_preferences/user_preferences_provider.dart';
|
|
import 'package:spotube/utils/platform.dart';
|
|
|
|
@RoutePage()
|
|
class HomePage extends HookConsumerWidget {
|
|
static const name = "home";
|
|
const HomePage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context, ref) {
|
|
final controller = useScrollController();
|
|
final mediaQuery = MediaQuery.of(context);
|
|
final layoutMode =
|
|
ref.watch(userPreferencesProvider.select((s) => s.layoutMode));
|
|
|
|
return SafeArea(
|
|
bottom: false,
|
|
child: Scaffold(
|
|
headers: [
|
|
if (kTitlebarVisible) const TitleBar(height: 30),
|
|
],
|
|
child: CustomScrollView(
|
|
controller: controller,
|
|
slivers: [
|
|
if (mediaQuery.smAndDown || layoutMode == LayoutMode.compact)
|
|
SliverAppBar(
|
|
floating: true,
|
|
title: Assets.spotubeLogoStableNotWallpaper.image(height: 45),
|
|
backgroundColor: context.theme.colorScheme.background,
|
|
foregroundColor: context.theme.colorScheme.foreground,
|
|
actions: [
|
|
const ConnectDeviceButton(),
|
|
const Gap(10),
|
|
IconButton.ghost(
|
|
icon: const Icon(SpotubeIcons.settings, size: 20),
|
|
onPressed: () {
|
|
context.navigateTo(const SettingsRoute());
|
|
},
|
|
),
|
|
const Gap(10),
|
|
],
|
|
)
|
|
else if (kIsMacOS)
|
|
const SliverGap(10),
|
|
const SliverGap(10),
|
|
SliverList.builder(
|
|
itemCount: 5,
|
|
itemBuilder: (context, index) {
|
|
return switch (index) {
|
|
0 => const HomeGenresSection(),
|
|
1 => const HomeRecentlyPlayedSection(),
|
|
2 => const HomeFeaturedSection(),
|
|
3 => const HomePageFriendsSection(),
|
|
_ => const HomeNewReleasesSection()
|
|
};
|
|
},
|
|
),
|
|
const HomePageFeedSection(),
|
|
const SliverSafeArea(sliver: HomeMadeForUserSection()),
|
|
],
|
|
),
|
|
));
|
|
}
|
|
}
|