-
-
Notifications
You must be signed in to change notification settings - Fork 348
Fix CategoryScreen UI and scrolling issues #795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -19,66 +19,68 @@ class CategoryScreen extends StatelessWidget { | |||||||||||||||||
| Widget build(BuildContext context) { | ||||||||||||||||||
| return Scaffold( | ||||||||||||||||||
| appBar: AppBar( | ||||||||||||||||||
| automaticallyImplyLeading: false, | ||||||||||||||||||
| automaticallyImplyLeading: true,//back button for user experience | ||||||||||||||||||
| centerTitle: true, | ||||||||||||||||||
| backgroundColor: Theme.of(context).colorScheme.surface, | ||||||||||||||||||
| elevation: 0, | ||||||||||||||||||
| title: Text(capitalizeFirstLetter(categoryName)), | ||||||||||||||||||
| ), | ||||||||||||||||||
| body: Obx( | ||||||||||||||||||
| () => exploreStoryController.isLoadingCategoryPage.value | ||||||||||||||||||
| () => exploreStoryController.isLoadingCategoryPage.value | ||||||||||||||||||
| ? Center( | ||||||||||||||||||
| child: SizedBox( | ||||||||||||||||||
| height: 200, | ||||||||||||||||||
| width: 200, | ||||||||||||||||||
| child: LoadingIndicator( | ||||||||||||||||||
| indicatorType: Indicator.ballRotate, | ||||||||||||||||||
| colors: [Theme.of(context).colorScheme.primary], | ||||||||||||||||||
| ), | ||||||||||||||||||
| ), | ||||||||||||||||||
| ) | ||||||||||||||||||
| child: SizedBox( | ||||||||||||||||||
| height: 200, | ||||||||||||||||||
| width: 200, | ||||||||||||||||||
| child: LoadingIndicator( | ||||||||||||||||||
| indicatorType: Indicator.ballRotate, | ||||||||||||||||||
| colors: [Theme.of(context).colorScheme.primary], | ||||||||||||||||||
| ), | ||||||||||||||||||
| ), | ||||||||||||||||||
| ) | ||||||||||||||||||
| : exploreStoryController.openedCategotyStories.isNotEmpty | ||||||||||||||||||
| ? Padding( | ||||||||||||||||||
| padding: const EdgeInsets.only(top: 20.0), | ||||||||||||||||||
| child: ListView.builder( | ||||||||||||||||||
| physics: const NeverScrollableScrollPhysics(), | ||||||||||||||||||
| scrollDirection: Axis.vertical, | ||||||||||||||||||
| padding: EdgeInsets.zero, | ||||||||||||||||||
| shrinkWrap: true, | ||||||||||||||||||
| primary: true, | ||||||||||||||||||
| itemCount: | ||||||||||||||||||
| exploreStoryController.openedCategotyStories.length, | ||||||||||||||||||
| itemBuilder: (context, index) { | ||||||||||||||||||
| final int storyIndex = index; | ||||||||||||||||||
| return StoryListTile( | ||||||||||||||||||
| story: exploreStoryController | ||||||||||||||||||
| .openedCategotyStories[storyIndex], | ||||||||||||||||||
| ); | ||||||||||||||||||
| }, | ||||||||||||||||||
| ), | ||||||||||||||||||
| ) | ||||||||||||||||||
| padding: const EdgeInsets.only(top: 20.0), | ||||||||||||||||||
| child: ListView.builder( | ||||||||||||||||||
| physics: const NeverScrollableScrollPhysics(), | ||||||||||||||||||
| scrollDirection: Axis.vertical, | ||||||||||||||||||
| padding: EdgeInsets.zero, | ||||||||||||||||||
| shrinkWrap: true, | ||||||||||||||||||
| primary: true, | ||||||||||||||||||
| itemCount: | ||||||||||||||||||
| exploreStoryController.openedCategotyStories.length, | ||||||||||||||||||
| itemBuilder: (context, index) { | ||||||||||||||||||
| final int storyIndex = index; | ||||||||||||||||||
| return StoryListTile( | ||||||||||||||||||
| story: exploreStoryController | ||||||||||||||||||
| .openedCategotyStories[storyIndex], | ||||||||||||||||||
| ); | ||||||||||||||||||
| }, | ||||||||||||||||||
| ), | ||||||||||||||||||
| ) | ||||||||||||||||||
| : Padding( | ||||||||||||||||||
| padding: const EdgeInsets.only(bottom: 150.0), | ||||||||||||||||||
| child: Column( | ||||||||||||||||||
| mainAxisAlignment: MainAxisAlignment.center, | ||||||||||||||||||
| children: [ | ||||||||||||||||||
| Image.asset( | ||||||||||||||||||
| height: 200, | ||||||||||||||||||
| width: 200, | ||||||||||||||||||
| AppImages.emptyBoxImage, | ||||||||||||||||||
| ), | ||||||||||||||||||
| const SizedBox(height: 20), | ||||||||||||||||||
| Padding( | ||||||||||||||||||
| padding: const EdgeInsets.symmetric(horizontal: 30.0), | ||||||||||||||||||
| child: Text( | ||||||||||||||||||
| AppLocalizations.of(context)!.noStoriesInCategory( | ||||||||||||||||||
| capitalizeFirstLetter(categoryName), | ||||||||||||||||||
| ), | ||||||||||||||||||
| textAlign: TextAlign.center, | ||||||||||||||||||
| ), | ||||||||||||||||||
| ), | ||||||||||||||||||
| ], | ||||||||||||||||||
| padding: const EdgeInsets.only(bottom: 150.0), | ||||||||||||||||||
| child: Column( | ||||||||||||||||||
| mainAxisAlignment: MainAxisAlignment.center, | ||||||||||||||||||
| mainAxisSize: MainAxisSize.min,// take the least size needed | ||||||||||||||||||
|
Comment on lines
+61
to
+64
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid fixed Line 61 hard-codes vertical offset, which can look misaligned on smaller/larger screens. Use centering/safe-area-driven layout instead for responsive behavior. Suggested fix- : Padding(
- padding: const EdgeInsets.only(bottom: 150.0),
- child: Column(
+ : Center(
+ child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,// take the least size needed
children: [📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
| children: [ | ||||||||||||||||||
| Image.asset( | ||||||||||||||||||
| height: 200, | ||||||||||||||||||
| width: 200, | ||||||||||||||||||
| AppImages.emptyBoxImage, | ||||||||||||||||||
| ), | ||||||||||||||||||
| const SizedBox(height: 20), | ||||||||||||||||||
| Padding( | ||||||||||||||||||
| padding: const EdgeInsets.symmetric(horizontal: 30.0), | ||||||||||||||||||
| child: Text( | ||||||||||||||||||
| AppLocalizations.of(context)!.noStoriesInCategory( | ||||||||||||||||||
| capitalizeFirstLetter(categoryName), | ||||||||||||||||||
| ), | ||||||||||||||||||
| textAlign: TextAlign.center, | ||||||||||||||||||
| ), | ||||||||||||||||||
| ), | ||||||||||||||||||
| ], | ||||||||||||||||||
| ), | ||||||||||||||||||
| ), | ||||||||||||||||||
| ), | ||||||||||||||||||
| ); | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: AOSSIE-Org/Resonate
Length of output: 463
Story list is configured to not scroll and will prevent scrolling regressions from being fixed.
Line 44 sets
NeverScrollableScrollPhysics(), which disables user scrolling on this ListView. Combined withshrinkWrap: trueandprimary: true(lines 47-48), this configuration prevents the list from scrolling even if the parent container allows it. This directly conflicts with fixing scrolling regressions.Suggested fix
🤖 Prompt for AI Agents