From 204429726f4d345a03d6e89b6ddef0f475cd5eba Mon Sep 17 00:00:00 2001 From: d-reader-luka Date: Wed, 29 May 2024 10:04:11 +0200 Subject: [PATCH] minor --- .../widgets/common/discover_scroll_view.dart | 144 ++++++------------ .../home/presentation/screens/home.dart | 16 +- .../library/presentation/screens/library.dart | 1 + .../screens/{root.dart => settings.dart} | 0 .../widgets/scaffolds/d_reader_scaffold.dart | 2 +- 5 files changed, 53 insertions(+), 110 deletions(-) rename lib/features/settings/presentation/screens/{root.dart => settings.dart} (100%) diff --git a/lib/features/discover/root/presentation/widgets/common/discover_scroll_view.dart b/lib/features/discover/root/presentation/widgets/common/discover_scroll_view.dart index aa49b9b9..a5380508 100644 --- a/lib/features/discover/root/presentation/widgets/common/discover_scroll_view.dart +++ b/lib/features/discover/root/presentation/widgets/common/discover_scroll_view.dart @@ -34,118 +34,60 @@ class DiscoverScrollView extends ConsumerWidget { required bool isDetailedView, required WidgetRef ref, }) { - // return switch (scrollListType) { - // ScrollListType.comicList => isDetailedView - // ? ComicList( - // provider: ref.read( - // paginatedComicsProvider( - // query, - // ), - // ), - // ) - // : ComicGallery( - // provider: ref.read( - // paginatedComicsProvider( - // query, - // ), - // ), - // ), - // ScrollListType.issueList => isDetailedView - // ? IssuesList( - // provider: ref.read( - // paginatedIssuesProvider( - // query, - // ), - // ), - // ) - // : IssuesGallery( - // provider: ref.read( - // paginatedIssuesProvider( - // query, - // ), - // ), - // ), - // ScrollListType.creatorList => isDetailedView - // ? CreatorsList( - // provider: ref.read( - // paginatedCreatorsProvider( - // query, - // ), - // ), - // ) - // : CreatorsGallery( - // provider: ref.read( - // paginatedCreatorsProvider( - // query, - // ), - // ), - // ), - // ScrollListType.collectiblesList => ComicList( - // provider: ref.read( - // paginatedComicsProvider( - // query, - // ), - // ), - // ), - // }; - switch (scrollListType) { - case ScrollListType.comicList: - return isDetailedView - ? ComicList( - provider: ref.read( - paginatedComicsProvider( - query, - ), + return switch (scrollListType) { + ScrollListType.comicList => isDetailedView + ? ComicList( + provider: ref.read( + paginatedComicsProvider( + query, ), - ) - : ComicGallery( - provider: ref.read( - paginatedComicsProvider( - query, - ), + ), + ) + : ComicGallery( + provider: ref.read( + paginatedComicsProvider( + query, ), - ); - case ScrollListType.issueList: - return isDetailedView - ? IssuesList( - provider: ref.read( - paginatedIssuesProvider( - query, - ), + ), + ), + ScrollListType.issueList => isDetailedView + ? IssuesList( + provider: ref.read( + paginatedIssuesProvider( + query, ), - ) - : IssuesGallery( - provider: ref.read( - paginatedIssuesProvider( - query, - ), + ), + ) + : IssuesGallery( + provider: ref.read( + paginatedIssuesProvider( + query, ), - ); - case ScrollListType.creatorList: - return isDetailedView - ? CreatorsList( - provider: ref.read( - paginatedCreatorsProvider( - query, - ), + ), + ), + ScrollListType.creatorList => isDetailedView + ? CreatorsList( + provider: ref.read( + paginatedCreatorsProvider( + query, ), - ) - : CreatorsGallery( - provider: ref.read( - paginatedCreatorsProvider( - query, - ), + ), + ) + : CreatorsGallery( + provider: ref.read( + paginatedCreatorsProvider( + query, ), - ); - case ScrollListType.collectiblesList: - return ComicList( + ), + ), + ScrollListType.collectiblesList => ComicList( provider: ref.read( paginatedComicsProvider( query, ), ), - ); - } + ), + }; } @override diff --git a/lib/features/home/presentation/screens/home.dart b/lib/features/home/presentation/screens/home.dart index a886ef89..911d05ff 100644 --- a/lib/features/home/presentation/screens/home.dart +++ b/lib/features/home/presentation/screens/home.dart @@ -49,15 +49,14 @@ class HomeView extends ConsumerWidget { ), ), SliverList( - delegate: SliverChildListDelegate( - [ - Container( - color: Colors.transparent, - padding: const EdgeInsets.only( + delegate: SliverChildBuilderDelegate( + (context, index) { + return const Padding( + padding: EdgeInsets.only( left: 16, top: 8.0, ), - child: const Column( + child: Column( children: [ SizedBox( height: 24, @@ -146,8 +145,9 @@ class HomeView extends ConsumerWidget { ), ], ), - ), - ], + ); + }, + childCount: 1, ), ), ], diff --git a/lib/features/library/presentation/screens/library.dart b/lib/features/library/presentation/screens/library.dart index c71d50e5..a540ef2b 100644 --- a/lib/features/library/presentation/screens/library.dart +++ b/lib/features/library/presentation/screens/library.dart @@ -59,6 +59,7 @@ class NewLibraryViewState extends ConsumerState ), ), floatHeaderSlivers: true, + physics: const BouncingScrollPhysics(), headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { return [ SliverToBoxAdapter( diff --git a/lib/features/settings/presentation/screens/root.dart b/lib/features/settings/presentation/screens/settings.dart similarity index 100% rename from lib/features/settings/presentation/screens/root.dart rename to lib/features/settings/presentation/screens/settings.dart diff --git a/lib/shared/widgets/scaffolds/d_reader_scaffold.dart b/lib/shared/widgets/scaffolds/d_reader_scaffold.dart index 7bfc990b..7decea94 100644 --- a/lib/shared/widgets/scaffolds/d_reader_scaffold.dart +++ b/lib/shared/widgets/scaffolds/d_reader_scaffold.dart @@ -7,7 +7,7 @@ import 'package:d_reader_flutter/shared/theme/app_colors.dart'; import 'package:d_reader_flutter/features/discover/root/presentation/screens/discover.dart'; import 'package:d_reader_flutter/features/home/presentation/screens/home.dart'; import 'package:d_reader_flutter/features/library/presentation/screens/library.dart'; -import 'package:d_reader_flutter/features/settings/presentation/screens/root.dart'; +import 'package:d_reader_flutter/features/settings/presentation/screens/settings.dart'; import 'package:d_reader_flutter/shared/widgets/layout/custom_bottom_navigation_bar.dart'; import 'package:d_reader_flutter/shared/widgets/unsorted/test_mode_widget.dart'; import 'package:d_reader_flutter/features/settings/presentation/widgets/referrals/bottom_navigation.dart';