💄 Optimized bottom nav

This commit is contained in:
2025-06-26 01:54:43 +08:00
parent 891a0b999c
commit 2b237eaad9
7 changed files with 117 additions and 35 deletions

View File

@ -0,0 +1,27 @@
import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:island/route.gr.dart';
import 'package:island/screens/tabs.dart';
class ConditionalBottomNav extends HookConsumerWidget {
final Widget child;
const ConditionalBottomNav({super.key, required this.child});
@override
Widget build(BuildContext context, WidgetRef ref) {
final currentRouteName = ref.watch(currentRouteProvider);
const mainTabRoutes = {
ExploreRoute.name,
ChatListRoute.name,
RealmListRoute.name,
AccountRoute.name,
};
debugPrint(currentRouteName);
final shouldShowBottomNav = mainTabRoutes.contains(currentRouteName);
return shouldShowBottomNav ? child : const SizedBox.shrink();
}
}

View File

@ -733,12 +733,16 @@ class _PostTruncateHint extends StatelessWidget {
color: Theme.of(context).colorScheme.secondary,
),
SizedBox(width: isCompact ? 4 : 6),
Text(
'postTruncated'.tr(),
style: TextStyle(
fontSize: isCompact ? 10 : 12,
color: Theme.of(context).colorScheme.secondary,
fontStyle: FontStyle.italic,
Flexible(
child: Text(
'postTruncated'.tr(),
style: TextStyle(
fontSize: isCompact ? 10 : 12,
color: Theme.of(context).colorScheme.secondary,
fontStyle: FontStyle.italic,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
SizedBox(width: isCompact ? 3 : 4),