2023-09-13 00:37:12 +00:00
|
|
|
import 'package:cubit_form/cubit_form.dart';
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:selfprivacy/logic/cubit/forms/setup/initializing/backblaze_form_cubit.dart';
|
|
|
|
import 'package:selfprivacy/logic/cubit/support_system/support_system_cubit.dart';
|
|
|
|
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
|
|
|
import 'package:selfprivacy/ui/layouts/responsive_layout_with_infobox.dart';
|
|
|
|
|
2023-09-27 02:44:46 +00:00
|
|
|
class BackupProviderPicker extends StatelessWidget {
|
|
|
|
const BackupProviderPicker({
|
2023-09-13 00:37:12 +00:00
|
|
|
super.key,
|
|
|
|
});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(final BuildContext context) => ResponsiveLayoutWithInfobox(
|
|
|
|
topChild: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'${'initializing.connect_to_server_provider'.tr()}Backblaze',
|
|
|
|
style: Theme.of(context).textTheme.headlineSmall,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
primaryColumn: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
CubitFormTextField(
|
|
|
|
autofocus: true,
|
|
|
|
formFieldCubit: context.read<BackblazeFormCubit>().keyId,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
scrollPadding: const EdgeInsets.only(bottom: 70),
|
|
|
|
decoration: const InputDecoration(
|
|
|
|
hintText: 'KeyID',
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
CubitFormTextField(
|
|
|
|
formFieldCubit: context.read<BackblazeFormCubit>().applicationKey,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
scrollPadding: const EdgeInsets.only(bottom: 70),
|
|
|
|
decoration: const InputDecoration(
|
|
|
|
hintText: 'Master Application Key',
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 32),
|
|
|
|
BrandButton.rised(
|
|
|
|
onPressed: () => context.read<BackblazeFormCubit>().trySubmit(),
|
|
|
|
text: 'basis.connect'.tr(),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 10),
|
|
|
|
BrandButton.text(
|
|
|
|
onPressed: () {
|
|
|
|
context.read<SupportSystemCubit>().showArticle(
|
|
|
|
article: 'how_backblaze',
|
|
|
|
context: context,
|
|
|
|
);
|
|
|
|
Scaffold.of(context).openEndDrawer();
|
|
|
|
},
|
|
|
|
title: 'initializing.how'.tr(),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|