@@ -1473,7 +1473,8 @@ class _HomePageState extends State<HomePage> {
14731473 final crossAxisCount = _calculateGridColumnCount (context);
14741474 _currentGridColumns = crossAxisCount;
14751475 if (_hasLoaded) {
1476- if (_filteredCodes.isEmpty && _searchText.isEmpty) {
1476+ final bool noCodesAnywhere = ! hasNonTrashedCodes && ! hasTrashedCodes;
1477+ if (_filteredCodes.isEmpty && _searchText.isEmpty && noCodesAnywhere) {
14771478 return HomeEmptyStateWidget (
14781479 onScanTap: _redirectToScannerPage,
14791480 onManuallySetupTap: _redirectToManualEntryPage,
@@ -1482,8 +1483,18 @@ class _HomePageState extends State<HomePage> {
14821483 final anyCodeHasError =
14831484 _allCodes? .firstWhereOrNull ((element) => element.hasError) != null ;
14841485 final indexOffset = anyCodeHasError ? 1 : 0 ;
1485- final itemCount = (hasNonTrashedCodes ? tags.length + 1 : 0 ) +
1486- (hasTrashedCodes ? 1 : 0 );
1486+ final bool showAllChip = hasNonTrashedCodes || hasTrashedCodes;
1487+ final bool showTrashChip = hasTrashedCodes;
1488+ final int itemCount =
1489+ (showAllChip ? 1 : 0 ) + tags.length + (showTrashChip ? 1 : 0 );
1490+ final bool showAllEmptyHint =
1491+ showAllChip &&
1492+ selectedTag.isEmpty &&
1493+ ! _isTrashOpen &&
1494+ _filteredCodes.isEmpty &&
1495+ _searchText.isEmpty &&
1496+ ! hasNonTrashedCodes &&
1497+ hasTrashedCodes;
14871498
14881499 final list = Column (
14891500 crossAxisAlignment: CrossAxisAlignment .start,
@@ -1499,7 +1510,7 @@ class _HomePageState extends State<HomePage> {
14991510 const SizedBox (width: 8 ),
15001511 itemCount: itemCount,
15011512 itemBuilder: (context, index) {
1502- if (index == 0 && hasNonTrashedCodes ) {
1513+ if (showAllChip && index == 0 ) {
15031514 return TagChip (
15041515 label: l10n.all,
15051516 state: selectedTag == "" && _isTrashOpen == false
@@ -1516,7 +1527,7 @@ class _HomePageState extends State<HomePage> {
15161527 );
15171528 }
15181529
1519- if (index == itemCount - 1 && hasTrashedCodes ) {
1530+ if (showTrashChip && index == itemCount - 1 ) {
15201531 return TagChip (
15211532 label: l10n.trash,
15221533 state: _isTrashOpen
@@ -1532,7 +1543,7 @@ class _HomePageState extends State<HomePage> {
15321543 iconData: Icons .delete,
15331544 );
15341545 }
1535- final customTagIndex = index - 1 ;
1546+ final customTagIndex = index - (showAllChip ? 1 : 0 ) ;
15361547 if (customTagIndex >= 0 && customTagIndex < tags.length) {
15371548 return TagChip (
15381549 label: tags[customTagIndex],
@@ -1562,6 +1573,25 @@ class _HomePageState extends State<HomePage> {
15621573 Expanded (
15631574 child: Builder (
15641575 builder: (context) {
1576+ if (showAllEmptyHint) {
1577+ final textStyle = Theme .of (context).textTheme.bodyLarge ??
1578+ Theme .of (context).textTheme.bodyMedium ??
1579+ const TextStyle ();
1580+ return Padding (
1581+ padding: const EdgeInsets .only (bottom: 64.0 ),
1582+ child: Center (
1583+ child: Padding (
1584+ padding:
1585+ const EdgeInsets .symmetric (horizontal: 24.0 ),
1586+ child: Text (
1587+ l10n.allTabEmptyHint,
1588+ textAlign: TextAlign .center,
1589+ style: textStyle,
1590+ ),
1591+ ),
1592+ ),
1593+ );
1594+ }
15651595 final gridView = AlignedGridView .count (
15661596 crossAxisCount: crossAxisCount,
15671597 physics: const AlwaysScrollableScrollPhysics (),
0 commit comments