check
This commit is contained in:
@@ -78,13 +78,36 @@ class AppSidebar extends ConsumerWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _Brand extends StatelessWidget {
|
||||
/// Store name beside the mark.
|
||||
///
|
||||
/// Used to read "Nearle / POS", which told the person standing at the till
|
||||
/// nothing they did not already know — they can see which app is open. What is
|
||||
/// worth the space is which shop and which branch this terminal is signed into,
|
||||
/// because one person works several and a bill rung against the wrong outlet is
|
||||
/// found the next morning. Both come from the sign-in response.
|
||||
class _Brand extends ConsumerWidget {
|
||||
const _Brand({required this.expanded});
|
||||
|
||||
final bool expanded;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final store = ref.watch(storeDisplayNameProvider);
|
||||
final location = ref.watch(locationDisplayNameProvider);
|
||||
|
||||
// Before the back office has answered, fall back to whatever the store
|
||||
// record on this terminal says rather than to the product's own name.
|
||||
final title = store.isNotEmpty
|
||||
? store
|
||||
: (ref.watch(currentStoreProvider)?.name ?? 'Store');
|
||||
|
||||
// A single-outlet shop usually names the tenant and the branch the same
|
||||
// thing; repeating it twice would look like a bug.
|
||||
final subtitle =
|
||||
(location.isEmpty || location.toLowerCase() == title.toLowerCase())
|
||||
? 'POS'
|
||||
: location;
|
||||
|
||||
return Container(
|
||||
height: AppSizes.headerHeight,
|
||||
padding: EdgeInsets.symmetric(
|
||||
@@ -102,9 +125,11 @@ class _Brand extends StatelessWidget {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'Nearle',
|
||||
style: TextStyle(
|
||||
Text(
|
||||
title,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(
|
||||
fontSize: 17,
|
||||
fontWeight: FontWeight.w700,
|
||||
letterSpacing: -0.3,
|
||||
@@ -113,7 +138,9 @@ class _Brand extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'POS',
|
||||
subtitle,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: AppTypography.sectionLabel()
|
||||
.copyWith(color: AppColors.primary),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user