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,6 +345,7 @@ class ProfileSubscriptionInfo extends HookConsumerWidget {
children: [
Directionality(
textDirection: TextDirection.ltr,
child: Flexible(
child: Text(
subInfo.total > 10 * 1099511627776 //10TB
? "∞ GiB"
@@ -355,11 +356,16 @@ class ProfileSubscriptionInfo extends HookConsumerWidget {
total: subInfo.total.sizeGB(),
),
style: theme.textTheme.bodySmall,
overflow: TextOverflow.ellipsis,
),
),
Text(
),
Flexible(
child: Text(
remaining.$1,
style: theme.textTheme.bodySmall?.copyWith(color: remaining.$2),
overflow: TextOverflow.ellipsis,
),
),
],
);

View File

@@ -1,6 +1,5 @@
import 'package:dartx/dartx.dart';
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:hiddify/core/core_providers.dart';
import 'package:hiddify/core/router/router.dart';
import 'package:hiddify/domain/failures.dart';
@@ -30,13 +29,18 @@ class HomePage extends HookConsumerWidget {
CustomScrollView(
slivers: [
NestedAppBar(
title: Row(
title: Text.rich(
TextSpan(
children: [
Text(t.general.appTitle),
const Gap(4),
const AppVersionLabel(),
TextSpan(text: t.general.appTitle),
const TextSpan(text: " "),
const WidgetSpan(
child: AppVersionLabel(),
alignment: PlaceholderAlignment.middle,
),
],
),
),
actions: [
IconButton(
onPressed: () => const AddProfileRoute().push(context),

View File

@@ -21,17 +21,17 @@ class IntroPage extends HookConsumerWidget with PresLogger {
final isStarting = useState(false);
return Scaffold(
return SafeArea(
child: Scaffold(
body: CustomScrollView(
shrinkWrap: true,
slivers: [
const SliverGap(24),
SliverToBoxAdapter(
child: SizedBox(
width: 248,
height: 248,
width: 224,
height: 224,
child: Padding(
padding: const EdgeInsets.all(36),
padding: const EdgeInsets.all(24),
child: Assets.images.logo.svg(),
),
),
@@ -41,11 +41,11 @@ class IntroPage extends HookConsumerWidget with PresLogger {
child: MultiSliver(
children: [
const LocalePrefTile(),
const SliverGap(8),
const SliverGap(4),
const RegionPrefTile(),
const SliverGap(8),
const SliverGap(4),
const EnableAnalyticsPrefTile(),
const SliverGap(8),
const SliverGap(4),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Text.rich(
@@ -102,6 +102,7 @@ class IntroPage extends HookConsumerWidget with PresLogger {
),
],
),
),
);
}
}

View File

@@ -15,7 +15,7 @@ class BottomSheetPage extends Page {
Route<void> createRoute(BuildContext context) {
return ModalBottomSheetRoute(
settings: this,
isScrollControlled: !fixed,
isScrollControlled: true,
useSafeArea: true,
showDragHandle: true,
builder: (_) {