Skip to content

Commit

Permalink
fix route
Browse files Browse the repository at this point in the history
  • Loading branch information
12henbx committed Dec 4, 2023
1 parent 3af7b57 commit 958b2e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/lib/core/bases/widgets/layout/bottom_navbar.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:go_router/go_router.dart';

class BottomNavBar extends StatefulWidget {
const BottomNavBar({
Expand All @@ -20,10 +21,10 @@ class _BottomNavBarState extends State<BottomNavBar> {
void _onTap(int index, BuildContext context) {
switch (index) {
case 0:
Navigator.popUntil(context, ModalRoute.withName('/main'));
context.go('/main');
break;
case 1:
Navigator.pushNamed(context, '/setting');
context.go('/setting');
break;
}
}
Expand Down
4 changes: 3 additions & 1 deletion app/lib/features/main/presentation/pages/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ class _HomePageState extends State<HomePage> {
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
floatingActionButton: FloatingActionButton(
onPressed: () {},
onPressed: () {
context.go('/quiz_registration');
},
child: const FaIcon(FontAwesomeIcons.graduationCap),
),
bottomNavigationBar: const BottomNavBar(
Expand Down

0 comments on commit 958b2e4

Please sign in to comment.