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,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,6 @@ import 'package:flutter_modular/flutter_modular.dart';
|
||||
extension ClientHubsNavigator on IModularNavigator {
|
||||
/// Navigates to the client hubs page.
|
||||
Future<void> pushClientHubs() async {
|
||||
await pushNamed('/client/hubs/');
|
||||
await pushNamed('/client/hubs');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,6 +196,10 @@ class ClientHubsPage extends StatelessWidget {
|
||||
).add(const ClientHubsAddDialogToggled(visible: true)),
|
||||
text: t.client_hubs.add_hub,
|
||||
leadingIcon: LucideIcons.plus,
|
||||
style: ElevatedButton.styleFrom(
|
||||
minimumSize: Size(0, 40),
|
||||
maximumSize: Size.fromHeight(40),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -7,4 +7,9 @@ extension ClientSettingsNavigator on IModularNavigator {
|
||||
void pushClientSettings() {
|
||||
pushNamed('/client/settings/');
|
||||
}
|
||||
|
||||
/// Navigates to the hubs page.
|
||||
void pushHubs() {
|
||||
pushNamed('/client/hubs');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import 'package:core_localization/core_localization.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import '../../navigation/client_settings_navigator.dart';
|
||||
|
||||
/// A widget that displays a list of quick links in a card.
|
||||
class SettingsQuickLinks extends StatelessWidget {
|
||||
@@ -34,7 +36,7 @@ class SettingsQuickLinks extends StatelessWidget {
|
||||
_QuickLinkItem(
|
||||
icon: UiIcons.nfc,
|
||||
title: labels.clock_in_hubs,
|
||||
onTap: () {},
|
||||
onTap: () => Modular.to.pushHubs(),
|
||||
),
|
||||
_QuickLinkItem(
|
||||
icon: UiIcons.building,
|
||||
|
||||
Reference in New Issue
Block a user