-
-
Notifications
You must be signed in to change notification settings - Fork 348
Category responsive + fix scrollable #797
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 |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ import 'package:resonate/controllers/explore_story_controller.dart'; | |
| import 'package:resonate/utils/app_images.dart'; | ||
| import 'package:resonate/views/widgets/category_card.dart'; | ||
| import 'package:resonate/views/widgets/story_list_tile.dart'; | ||
| import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
|
Contributor
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. Instead use Media query and Layout builder |
||
|
|
||
| class CategoryScreen extends StatelessWidget { | ||
| CategoryScreen({super.key, required this.categoryName}); | ||
|
|
@@ -19,7 +20,8 @@ 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)), | ||
|
|
@@ -28,8 +30,8 @@ class CategoryScreen extends StatelessWidget { | |
| () => exploreStoryController.isLoadingCategoryPage.value | ||
| ? Center( | ||
| child: SizedBox( | ||
| height: 200, | ||
| width: 200, | ||
| height: 200.h, | ||
|
Contributor
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. use media query and layout builder |
||
| width: 200.w, | ||
| child: LoadingIndicator( | ||
| indicatorType: Indicator.ballRotate, | ||
| colors: [Theme.of(context).colorScheme.primary], | ||
|
|
@@ -38,13 +40,9 @@ class CategoryScreen extends StatelessWidget { | |
| ) | ||
| : exploreStoryController.openedCategotyStories.isNotEmpty | ||
| ? Padding( | ||
| padding: const EdgeInsets.only(top: 20.0), | ||
| padding: EdgeInsets.only(top: 20.h), | ||
| child: ListView.builder( | ||
| physics: const NeverScrollableScrollPhysics(), | ||
| scrollDirection: Axis.vertical, | ||
| padding: EdgeInsets.zero, | ||
| shrinkWrap: true, | ||
| primary: true, | ||
| itemCount: | ||
| exploreStoryController.openedCategotyStories.length, | ||
| itemBuilder: (context, index) { | ||
|
|
@@ -56,27 +54,27 @@ class CategoryScreen extends StatelessWidget { | |
| }, | ||
| ), | ||
| ) | ||
| : 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( | ||
| : Center( | ||
| child: Padding( | ||
| padding: EdgeInsets.symmetric(horizontal: 30.0.w), | ||
| child: Column( | ||
| mainAxisAlignment: MainAxisAlignment.center, | ||
| mainAxisSize: MainAxisSize.min, | ||
| children: [ | ||
| Image.asset( | ||
| height: 200.h, | ||
| width: 200.w, | ||
| AppImages.emptyBoxImage, | ||
| ), | ||
| SizedBox(height: 20.h), | ||
| Text( | ||
| AppLocalizations.of(context)!.noStoriesInCategory( | ||
| capitalizeFirstLetter(categoryName), | ||
| ), | ||
| textAlign: TextAlign.center, | ||
| ), | ||
| ), | ||
| ], | ||
| ], | ||
| ), | ||
| ), | ||
| ), | ||
| ), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,7 @@ environment: | |
| # the latest version available on pub.dev. To see which dependencies have newer | ||
| # versions available, run flutter pub outdated. | ||
| dependencies: | ||
| flutter_screenutil: ^5.9.3 | ||
|
coderabbitai[bot] marked this conversation as resolved.
Contributor
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. no need for this package |
||
| animated_bottom_navigation_bar: ^1.4.0 | ||
| animated_splash_screen: ^1.3.0 | ||
| app_links: ^6.4.1 | ||
|
|
||
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.
No need for these changes, use layout builder and media query in category screen itself