Fix ui bugs

This commit is contained in:
problematicconsumer
2023-11-10 15:35:44 +03:30
parent e5166d3183
commit b9eae35fda
5 changed files with 105 additions and 93 deletions

View File

@@ -6,7 +6,8 @@ import 'package:hiddify/features/common/adaptive_root_scaffold.dart';
bool showDrawerButton(BuildContext context) {
if (!useMobileRouter) return true;
final String location = GoRouterState.of(context).uri.path;
if (location == const HomeRoute().location) return true;
if (location == const HomeRoute().location ||
location == const ProfilesRoute().location) return true;
if (location.startsWith(const ProxiesRoute().location)) return true;
return false;
}

View File

@@ -345,21 +345,27 @@ class ProfileSubscriptionInfo extends HookConsumerWidget {
children: [
Directionality(
textDirection: TextDirection.ltr,
child: Text(
subInfo.total > 10 * 1099511627776 //10TB
? "∞ GiB"
: subInfo.consumption.sizeOf(subInfo.total),
semanticsLabel:
t.profile.subscription.remainingTrafficSemanticLabel(
consumed: subInfo.consumption.sizeGB(),
total: subInfo.total.sizeGB(),
child: Flexible(
child: Text(
subInfo.total > 10 * 1099511627776 //10TB
? "∞ GiB"
: subInfo.consumption.sizeOf(subInfo.total),
semanticsLabel:
t.profile.subscription.remainingTrafficSemanticLabel(
consumed: subInfo.consumption.sizeGB(),
total: subInfo.total.sizeGB(),
),
style: theme.textTheme.bodySmall,
overflow: TextOverflow.ellipsis,
),
style: theme.textTheme.bodySmall,
),
),
Text(
remaining.$1,
style: theme.textTheme.bodySmall?.copyWith(color: remaining.$2),
Flexible(
child: Text(
remaining.$1,
style: theme.textTheme.bodySmall?.copyWith(color: remaining.$2),
overflow: TextOverflow.ellipsis,
),
),
],
);