mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-02-04 23:40:38 +00:00
feat(initializing): Add description and back button to server type step
This commit is contained in:
parent
b53bb6d4dd
commit
b2a5d57a1d
|
@ -273,6 +273,8 @@
|
||||||
"place_where_data": "A place where your data and SelfPrivacy services will reside:",
|
"place_where_data": "A place where your data and SelfPrivacy services will reside:",
|
||||||
"how": "How to obtain API token",
|
"how": "How to obtain API token",
|
||||||
"provider_bad_key_error": "Provider API key is invalid",
|
"provider_bad_key_error": "Provider API key is invalid",
|
||||||
|
"choose_location_type": "Choose your server location and type:",
|
||||||
|
"back_to_locations": "Go back to available locations!",
|
||||||
"no_locations_found": "No available locations found. Make sure your account is accessible.",
|
"no_locations_found": "No available locations found. Make sure your account is accessible.",
|
||||||
"no_server_types_found": "No available server types found. Make sure your account is accessible and try to change your server location.",
|
"no_server_types_found": "No available server types found. Make sure your account is accessible and try to change your server location.",
|
||||||
"cloudflare_bad_key_error": "Cloudflare API key is invalid",
|
"cloudflare_bad_key_error": "Cloudflare API key is invalid",
|
||||||
|
|
|
@ -271,7 +271,9 @@
|
||||||
"connect_to_server": "Подключите сервер",
|
"connect_to_server": "Подключите сервер",
|
||||||
"place_where_data": "Здесь будут жить ваши данные и SelfPrivacy-сервисы:",
|
"place_where_data": "Здесь будут жить ваши данные и SelfPrivacy-сервисы:",
|
||||||
"how": "Как получить API Token",
|
"how": "Как получить API Token",
|
||||||
"provider_bad_key_error": "API ключ провайдера неверен",
|
"provider_bad_key_error": "Provider API key is invalid",
|
||||||
|
"choose_location_type": "Выберите локацию и тип вашего сервера:",
|
||||||
|
"back_to_locations": "Назад к доступным локациям!",
|
||||||
"no_locations_found": "Не найдено локаций. Убедитесь, что ваш аккаунт доступен.",
|
"no_locations_found": "Не найдено локаций. Убедитесь, что ваш аккаунт доступен.",
|
||||||
"no_server_types_found": "Не удалось получить список серверов. Убедитесь, что ваш аккаунт доступен и попытайтесь сменить локацию сервера.",
|
"no_server_types_found": "Не удалось получить список серверов. Убедитесь, что ваш аккаунт доступен и попытайтесь сменить локацию сервера.",
|
||||||
"cloudflare_bad_key_error": "Cloudflare API ключ неверен",
|
"cloudflare_bad_key_error": "Cloudflare API ключ неверен",
|
||||||
|
|
|
@ -82,6 +82,11 @@ class InitializingPage extends StatelessWidget {
|
||||||
activeIndex: cubit.state.porgressBar,
|
activeIndex: cubit.state.porgressBar,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
if (cubit.state.porgressBar ==
|
||||||
|
ServerSetupProgress.serverProviderFilled.index)
|
||||||
|
BrandText.h2(
|
||||||
|
'initializing.choose_location_type'.tr(),
|
||||||
|
),
|
||||||
_addCard(
|
_addCard(
|
||||||
AnimatedSwitcher(
|
AnimatedSwitcher(
|
||||||
duration: const Duration(milliseconds: 300),
|
duration: const Duration(milliseconds: 300),
|
||||||
|
|
|
@ -4,6 +4,7 @@ import 'package:selfprivacy/config/brand_theme.dart';
|
||||||
import 'package:selfprivacy/logic/cubit/app_config_dependent/authentication_dependend_cubit.dart';
|
import 'package:selfprivacy/logic/cubit/app_config_dependent/authentication_dependend_cubit.dart';
|
||||||
import 'package:selfprivacy/logic/models/server_provider_location.dart';
|
import 'package:selfprivacy/logic/models/server_provider_location.dart';
|
||||||
import 'package:selfprivacy/logic/models/server_type.dart';
|
import 'package:selfprivacy/logic/models/server_type.dart';
|
||||||
|
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
|
||||||
|
|
||||||
class ServerTypePicker extends StatefulWidget {
|
class ServerTypePicker extends StatefulWidget {
|
||||||
const ServerTypePicker({
|
const ServerTypePicker({
|
||||||
|
@ -21,7 +22,7 @@ class _ServerTypePickerState extends State<ServerTypePicker> {
|
||||||
ServerProviderLocation? serverProviderLocation;
|
ServerProviderLocation? serverProviderLocation;
|
||||||
ServerType? serverType;
|
ServerType? serverType;
|
||||||
|
|
||||||
void setServerProviderLocation(final ServerProviderLocation location) {
|
void setServerProviderLocation(final ServerProviderLocation? location) {
|
||||||
setState(() {
|
setState(() {
|
||||||
serverProviderLocation = location;
|
serverProviderLocation = location;
|
||||||
});
|
});
|
||||||
|
@ -39,6 +40,9 @@ class _ServerTypePickerState extends State<ServerTypePicker> {
|
||||||
return SelectTypePage(
|
return SelectTypePage(
|
||||||
location: serverProviderLocation!,
|
location: serverProviderLocation!,
|
||||||
serverInstallationCubit: widget.serverInstallationCubit,
|
serverInstallationCubit: widget.serverInstallationCubit,
|
||||||
|
backToLocationPickingCallback: () {
|
||||||
|
setServerProviderLocation(null);
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,6 +106,7 @@ class SelectLocationPage extends StatelessWidget {
|
||||||
|
|
||||||
class SelectTypePage extends StatelessWidget {
|
class SelectTypePage extends StatelessWidget {
|
||||||
const SelectTypePage({
|
const SelectTypePage({
|
||||||
|
required this.backToLocationPickingCallback,
|
||||||
required this.location,
|
required this.location,
|
||||||
required this.serverInstallationCubit,
|
required this.serverInstallationCubit,
|
||||||
super.key,
|
super.key,
|
||||||
|
@ -109,6 +114,7 @@ class SelectTypePage extends StatelessWidget {
|
||||||
|
|
||||||
final ServerProviderLocation location;
|
final ServerProviderLocation location;
|
||||||
final ServerInstallationCubit serverInstallationCubit;
|
final ServerInstallationCubit serverInstallationCubit;
|
||||||
|
final Function backToLocationPickingCallback;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(final BuildContext context) => FutureBuilder(
|
Widget build(final BuildContext context) => FutureBuilder(
|
||||||
|
@ -119,7 +125,20 @@ class SelectTypePage extends StatelessWidget {
|
||||||
) {
|
) {
|
||||||
if (snapshot.hasData) {
|
if (snapshot.hasData) {
|
||||||
if ((snapshot.data as List<ServerType>).isEmpty) {
|
if ((snapshot.data as List<ServerType>).isEmpty) {
|
||||||
return Text('initializing.no_server_types_found'.tr());
|
return Column(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'initializing.no_server_types_found'.tr(),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
BrandButton.rised(
|
||||||
|
onPressed: () {
|
||||||
|
backToLocationPickingCallback();
|
||||||
|
},
|
||||||
|
text: 'initializing.back_to_locations'.tr(),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return ListView(
|
return ListView(
|
||||||
padding: paddingH15V0,
|
padding: paddingH15V0,
|
||||||
|
|
Loading…
Reference in a new issue