feat: Implement Hubs feature with dedicated navigation, a home page action card, a settings quick link, and localization.
This commit is contained in:
@@ -12,4 +12,9 @@ extension ClientHomeNavigator on IModularNavigator {
|
||||
void pushSettings() {
|
||||
pushNamed('/client-settings/');
|
||||
}
|
||||
|
||||
/// Navigates to the hubs page.
|
||||
void pushHubs() {
|
||||
pushNamed('/client/hubs');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,6 +324,7 @@ class ClientHomePage extends StatelessWidget {
|
||||
return ActionsWidget(
|
||||
onRapidPressed: () {},
|
||||
onCreateOrderPressed: () => _openOrderFormSheet(context, null),
|
||||
onHubsPressed: () => Modular.to.pushHubs(),
|
||||
);
|
||||
case 'reorder':
|
||||
return ReorderWidget(
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user