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:
@@ -113,16 +113,17 @@ class SplashScreenRoute extends GoRouteData with _$SplashScreenRoute {
|
|||||||
TypedGoRoute<TendersRouteData>(path: '/tenders'),
|
TypedGoRoute<TendersRouteData>(path: '/tenders'),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
TypedStatefulShellBranch<ProfileBranch>(
|
|
||||||
routes: <TypedRoute<RouteData>>[
|
|
||||||
TypedGoRoute<ProfileRouteData>(path: '/profile'),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
TypedStatefulShellBranch<NotificationBranch>(
|
TypedStatefulShellBranch<NotificationBranch>(
|
||||||
routes: <TypedRoute<RouteData>>[
|
routes: <TypedRoute<RouteData>>[
|
||||||
TypedGoRoute<NotificationRouteData>(path: '/notification'),
|
TypedGoRoute<NotificationRouteData>(path: '/notification'),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
TypedStatefulShellBranch<ProfileBranch>(
|
||||||
|
routes: <TypedRoute<RouteData>>[
|
||||||
|
TypedGoRoute<ProfileRouteData>(path: '/profile'),
|
||||||
|
],
|
||||||
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
class AppShellRouteData extends StatefulShellRouteData {
|
class AppShellRouteData extends StatefulShellRouteData {
|
||||||
|
|||||||
@@ -127,17 +127,6 @@ RouteBase get $appShellRouteData => StatefulShellRouteData.$route(
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
StatefulShellBranchData.$branch(
|
|
||||||
navigatorKey: ProfileBranch.$navigatorKey,
|
|
||||||
|
|
||||||
routes: [
|
|
||||||
GoRouteData.$route(
|
|
||||||
path: '/profile',
|
|
||||||
|
|
||||||
factory: _$ProfileRouteData._fromState,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
StatefulShellBranchData.$branch(
|
StatefulShellBranchData.$branch(
|
||||||
navigatorKey: NotificationBranch.$navigatorKey,
|
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);
|
void replace(BuildContext context) => context.replace(location);
|
||||||
}
|
}
|
||||||
|
|
||||||
mixin _$ProfileRouteData on GoRouteData {
|
mixin _$NotificationRouteData on GoRouteData {
|
||||||
static ProfileRouteData _fromState(GoRouterState state) =>
|
static NotificationRouteData _fromState(GoRouterState state) =>
|
||||||
const ProfileRouteData();
|
const NotificationRouteData();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get location => GoRouteData.$location('/profile');
|
String get location => GoRouteData.$location('/notification');
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void go(BuildContext context) => context.go(location);
|
void go(BuildContext context) => context.go(location);
|
||||||
@@ -219,12 +219,12 @@ mixin _$ProfileRouteData on GoRouteData {
|
|||||||
void replace(BuildContext context) => context.replace(location);
|
void replace(BuildContext context) => context.replace(location);
|
||||||
}
|
}
|
||||||
|
|
||||||
mixin _$NotificationRouteData on GoRouteData {
|
mixin _$ProfileRouteData on GoRouteData {
|
||||||
static NotificationRouteData _fromState(GoRouterState state) =>
|
static ProfileRouteData _fromState(GoRouterState state) =>
|
||||||
const NotificationRouteData();
|
const ProfileRouteData();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get location => GoRouteData.$location('/notification');
|
String get location => GoRouteData.$location('/profile');
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void go(BuildContext context) => context.go(location);
|
void go(BuildContext context) => context.go(location);
|
||||||
|
|||||||
@@ -50,19 +50,19 @@ class MobileShellPage extends StatelessWidget {
|
|||||||
iconPath: AssetsManager.tenders,
|
iconPath: AssetsManager.tenders,
|
||||||
activeIconPath: AssetsManager.tendersActive,
|
activeIconPath: AssetsManager.tendersActive,
|
||||||
),
|
),
|
||||||
_bottomNavigationItem(
|
// _bottomNavigationItem(
|
||||||
context: context,
|
// context: context,
|
||||||
text: TendersStrings.contracts,
|
// text: TendersStrings.contracts,
|
||||||
isActive: navigationShell.currentIndex == 4,
|
// isActive: navigationShell.currentIndex == 4,
|
||||||
onTap: () => onTap(4),
|
// onTap: () => onTap(4),
|
||||||
iconPath: AssetsManager.contracts,
|
// iconPath: AssetsManager.contracts,
|
||||||
activeIconPath: AssetsManager.contracts,
|
// activeIconPath: AssetsManager.contracts,
|
||||||
),
|
// ),
|
||||||
_bottomNavigationItem(
|
_bottomNavigationItem(
|
||||||
context: context,
|
context: context,
|
||||||
text: TendersStrings.notifications,
|
text: TendersStrings.notifications,
|
||||||
isActive: navigationShell.currentIndex == 3,
|
isActive: navigationShell.currentIndex == 2,
|
||||||
onTap: () => onTap(3),
|
onTap: () => onTap(2),
|
||||||
iconPath: AssetsManager.notify,
|
iconPath: AssetsManager.notify,
|
||||||
activeIconPath: AssetsManager.notifyActive,
|
activeIconPath: AssetsManager.notifyActive,
|
||||||
showBadge:
|
showBadge:
|
||||||
@@ -73,8 +73,8 @@ class MobileShellPage extends StatelessWidget {
|
|||||||
_bottomNavigationItem(
|
_bottomNavigationItem(
|
||||||
context: context,
|
context: context,
|
||||||
text: ProfileStrings.profileTitle,
|
text: ProfileStrings.profileTitle,
|
||||||
isActive: navigationShell.currentIndex == 2,
|
isActive: navigationShell.currentIndex == 3,
|
||||||
onTap: () => onTap(2),
|
onTap: () => onTap(3),
|
||||||
iconPath: AssetsManager.profile,
|
iconPath: AssetsManager.profile,
|
||||||
activeIconPath: AssetsManager.profileActive,
|
activeIconPath: AssetsManager.profileActive,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -98,6 +98,9 @@ class $AssetsIconsGen {
|
|||||||
/// File path: assets/icons/location.svg
|
/// File path: assets/icons/location.svg
|
||||||
String get location => '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
|
/// File path: assets/icons/logo_big.svg
|
||||||
String get logoBig => 'assets/icons/logo_big.svg';
|
String get logoBig => 'assets/icons/logo_big.svg';
|
||||||
|
|
||||||
@@ -204,6 +207,7 @@ class $AssetsIconsGen {
|
|||||||
leftArrow,
|
leftArrow,
|
||||||
like,
|
like,
|
||||||
location,
|
location,
|
||||||
|
logo,
|
||||||
logoBig,
|
logoBig,
|
||||||
logoSmall,
|
logoSmall,
|
||||||
menu,
|
menu,
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class _TabletNotificationPageState extends State<TabletNotificationPage>
|
|||||||
key: key,
|
key: key,
|
||||||
context: context,
|
context: context,
|
||||||
),
|
),
|
||||||
drawer: const TabletNavigationWidget(currentIndex: 3),
|
drawer: const TabletNavigationWidget(currentIndex: 2),
|
||||||
body: Center(
|
body: Center(
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: 720,
|
width: 720,
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class _TabletProfilePageState extends State<TabletProfilePage> {
|
|||||||
context: context,
|
context: context,
|
||||||
),
|
),
|
||||||
|
|
||||||
drawer: const TabletNavigationWidget(currentIndex: 4),
|
drawer: const TabletNavigationWidget(currentIndex: 3),
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(
|
padding: EdgeInsets.symmetric(
|
||||||
|
|||||||
@@ -65,27 +65,27 @@ class TabletNavigationWidget extends StatelessWidget {
|
|||||||
iconPath: AssetsManager.tenders,
|
iconPath: AssetsManager.tenders,
|
||||||
activeIconPath: AssetsManager.tendersActive,
|
activeIconPath: AssetsManager.tendersActive,
|
||||||
),
|
),
|
||||||
_navigationItem(
|
// _navigationItem(
|
||||||
context: context,
|
// context: context,
|
||||||
text: ProfileStrings.contracts,
|
// text: ProfileStrings.contracts,
|
||||||
isActive: currentIndex == 2,
|
// isActive: currentIndex == 2,
|
||||||
onTap: () {
|
// onTap: () {
|
||||||
if (currentIndex == 2) {
|
// if (currentIndex == 2) {
|
||||||
return;
|
// return;
|
||||||
} else {
|
// } else {
|
||||||
// context.pop();
|
// // context.pop();
|
||||||
// Router.neglect(context, () => ProfileRouteData().go(context));
|
// // Router.neglect(context, () => ProfileRouteData().go(context));
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
iconPath: AssetsManager.contracts,
|
// iconPath: AssetsManager.contracts,
|
||||||
activeIconPath: AssetsManager.contracts,
|
// activeIconPath: AssetsManager.contracts,
|
||||||
),
|
// ),
|
||||||
_navigationItem(
|
_navigationItem(
|
||||||
context: context,
|
context: context,
|
||||||
text: ProfileStrings.notifications,
|
text: ProfileStrings.notifications,
|
||||||
isActive: currentIndex == 3,
|
isActive: currentIndex == 2,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (currentIndex == 3) {
|
if (currentIndex == 2) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
context.pop();
|
context.pop();
|
||||||
@@ -93,7 +93,7 @@ class TabletNavigationWidget extends StatelessWidget {
|
|||||||
context,
|
context,
|
||||||
() => const NotificationRouteData().go(context),
|
() => const NotificationRouteData().go(context),
|
||||||
);
|
);
|
||||||
context.read<TabNavigationService>().onTabSelected(3);
|
context.read<TabNavigationService>().onTabSelected(2);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
iconPath: AssetsManager.notify,
|
iconPath: AssetsManager.notify,
|
||||||
@@ -102,9 +102,9 @@ class TabletNavigationWidget extends StatelessWidget {
|
|||||||
_navigationItem(
|
_navigationItem(
|
||||||
context: context,
|
context: context,
|
||||||
text: ProfileStrings.profileTitle,
|
text: ProfileStrings.profileTitle,
|
||||||
isActive: currentIndex == 4,
|
isActive: currentIndex == 3,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (currentIndex == 4) {
|
if (currentIndex == 3) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
context.pop();
|
context.pop();
|
||||||
|
|||||||
+8
-8
@@ -45,10 +45,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: async
|
name: async
|
||||||
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
|
sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.13.0"
|
version: "2.12.0"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -269,10 +269,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: fake_async
|
name: fake_async
|
||||||
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
|
sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.3"
|
version: "1.3.2"
|
||||||
ffi:
|
ffi:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -572,10 +572,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: leak_tracker
|
name: leak_tracker
|
||||||
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
|
sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "10.0.9"
|
version: "10.0.8"
|
||||||
leak_tracker_flutter_testing:
|
leak_tracker_flutter_testing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -1049,10 +1049,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: vm_service
|
name: vm_service
|
||||||
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
|
sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "15.0.0"
|
version: "14.3.1"
|
||||||
watcher:
|
watcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
Reference in New Issue
Block a user