Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyessien committed Aug 23, 2024
1 parent 226f1f8 commit 4090736
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
10 changes: 10 additions & 0 deletions lib/core/router/app_router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ final GoRouter appRouter = GoRouter(
name: RoutePath.homeScreen,
path: "/home",
builder: (context, state) => const HomeScreen(),
redirect: (context, state) async {
debugPrint('In redirect ====>');
final isAuth = await isAuthenticated();
debugPrint('Redirect Auth State ====> $isAuth');
if (!isAuth) {
return '/';
} else {
return '/home';
}
},
),

GoRoute(
Expand Down
31 changes: 29 additions & 2 deletions lib/ui/screens/books/containers/books_by_category.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,31 @@ class _BooksByCategoryState extends State<BooksByCategory> {
int _currentPage = 1;
final int _totalPages = 5;

final List<String> imgList = [
AppImages.article,
AppImages.book2,
AppImages.book3,
AppImages.book4,
AppImages.book5,
];

final List<String> bookTitle = [
'Falling for my boyfriend\'s dad',
'Tangled destinies',
'Morgana',
'Haunted Desire',
'Princess Heaven',
];

final List<String> author = [
'Sarah John',
'Xenia Litpad',
'Dark Xenia',
'DarkXenia',
'Alexandra Dell',
];


void _handlePageChanged(int newPage) {
setState(() {
_currentPage = newPage;
Expand Down Expand Up @@ -44,11 +69,13 @@ class _BooksByCategoryState extends State<BooksByCategory> {
Wrap(
spacing: (20),
runSpacing: (40),
children: List.generate(6, (index) {
children: List.generate(imgList.length, (index) {
return SizedBox(
width: (420),
child: BookCard(
imgWidth: 174,
image: imgList[index],
bookTitle: bookTitle[index],
authorName: author[index], imgWidth: 174,
imgheight: 225,
onImageTap: () {
context
Expand Down

0 comments on commit 4090736

Please sign in to comment.