From 0984892a014be76b36955015e41e67968d0715d0 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Wed, 6 Sep 2023 20:01:56 +0300 Subject: [PATCH] feat: UI tweaks for server costs --- assets/translations/en.json | 4 +- .../initializing/server_type_picker.dart | 138 +++++++++++++++--- 2 files changed, 116 insertions(+), 26 deletions(-) diff --git a/assets/translations/en.json b/assets/translations/en.json index 0a25ff43..4ba733ac 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -358,9 +358,9 @@ "choose_server_type_ram": "{} GB of RAM", "choose_server_type_storage": "{} GB of system storage", "choose_server_type_payment_per_month": "{} per month", - "choose_server_type_payment_server": "{} for server", + "choose_server_type_payment_server": "{} for the server", "choose_server_type_payment_storage": "{} for additional storage", - "choose_server_type_payment_ip": "{} for public IPv4", + "choose_server_type_payment_ip": "{} for the public IPv4 address", "no_server_types_found": "No available server types found. Make sure your account is accessible and try to change your server location.", "dns_provider_bad_key_error": "API key is invalid", "backblaze_bad_key_error": "Backblaze storage information is invalid", diff --git a/lib/ui/pages/setup/initializing/server_type_picker.dart b/lib/ui/pages/setup/initializing/server_type_picker.dart index cb9b496a..3ce0f94b 100644 --- a/lib/ui/pages/setup/initializing/server_type_picker.dart +++ b/lib/ui/pages/setup/initializing/server_type_picker.dart @@ -338,32 +338,122 @@ class SelectTypePage extends StatelessWidget { ), ], ), - Text( - 'initializing.choose_server_type_payment_server' - .tr( - args: [type.price.value.toString()], + IntrinsicHeight( + child: Row( + children: [ + VerticalDivider( + width: 24.0, + indent: 4.0, + endIndent: 4.0, + color: Theme.of(context) + .colorScheme + .onSurface + .withAlpha(128), + ), + const SizedBox(width: 8), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + children: [ + Icon( + Icons.memory_outlined, + color: Theme.of(context) + .colorScheme + .onSurface + .withAlpha(128), + size: 16, + ), + const SizedBox(width: 8), + Text( + 'initializing.choose_server_type_payment_server' + .tr( + args: [ + type.price.value + .toString() + ], + ), + style: Theme.of(context) + .textTheme + .bodyMedium + ?.copyWith( + color: Theme.of(context) + .colorScheme + .onSurface + .withAlpha(128), + ), + ), + ], + ), + Row( + children: [ + Icon( + Icons.sd_card_outlined, + color: Theme.of(context) + .colorScheme + .onSurface + .withAlpha(128), + size: 16, + ), + const SizedBox(width: 8), + Text( + 'initializing.choose_server_type_payment_storage' + .tr( + args: [ + storagePrice.toString() + ], + ), + style: Theme.of(context) + .textTheme + .bodyMedium + ?.copyWith( + color: Theme.of(context) + .colorScheme + .onSurface + .withAlpha(128), + ), + ), + ], + ), + if (publicIpPrice != 0) + Row( + children: [ + Icon( + Icons.lan_outlined, + color: Theme.of(context) + .colorScheme + .onSurface + .withAlpha(128), + size: 16, + ), + const SizedBox(width: 8), + Text( + 'initializing.choose_server_type_payment_ip' + .tr( + args: [ + publicIpPrice.toString() + ], + ), + style: Theme.of(context) + .textTheme + .bodyMedium + ?.copyWith( + color: Theme.of( + context, + ) + .colorScheme + .onSurface + .withAlpha(128), + ), + ), + ], + ), + ], + ), + ], ), - style: - Theme.of(context).textTheme.bodyMedium, ), - Text( - 'initializing.choose_server_type_payment_storage' - .tr( - args: [storagePrice.toString()], - ), - style: - Theme.of(context).textTheme.bodyMedium, - ), - if (publicIpPrice != 0) - Text( - 'initializing.choose_server_type_payment_ip' - .tr( - args: [publicIpPrice.toString()], - ), - style: Theme.of(context) - .textTheme - .bodyMedium, - ), ], ), ),