From 3d4dc4936156709547b09cf6d8a613bc90d0f338 Mon Sep 17 00:00:00 2001 From: nahnah Date: Mon, 8 Jun 2026 12:54:59 +0530 Subject: [PATCH] imp: Bring back categories to library screen Sorry guys for constant shifting. --- lib/screens/florid_app.dart | 13 ++++++------- lib/screens/home/categories_screen.dart | 4 ---- lib/screens/home/library_screen.dart | 16 +++++++++++++--- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/lib/screens/florid_app.dart b/lib/screens/florid_app.dart index 4aa3eb4..ff05339 100644 --- a/lib/screens/florid_app.dart +++ b/lib/screens/florid_app.dart @@ -1,6 +1,5 @@ import 'package:florid/l10n/app_localizations.dart'; import 'package:florid/models/fdroid_app.dart'; -import 'package:florid/screens/home/categories_screen.dart'; import 'package:florid/screens/home/library_screen.dart'; import 'package:florid/screens/settings/settings_screen.dart'; import 'package:florid/screens/settings/user_screen.dart'; @@ -36,7 +35,7 @@ class _FloridAppState extends State { late final List _screens = [ const LibraryScreen(), - CategoriesScreen(), + // CategoriesScreen(), SearchScreen(), UpdatesScreen(), UserScreen(), @@ -497,11 +496,11 @@ class _FloridAppState extends State { selectedIcon: Icon(SolarIconsBold.home2), label: localizations.home, ), - NavigationDestination( - icon: Icon(SolarIconsOutline.widget_5), - selectedIcon: const Icon(SolarIconsBold.widget_5), - label: localizations.categories, - ), + // NavigationDestination( + // icon: Icon(SolarIconsOutline.widget_5), + // selectedIcon: const Icon(SolarIconsBold.widget_5), + // label: localizations.categories, + // ), NavigationDestination( icon: Icon(SolarIconsOutline.roundedMagnifier), selectedIcon: Icon(SolarIconsBold.roundedMagnifier), diff --git a/lib/screens/home/categories_screen.dart b/lib/screens/home/categories_screen.dart index b5175a1..658e21b 100644 --- a/lib/screens/home/categories_screen.dart +++ b/lib/screens/home/categories_screen.dart @@ -211,10 +211,6 @@ class _CategoriesScreenState extends State onRefresh: _onRefresh, child: CustomScrollView( slivers: [ - SliverAppBar( - floating: true, - title: Text(AppLocalizations.of(context)!.categories), - ), SliverPadding( padding: const EdgeInsets.only(bottom: 16), sliver: SliverList( diff --git a/lib/screens/home/library_screen.dart b/lib/screens/home/library_screen.dart index f42e44e..af19305 100644 --- a/lib/screens/home/library_screen.dart +++ b/lib/screens/home/library_screen.dart @@ -33,7 +33,7 @@ class _LibraryScreenState extends State @override void initState() { super.initState(); - _tabController = TabController(length: 2, vsync: this); + _tabController = TabController(length: 3, vsync: this); _titleSwitchTimer = Timer(const Duration(seconds: 3), () { if (!mounted) return; setState(() { @@ -71,7 +71,7 @@ class _LibraryScreenState extends State newIndex = oldIndex + 1; } - final newLength = shouldShowTopApps ? 3 : 2; + final newLength = shouldShowTopApps ? 4 : 3; final clampedIndex = newIndex.clamp(0, newLength - 1); _tabController.dispose(); @@ -96,6 +96,7 @@ class _LibraryScreenState extends State final localizations = AppLocalizations.of(context)!; final tabs = [ const HomeScreen(), + const CategoriesScreen(), if (_showTopAppsTab) AppSectionViewer( showAppBar: false, @@ -181,7 +182,12 @@ class _LibraryScreenState extends State : Theme.of(context).colorScheme.surface, snap: true, floating: true, - shape: LinearBorder(bottom: LinearBorderEdge(), side: BorderSide(color: Theme.of(context).colorScheme.surfaceContainerLow)), + shape: LinearBorder( + bottom: LinearBorderEdge(), + side: BorderSide( + color: Theme.of(context).colorScheme.surfaceContainerLow, + ), + ), bottom: PreferredSize( preferredSize: Size.fromHeight( settingsProvider.themeStyle == ThemeStyle.florid ? 64 : 56, @@ -204,6 +210,10 @@ class _LibraryScreenState extends State icon: SolarIconsOutline.home, label: AppLocalizations.of(context)!.home, ), + FloridTabBarItem( + icon: SolarIconsOutline.widget_5, + label: AppLocalizations.of(context)!.categories, + ), if (_showTopAppsTab) FloridTabBarItem( icon: SolarIconsOutline.courseUp,