feat: Implement Hubs feature with dedicated navigation, a home page action card, a settings quick link, and localization.

This commit is contained in:
Achintha Isuru
2026-01-21 20:11:09 -05:00
parent 9d9d2aa456
commit 61d7c08c95
15 changed files with 65 additions and 7 deletions

View File

@@ -12,4 +12,9 @@ extension ClientHomeNavigator on IModularNavigator {
void pushSettings() {
pushNamed('/client-settings/');
}
/// Navigates to the hubs page.
void pushHubs() {
pushNamed('/client/hubs');
}
}

View File

@@ -324,6 +324,7 @@ class ClientHomePage extends StatelessWidget {
return ActionsWidget(
onRapidPressed: () {},
onCreateOrderPressed: () => _openOrderFormSheet(context, null),
onHubsPressed: () => Modular.to.pushHubs(),
);
case 'reorder':
return ReorderWidget(

View File

@@ -10,11 +10,15 @@ class ActionsWidget extends StatelessWidget {
/// Callback when Create Order is pressed.
final VoidCallback onCreateOrderPressed;
/// Callback when Hubs is pressed.
final VoidCallback onHubsPressed;
/// Creates an [ActionsWidget].
const ActionsWidget({
super.key,
required this.onRapidPressed,
required this.onCreateOrderPressed,
required this.onHubsPressed,
});
@override
@@ -53,6 +57,21 @@ class ActionsWidget extends StatelessWidget {
onTap: onCreateOrderPressed,
),
),
const SizedBox(width: UiConstants.space2),
Expanded(
child: _ActionCard(
title: i18n.hubs,
subtitle: i18n.hubs_subtitle,
icon: UiIcons.nfc,
color: const Color(0xFFF0FDF4),
borderColor: const Color(0xFFBBF7D0),
iconBgColor: const Color(0xFFDCFCE7),
iconColor: const Color(0xFF16A34A),
textColor: const Color(0xFF064E3B),
subtitleColor: const Color(0xFF15803D),
onTap: onHubsPressed,
),
),
],
);
}