Refactor navigation structure and update asset references

- Swapped routes for Profile and Notification branches in the app's navigation structure.
- Updated the current index for navigation items in TabletNavigationWidget and related pages to reflect the new routing.
- Added a new logo SVG asset to the asset manager for branding consistency.
- Adjusted the pubspec.lock file to downgrade several package versions for compatibility.
This commit is contained in:
amirrezaghabeli
2025-11-22 15:29:46 +03:30
parent d01e028dc1
commit ae8501dc36
8 changed files with 71 additions and 66 deletions
+6 -5
View File
@@ -113,16 +113,17 @@ class SplashScreenRoute extends GoRouteData with _$SplashScreenRoute {
TypedGoRoute<TendersRouteData>(path: '/tenders'),
],
),
TypedStatefulShellBranch<ProfileBranch>(
routes: <TypedRoute<RouteData>>[
TypedGoRoute<ProfileRouteData>(path: '/profile'),
],
),
TypedStatefulShellBranch<NotificationBranch>(
routes: <TypedRoute<RouteData>>[
TypedGoRoute<NotificationRouteData>(path: '/notification'),
],
),
TypedStatefulShellBranch<ProfileBranch>(
routes: <TypedRoute<RouteData>>[
TypedGoRoute<ProfileRouteData>(path: '/profile'),
],
),
],
)
class AppShellRouteData extends StatefulShellRouteData {
+19 -19
View File
@@ -127,17 +127,6 @@ RouteBase get $appShellRouteData => StatefulShellRouteData.$route(
),
],
),
StatefulShellBranchData.$branch(
navigatorKey: ProfileBranch.$navigatorKey,
routes: [
GoRouteData.$route(
path: '/profile',
factory: _$ProfileRouteData._fromState,
),
],
),
StatefulShellBranchData.$branch(
navigatorKey: NotificationBranch.$navigatorKey,
@@ -149,6 +138,17 @@ RouteBase get $appShellRouteData => StatefulShellRouteData.$route(
),
],
),
StatefulShellBranchData.$branch(
navigatorKey: ProfileBranch.$navigatorKey,
routes: [
GoRouteData.$route(
path: '/profile',
factory: _$ProfileRouteData._fromState,
),
],
),
],
);
@@ -198,12 +198,12 @@ mixin _$TendersRouteData on GoRouteData {
void replace(BuildContext context) => context.replace(location);
}
mixin _$ProfileRouteData on GoRouteData {
static ProfileRouteData _fromState(GoRouterState state) =>
const ProfileRouteData();
mixin _$NotificationRouteData on GoRouteData {
static NotificationRouteData _fromState(GoRouterState state) =>
const NotificationRouteData();
@override
String get location => GoRouteData.$location('/profile');
String get location => GoRouteData.$location('/notification');
@override
void go(BuildContext context) => context.go(location);
@@ -219,12 +219,12 @@ mixin _$ProfileRouteData on GoRouteData {
void replace(BuildContext context) => context.replace(location);
}
mixin _$NotificationRouteData on GoRouteData {
static NotificationRouteData _fromState(GoRouterState state) =>
const NotificationRouteData();
mixin _$ProfileRouteData on GoRouteData {
static ProfileRouteData _fromState(GoRouterState state) =>
const ProfileRouteData();
@override
String get location => GoRouteData.$location('/notification');
String get location => GoRouteData.$location('/profile');
@override
void go(BuildContext context) => context.go(location);
@@ -50,19 +50,19 @@ class MobileShellPage extends StatelessWidget {
iconPath: AssetsManager.tenders,
activeIconPath: AssetsManager.tendersActive,
),
_bottomNavigationItem(
context: context,
text: TendersStrings.contracts,
isActive: navigationShell.currentIndex == 4,
onTap: () => onTap(4),
iconPath: AssetsManager.contracts,
activeIconPath: AssetsManager.contracts,
),
// _bottomNavigationItem(
// context: context,
// text: TendersStrings.contracts,
// isActive: navigationShell.currentIndex == 4,
// onTap: () => onTap(4),
// iconPath: AssetsManager.contracts,
// activeIconPath: AssetsManager.contracts,
// ),
_bottomNavigationItem(
context: context,
text: TendersStrings.notifications,
isActive: navigationShell.currentIndex == 3,
onTap: () => onTap(3),
isActive: navigationShell.currentIndex == 2,
onTap: () => onTap(2),
iconPath: AssetsManager.notify,
activeIconPath: AssetsManager.notifyActive,
showBadge:
@@ -73,8 +73,8 @@ class MobileShellPage extends StatelessWidget {
_bottomNavigationItem(
context: context,
text: ProfileStrings.profileTitle,
isActive: navigationShell.currentIndex == 2,
onTap: () => onTap(2),
isActive: navigationShell.currentIndex == 3,
onTap: () => onTap(3),
iconPath: AssetsManager.profile,
activeIconPath: AssetsManager.profileActive,
),
+4
View File
@@ -98,6 +98,9 @@ class $AssetsIconsGen {
/// File path: assets/icons/location.svg
String get location => 'assets/icons/location.svg';
/// File path: assets/icons/logo.svg
String get logo => 'assets/icons/logo.svg';
/// File path: assets/icons/logo_big.svg
String get logoBig => 'assets/icons/logo_big.svg';
@@ -204,6 +207,7 @@ class $AssetsIconsGen {
leftArrow,
like,
location,
logo,
logoBig,
logoSmall,
menu,
@@ -70,7 +70,7 @@ class _TabletNotificationPageState extends State<TabletNotificationPage>
key: key,
context: context,
),
drawer: const TabletNavigationWidget(currentIndex: 3),
drawer: const TabletNavigationWidget(currentIndex: 2),
body: Center(
child: SizedBox(
width: 720,
+1 -1
View File
@@ -75,7 +75,7 @@ class _TabletProfilePageState extends State<TabletProfilePage> {
context: context,
),
drawer: const TabletNavigationWidget(currentIndex: 4),
drawer: const TabletNavigationWidget(currentIndex: 3),
body: SafeArea(
child: Padding(
padding: EdgeInsets.symmetric(
+20 -20
View File
@@ -65,27 +65,27 @@ class TabletNavigationWidget extends StatelessWidget {
iconPath: AssetsManager.tenders,
activeIconPath: AssetsManager.tendersActive,
),
_navigationItem(
context: context,
text: ProfileStrings.contracts,
isActive: currentIndex == 2,
onTap: () {
if (currentIndex == 2) {
return;
} else {
// context.pop();
// Router.neglect(context, () => ProfileRouteData().go(context));
}
},
iconPath: AssetsManager.contracts,
activeIconPath: AssetsManager.contracts,
),
// _navigationItem(
// context: context,
// text: ProfileStrings.contracts,
// isActive: currentIndex == 2,
// onTap: () {
// if (currentIndex == 2) {
// return;
// } else {
// // context.pop();
// // Router.neglect(context, () => ProfileRouteData().go(context));
// }
// },
// iconPath: AssetsManager.contracts,
// activeIconPath: AssetsManager.contracts,
// ),
_navigationItem(
context: context,
text: ProfileStrings.notifications,
isActive: currentIndex == 3,
isActive: currentIndex == 2,
onTap: () {
if (currentIndex == 3) {
if (currentIndex == 2) {
return;
} else {
context.pop();
@@ -93,7 +93,7 @@ class TabletNavigationWidget extends StatelessWidget {
context,
() => const NotificationRouteData().go(context),
);
context.read<TabNavigationService>().onTabSelected(3);
context.read<TabNavigationService>().onTabSelected(2);
}
},
iconPath: AssetsManager.notify,
@@ -102,9 +102,9 @@ class TabletNavigationWidget extends StatelessWidget {
_navigationItem(
context: context,
text: ProfileStrings.profileTitle,
isActive: currentIndex == 4,
isActive: currentIndex == 3,
onTap: () {
if (currentIndex == 4) {
if (currentIndex == 3) {
return;
} else {
context.pop();
+8 -8
View File
@@ -45,10 +45,10 @@ packages:
dependency: transitive
description:
name: async
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
url: "https://pub.dev"
source: hosted
version: "2.13.0"
version: "2.12.0"
boolean_selector:
dependency: transitive
description:
@@ -269,10 +269,10 @@ packages:
dependency: transitive
description:
name: fake_async
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
url: "https://pub.dev"
source: hosted
version: "1.3.3"
version: "1.3.2"
ffi:
dependency: transitive
description:
@@ -572,10 +572,10 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
url: "https://pub.dev"
source: hosted
version: "10.0.9"
version: "10.0.8"
leak_tracker_flutter_testing:
dependency: transitive
description:
@@ -1049,10 +1049,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
url: "https://pub.dev"
source: hosted
version: "15.0.0"
version: "14.3.1"
watcher:
dependency: transitive
description: