✨ added your tenders screen
This commit is contained in:
@@ -5,6 +5,7 @@ import '../../views/home/home_screen.dart';
|
||||
import '../../views/login/login_screen.dart';
|
||||
import '../../views/profile/profile_screen.dart';
|
||||
import '../../views/tenders/tenders_screen.dart';
|
||||
import '../../views/your_tenders/your_tenders_screen.dart';
|
||||
import 'app_shell_screen.dart';
|
||||
|
||||
part 'app_routes.g.dart';
|
||||
@@ -20,7 +21,7 @@ final GlobalKey<NavigatorState> profileNavigatorKey =
|
||||
// Main app router
|
||||
final GoRouter appRouter = GoRouter(
|
||||
routes: $appRoutes,
|
||||
initialLocation: '/login',
|
||||
initialLocation: '/home',
|
||||
navigatorKey: rootNavigatorKey,
|
||||
);
|
||||
|
||||
@@ -134,3 +135,13 @@ class ProfileRouteData extends GoRouteData with _$ProfileRouteData {
|
||||
return const ProfileScreen();
|
||||
}
|
||||
}
|
||||
|
||||
@TypedGoRoute<YourTendersRouteData>(path: '/your-tenders')
|
||||
class YourTendersRouteData extends GoRouteData with _$YourTendersRouteData {
|
||||
const YourTendersRouteData();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, GoRouterState state) {
|
||||
return const YourTendersScreen();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,11 @@ part of 'app_routes.dart';
|
||||
// GoRouterGenerator
|
||||
// **************************************************************************
|
||||
|
||||
List<RouteBase> get $appRoutes => [$loginScreenRoute, $appShellRouteData];
|
||||
List<RouteBase> get $appRoutes => [
|
||||
$loginScreenRoute,
|
||||
$appShellRouteData,
|
||||
$yourTendersRouteData,
|
||||
];
|
||||
|
||||
RouteBase get $loginScreenRoute =>
|
||||
GoRouteData.$route(path: '/login', factory: _$LoginScreenRoute._fromState);
|
||||
@@ -134,3 +138,30 @@ mixin _$ProfileRouteData on GoRouteData {
|
||||
@override
|
||||
void replace(BuildContext context) => context.replace(location);
|
||||
}
|
||||
|
||||
RouteBase get $yourTendersRouteData => GoRouteData.$route(
|
||||
path: '/your-tenders',
|
||||
|
||||
factory: _$YourTendersRouteData._fromState,
|
||||
);
|
||||
|
||||
mixin _$YourTendersRouteData on GoRouteData {
|
||||
static YourTendersRouteData _fromState(GoRouterState state) =>
|
||||
const YourTendersRouteData();
|
||||
|
||||
@override
|
||||
String get location => GoRouteData.$location('/your-tenders');
|
||||
|
||||
@override
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
@override
|
||||
Future<T?> push<T>(BuildContext context) => context.push<T>(location);
|
||||
|
||||
@override
|
||||
void pushReplacement(BuildContext context) =>
|
||||
context.pushReplacement(location);
|
||||
|
||||
@override
|
||||
void replace(BuildContext context) => context.replace(location);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import '../constants/assets.dart';
|
||||
import '../utils/size_config.dart';
|
||||
|
||||
class AppShellScreen extends StatelessWidget {
|
||||
@@ -19,6 +20,7 @@ class AppShellScreen extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
SizeConfig.init(context);
|
||||
return Scaffold(
|
||||
body: navigationShell,
|
||||
bottomNavigationBar: Container(
|
||||
@@ -38,7 +40,7 @@ class AppShellScreen extends StatelessWidget {
|
||||
isActive: navigationShell.currentIndex == 0,
|
||||
onTap: () => _gotoBranch(0),
|
||||
iconPath: 'assets/icons/home.svg',
|
||||
activeIconPath: 'assets/icons/homeActive.svg',
|
||||
activeIconPath: AssetsManager.homeActive,
|
||||
),
|
||||
_bottomNavigationItem(
|
||||
context: context,
|
||||
@@ -81,6 +83,7 @@ class AppShellScreen extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SvgPicture.asset(isActive ? activeIconPath : iconPath),
|
||||
|
||||
Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
|
||||
Reference in New Issue
Block a user