Bug fixes and linting
parent
ad53000415
commit
18d0c2c40f
|
@ -82,6 +82,7 @@ ThemeData darkTheme = lightTheme.copyWith(
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
const EdgeInsets paddingH15V30 = EdgeInsets.symmetric(horizontal: 15, vertical: 30);
|
const EdgeInsets paddingH15V30 =
|
||||||
|
EdgeInsets.symmetric(horizontal: 15, vertical: 30);
|
||||||
|
|
||||||
const EdgeInsets paddingH15V0 = EdgeInsets.symmetric(horizontal: 15);
|
const EdgeInsets paddingH15V0 = EdgeInsets.symmetric(horizontal: 15);
|
||||||
|
|
|
@ -25,7 +25,8 @@ class HiveConfig {
|
||||||
await Hive.openBox(BNames.appSettingsBox);
|
await Hive.openBox(BNames.appSettingsBox);
|
||||||
|
|
||||||
final HiveAesCipher cipher = HiveAesCipher(
|
final HiveAesCipher cipher = HiveAesCipher(
|
||||||
await getEncryptedKey(BNames.serverInstallationEncryptionKey),);
|
await getEncryptedKey(BNames.serverInstallationEncryptionKey),
|
||||||
|
);
|
||||||
|
|
||||||
await Hive.openBox<User>(BNames.usersDeprecated);
|
await Hive.openBox<User>(BNames.usersDeprecated);
|
||||||
await Hive.openBox<User>(BNames.usersBox, encryptionCipher: cipher);
|
await Hive.openBox<User>(BNames.usersBox, encryptionCipher: cipher);
|
||||||
|
|
|
@ -63,9 +63,11 @@ final TextStyle buttonTitleText = defaultTextStyle.copyWith(
|
||||||
height: 1,
|
height: 1,
|
||||||
);
|
);
|
||||||
|
|
||||||
final TextStyle mediumStyle = defaultTextStyle.copyWith(fontSize: 13, height: 1.53);
|
final TextStyle mediumStyle =
|
||||||
|
defaultTextStyle.copyWith(fontSize: 13, height: 1.53);
|
||||||
|
|
||||||
final TextStyle smallStyle = defaultTextStyle.copyWith(fontSize: 11, height: 1.45);
|
final TextStyle smallStyle =
|
||||||
|
defaultTextStyle.copyWith(fontSize: 11, height: 1.45);
|
||||||
|
|
||||||
const TextStyle progressTextStyleLight = TextStyle(
|
const TextStyle progressTextStyleLight = TextStyle(
|
||||||
fontSize: 11,
|
fontSize: 11,
|
||||||
|
|
|
@ -61,7 +61,6 @@ class Loading extends DomainSetupState {
|
||||||
enum LoadingTypes { loadingDomain, saving }
|
enum LoadingTypes { loadingDomain, saving }
|
||||||
|
|
||||||
class Loaded extends DomainSetupState {
|
class Loaded extends DomainSetupState {
|
||||||
|
|
||||||
Loaded(this.domain);
|
Loaded(this.domain);
|
||||||
final String domain;
|
final String domain;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,8 @@ class ProvidersCubit extends Cubit<ProvidersState> {
|
||||||
ProvidersCubit() : super(InitialProviderState());
|
ProvidersCubit() : super(InitialProviderState());
|
||||||
|
|
||||||
void connect(final ProviderModel provider) {
|
void connect(final ProviderModel provider) {
|
||||||
final ProvidersState newState = state.updateElement(provider, StateType.stable);
|
final ProvidersState newState =
|
||||||
|
state.updateElement(provider, StateType.stable);
|
||||||
emit(newState);
|
emit(newState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,8 +19,12 @@ class RecoveryKeyCubit
|
||||||
if (status == null) {
|
if (status == null) {
|
||||||
emit(state.copyWith(loadingStatus: LoadingStatus.error));
|
emit(state.copyWith(loadingStatus: LoadingStatus.error));
|
||||||
} else {
|
} else {
|
||||||
emit(state.copyWith(
|
emit(
|
||||||
status: status, loadingStatus: LoadingStatus.success,),);
|
state.copyWith(
|
||||||
|
status: status,
|
||||||
|
loadingStatus: LoadingStatus.success,
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
emit(state.copyWith(loadingStatus: LoadingStatus.uninitialized));
|
emit(state.copyWith(loadingStatus: LoadingStatus.uninitialized));
|
||||||
|
@ -44,7 +48,8 @@ class RecoveryKeyCubit
|
||||||
emit(state.copyWith(loadingStatus: LoadingStatus.error));
|
emit(state.copyWith(loadingStatus: LoadingStatus.error));
|
||||||
} else {
|
} else {
|
||||||
emit(
|
emit(
|
||||||
state.copyWith(status: status, loadingStatus: LoadingStatus.success),);
|
state.copyWith(status: status, loadingStatus: LoadingStatus.success),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +74,6 @@ class RecoveryKeyCubit
|
||||||
}
|
}
|
||||||
|
|
||||||
class GenerationError extends Error {
|
class GenerationError extends Error {
|
||||||
|
|
||||||
GenerationError(this.message);
|
GenerationError(this.message);
|
||||||
final String message;
|
final String message;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,12 +18,14 @@ class ServerDetailsCubit extends Cubit<ServerDetailsState> {
|
||||||
if (isReadyToCheck) {
|
if (isReadyToCheck) {
|
||||||
emit(ServerDetailsLoading());
|
emit(ServerDetailsLoading());
|
||||||
final ServerDetailsRepositoryDto data = await repository.load();
|
final ServerDetailsRepositoryDto data = await repository.load();
|
||||||
emit(Loaded(
|
emit(
|
||||||
|
Loaded(
|
||||||
serverInfo: data.hetznerServerInfo,
|
serverInfo: data.hetznerServerInfo,
|
||||||
autoUpgradeSettings: data.autoUpgradeSettings,
|
autoUpgradeSettings: data.autoUpgradeSettings,
|
||||||
serverTimezone: data.serverTimezone,
|
serverTimezone: data.serverTimezone,
|
||||||
checkTime: DateTime.now(),
|
checkTime: DateTime.now(),
|
||||||
),);
|
),
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
emit(ServerDetailsNotReady());
|
emit(ServerDetailsNotReady());
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,6 @@ class ServerDetailsRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
class ServerDetailsRepositoryDto {
|
class ServerDetailsRepositoryDto {
|
||||||
|
|
||||||
ServerDetailsRepositoryDto({
|
ServerDetailsRepositoryDto({
|
||||||
required this.hetznerServerInfo,
|
required this.hetznerServerInfo,
|
||||||
required this.serverTimezone,
|
required this.serverTimezone,
|
||||||
|
|
|
@ -146,8 +146,9 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void startServerIfDnsIsOkay(
|
void startServerIfDnsIsOkay({
|
||||||
{final ServerInstallationNotFinished? state,}) async {
|
final ServerInstallationNotFinished? state,
|
||||||
|
}) async {
|
||||||
final ServerInstallationNotFinished dataState =
|
final ServerInstallationNotFinished dataState =
|
||||||
state ?? this.state as ServerInstallationNotFinished;
|
state ?? this.state as ServerInstallationNotFinished;
|
||||||
|
|
||||||
|
@ -345,7 +346,9 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
void tryToRecover(
|
void tryToRecover(
|
||||||
final String token, final ServerRecoveryMethods method,) async {
|
final String token,
|
||||||
|
final ServerRecoveryMethods method,
|
||||||
|
) async {
|
||||||
final ServerInstallationRecovery dataState =
|
final ServerInstallationRecovery dataState =
|
||||||
state as ServerInstallationRecovery;
|
state as ServerInstallationRecovery;
|
||||||
final ServerDomain? serverDomain = dataState.serverDomain;
|
final ServerDomain? serverDomain = dataState.serverDomain;
|
||||||
|
@ -395,6 +398,9 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
void revertRecoveryStep() {
|
void revertRecoveryStep() {
|
||||||
|
if (state is ServerInstallationEmpty) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
final ServerInstallationRecovery dataState =
|
final ServerInstallationRecovery dataState =
|
||||||
state as ServerInstallationRecovery;
|
state as ServerInstallationRecovery;
|
||||||
switch (dataState.currentStep) {
|
switch (dataState.currentStep) {
|
||||||
|
@ -535,7 +541,8 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
void finishRecoveryProcess(
|
void finishRecoveryProcess(
|
||||||
final BackblazeCredential backblazeCredential,) async {
|
final BackblazeCredential backblazeCredential,
|
||||||
|
) async {
|
||||||
await repository.saveIsServerStarted(true);
|
await repository.saveIsServerStarted(true);
|
||||||
await repository.saveIsServerResetedFirstTime(true);
|
await repository.saveIsServerResetedFirstTime(true);
|
||||||
await repository.saveIsServerResetedSecondTime(true);
|
await repository.saveIsServerResetedSecondTime(true);
|
||||||
|
|
|
@ -4,11 +4,12 @@ part 'backblaze_bucket.g.dart';
|
||||||
|
|
||||||
@HiveType(typeId: 6)
|
@HiveType(typeId: 6)
|
||||||
class BackblazeBucket {
|
class BackblazeBucket {
|
||||||
BackblazeBucket(
|
BackblazeBucket({
|
||||||
{required this.bucketId,
|
required this.bucketId,
|
||||||
required this.bucketName,
|
required this.bucketName,
|
||||||
required this.applicationKeyId,
|
required this.applicationKeyId,
|
||||||
required this.applicationKey,});
|
required this.applicationKey,
|
||||||
|
});
|
||||||
|
|
||||||
@HiveField(0)
|
@HiveField(0)
|
||||||
final String bucketId;
|
final String bucketId;
|
||||||
|
|
|
@ -35,7 +35,8 @@ class ServerHostingDetails {
|
||||||
@HiveField(6, defaultValue: ServerProvider.hetzner)
|
@HiveField(6, defaultValue: ServerProvider.hetzner)
|
||||||
final ServerProvider provider;
|
final ServerProvider provider;
|
||||||
|
|
||||||
ServerHostingDetails copyWith({final DateTime? startTime}) => ServerHostingDetails(
|
ServerHostingDetails copyWith({final DateTime? startTime}) =>
|
||||||
|
ServerHostingDetails(
|
||||||
startTime: startTime ?? this.startTime,
|
startTime: startTime ?? this.startTime,
|
||||||
createTime: createTime,
|
createTime: createTime,
|
||||||
id: id,
|
id: id,
|
||||||
|
|
|
@ -4,7 +4,6 @@ part 'api_token.g.dart';
|
||||||
|
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class ApiToken {
|
class ApiToken {
|
||||||
|
|
||||||
factory ApiToken.fromJson(final Map<String, dynamic> json) =>
|
factory ApiToken.fromJson(final Map<String, dynamic> json) =>
|
||||||
_$ApiTokenFromJson(json);
|
_$ApiTokenFromJson(json);
|
||||||
ApiToken({
|
ApiToken({
|
||||||
|
|
|
@ -4,8 +4,8 @@ part 'backup.g.dart';
|
||||||
|
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class Backup {
|
class Backup {
|
||||||
|
factory Backup.fromJson(final Map<String, dynamic> json) =>
|
||||||
factory Backup.fromJson(final Map<String, dynamic> json) => _$BackupFromJson(json);
|
_$BackupFromJson(json);
|
||||||
Backup({required this.time, required this.id});
|
Backup({required this.time, required this.id});
|
||||||
|
|
||||||
// Time of the backup
|
// Time of the backup
|
||||||
|
@ -33,13 +33,13 @@ enum BackupStatusEnum {
|
||||||
|
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class BackupStatus {
|
class BackupStatus {
|
||||||
|
|
||||||
factory BackupStatus.fromJson(final Map<String, dynamic> json) =>
|
factory BackupStatus.fromJson(final Map<String, dynamic> json) =>
|
||||||
_$BackupStatusFromJson(json);
|
_$BackupStatusFromJson(json);
|
||||||
BackupStatus(
|
BackupStatus({
|
||||||
{required this.status,
|
required this.status,
|
||||||
required this.progress,
|
required this.progress,
|
||||||
required this.errorMessage,});
|
required this.errorMessage,
|
||||||
|
});
|
||||||
|
|
||||||
final BackupStatusEnum status;
|
final BackupStatusEnum status;
|
||||||
final double progress;
|
final double progress;
|
||||||
|
|
|
@ -4,7 +4,6 @@ part 'device_token.g.dart';
|
||||||
|
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class DeviceToken {
|
class DeviceToken {
|
||||||
|
|
||||||
factory DeviceToken.fromJson(final Map<String, dynamic> json) =>
|
factory DeviceToken.fromJson(final Map<String, dynamic> json) =>
|
||||||
_$DeviceTokenFromJson(json);
|
_$DeviceTokenFromJson(json);
|
||||||
DeviceToken({
|
DeviceToken({
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
class ServerStatus {
|
class ServerStatus {
|
||||||
|
|
||||||
ServerStatus({
|
ServerStatus({
|
||||||
required this.http,
|
required this.http,
|
||||||
this.imap = StatusTypes.nodata,
|
this.imap = StatusTypes.nodata,
|
||||||
|
|
|
@ -55,7 +55,7 @@ class _BrandMarkdownState extends State<BrandMarkdown> {
|
||||||
color: isDark ? BrandColors.white : null,
|
color: isDark ? BrandColors.white : null,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
return Markdown(
|
return MarkdownBody(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
styleSheet: markdown,
|
styleSheet: markdown,
|
||||||
onTapLink: (final String text, final String? href, final String title) {
|
onTapLink: (final String text, final String? href, final String title) {
|
||||||
|
|
|
@ -66,7 +66,7 @@ class _KeyDisplay extends StatelessWidget {
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
Text(
|
Text(
|
||||||
'devices.add_new_device_screen.tip'.tr(),
|
'devices.add_new_device_screen.tip'.tr(),
|
||||||
style: Theme.of(context).textTheme.bodyMedium!,
|
style: Theme.of(context).textTheme.bodyMedium,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
@ -234,7 +234,9 @@ class _RecoveryKeyConfigurationState extends State<RecoveryKeyConfiguration> {
|
||||||
: null,
|
: null,
|
||||||
expirationDate: _isExpirationToggled ? _selectedDate : null,
|
expirationDate: _isExpirationToggled ? _selectedDate : null,
|
||||||
);
|
);
|
||||||
if (!mounted) return;
|
if (!mounted) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
setState(() {
|
setState(() {
|
||||||
_isLoading = false;
|
_isLoading = false;
|
||||||
});
|
});
|
||||||
|
|
|
@ -8,11 +8,11 @@ import 'package:intl/intl.dart';
|
||||||
|
|
||||||
class CpuChart extends StatelessWidget {
|
class CpuChart extends StatelessWidget {
|
||||||
const CpuChart({
|
const CpuChart({
|
||||||
final Key? key,
|
|
||||||
required this.data,
|
required this.data,
|
||||||
required this.period,
|
required this.period,
|
||||||
required this.start,
|
required this.start,
|
||||||
}) : super(key: key);
|
final super.key,
|
||||||
|
});
|
||||||
|
|
||||||
final List<TimeSeriesData> data;
|
final List<TimeSeriesData> data;
|
||||||
final Period period;
|
final Period period;
|
||||||
|
|
|
@ -10,11 +10,11 @@ import 'package:intl/intl.dart';
|
||||||
|
|
||||||
class NetworkChart extends StatelessWidget {
|
class NetworkChart extends StatelessWidget {
|
||||||
const NetworkChart({
|
const NetworkChart({
|
||||||
final Key? key,
|
|
||||||
required this.listData,
|
required this.listData,
|
||||||
required this.period,
|
required this.period,
|
||||||
required this.start,
|
required this.start,
|
||||||
}) : super(key: key);
|
final super.key,
|
||||||
|
});
|
||||||
|
|
||||||
final List<List<TimeSeriesData>> listData;
|
final List<List<TimeSeriesData>> listData;
|
||||||
final Period period;
|
final Period period;
|
||||||
|
|
|
@ -567,9 +567,14 @@ class _HowTo extends StatelessWidget {
|
||||||
isExpended: true,
|
isExpended: true,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: paddingH15V0,
|
padding: paddingH15V0,
|
||||||
child: BrandMarkdown(
|
child: ListView(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||||
|
children: [
|
||||||
|
BrandMarkdown(
|
||||||
fileName: fileName,
|
fileName: fileName,
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,8 +17,8 @@ class RecoverByNewDeviceKeyInstruction extends StatelessWidget {
|
||||||
heroSubtitle: 'recovering.method_device_description'.tr(),
|
heroSubtitle: 'recovering.method_device_description'.tr(),
|
||||||
hasBackButton: true,
|
hasBackButton: true,
|
||||||
hasFlashButton: false,
|
hasFlashButton: false,
|
||||||
onBackButtonPressed: () =>
|
onBackButtonPressed:
|
||||||
context.read<ServerInstallationCubit>().revertRecoveryStep(),
|
context.read<ServerInstallationCubit>().revertRecoveryStep,
|
||||||
children: [
|
children: [
|
||||||
FilledButton(
|
FilledButton(
|
||||||
title: 'recovering.method_device_button'.tr(),
|
title: 'recovering.method_device_button'.tr(),
|
||||||
|
|
|
@ -28,8 +28,8 @@ class RecoverByOldTokenInstruction extends StatelessWidget {
|
||||||
heroTitle: 'recovering.recovery_main_header'.tr(),
|
heroTitle: 'recovering.recovery_main_header'.tr(),
|
||||||
hasBackButton: true,
|
hasBackButton: true,
|
||||||
hasFlashButton: false,
|
hasFlashButton: false,
|
||||||
onBackButtonPressed: () =>
|
onBackButtonPressed:
|
||||||
context.read<ServerInstallationCubit>().revertRecoveryStep(),
|
context.read<ServerInstallationCubit>().revertRecoveryStep,
|
||||||
children: [
|
children: [
|
||||||
BrandMarkdown(
|
BrandMarkdown(
|
||||||
fileName: instructionFilename,
|
fileName: instructionFilename,
|
||||||
|
|
|
@ -31,8 +31,8 @@ class RecoverByRecoveryKey extends StatelessWidget {
|
||||||
heroSubtitle: 'recovering.method_recovery_input_description'.tr(),
|
heroSubtitle: 'recovering.method_recovery_input_description'.tr(),
|
||||||
hasBackButton: true,
|
hasBackButton: true,
|
||||||
hasFlashButton: false,
|
hasFlashButton: false,
|
||||||
onBackButtonPressed: () =>
|
onBackButtonPressed:
|
||||||
context.read<ServerInstallationCubit>().revertRecoveryStep(),
|
context.read<ServerInstallationCubit>().revertRecoveryStep,
|
||||||
children: [
|
children: [
|
||||||
CubitFormTextField(
|
CubitFormTextField(
|
||||||
formFieldCubit:
|
formFieldCubit:
|
||||||
|
|
|
@ -10,7 +10,7 @@ import 'package:selfprivacy/ui/components/brand_hero_screen/brand_hero_screen.da
|
||||||
import 'package:selfprivacy/ui/components/brand_md/brand_md.dart';
|
import 'package:selfprivacy/ui/components/brand_md/brand_md.dart';
|
||||||
|
|
||||||
class RecoveryConfirmBackblaze extends StatelessWidget {
|
class RecoveryConfirmBackblaze extends StatelessWidget {
|
||||||
const RecoveryConfirmBackblaze({final Key? key}) : super(key: key);
|
const RecoveryConfirmBackblaze({final super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(final BuildContext context) {
|
Widget build(final BuildContext context) {
|
||||||
|
@ -59,14 +59,18 @@ class RecoveryConfirmBackblaze extends StatelessWidget {
|
||||||
context: context,
|
context: context,
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
builder: (final BuildContext context) =>
|
builder: (final BuildContext context) => BrandBottomSheet(
|
||||||
const BrandBottomSheet(
|
|
||||||
isExpended: true,
|
isExpended: true,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: paddingH15V0,
|
padding: paddingH15V0,
|
||||||
child: BrandMarkdown(
|
child: ListView(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||||
|
children: const [
|
||||||
|
BrandMarkdown(
|
||||||
fileName: 'how_backblaze',
|
fileName: 'how_backblaze',
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -52,14 +52,18 @@ class RecoveryConfirmCloudflare extends StatelessWidget {
|
||||||
context: context,
|
context: context,
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
builder: (final BuildContext context) =>
|
builder: (final BuildContext context) => BrandBottomSheet(
|
||||||
const BrandBottomSheet(
|
|
||||||
isExpended: true,
|
isExpended: true,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: paddingH15V0,
|
padding: paddingH15V0,
|
||||||
child: BrandMarkdown(
|
child: ListView(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||||
|
children: const [
|
||||||
|
BrandMarkdown(
|
||||||
fileName: 'how_cloudflare',
|
fileName: 'how_cloudflare',
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -54,14 +54,18 @@ class RecoveryHetznerConnected extends StatelessWidget {
|
||||||
context: context,
|
context: context,
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
builder: (final BuildContext context) =>
|
builder: (final BuildContext context) => BrandBottomSheet(
|
||||||
const BrandBottomSheet(
|
|
||||||
isExpended: true,
|
isExpended: true,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: paddingH15V0,
|
padding: paddingH15V0,
|
||||||
child: BrandMarkdown(
|
child: ListView(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||||
|
children: const [
|
||||||
|
BrandMarkdown(
|
||||||
fileName: 'how_hetzner',
|
fileName: 'how_hetzner',
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -17,6 +17,8 @@ class RecoveryMethodSelect extends StatelessWidget {
|
||||||
heroSubtitle: 'recovering.method_select_description'.tr(),
|
heroSubtitle: 'recovering.method_select_description'.tr(),
|
||||||
hasBackButton: true,
|
hasBackButton: true,
|
||||||
hasFlashButton: false,
|
hasFlashButton: false,
|
||||||
|
onBackButtonPressed:
|
||||||
|
context.read<ServerInstallationCubit>().revertRecoveryStep,
|
||||||
children: [
|
children: [
|
||||||
BrandCards.outlined(
|
BrandCards.outlined(
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
|
|
|
@ -108,10 +108,6 @@ class SelectDomainToRecover extends StatelessWidget {
|
||||||
heroSubtitle: 'recovering.domain_recovery_description'.tr(),
|
heroSubtitle: 'recovering.domain_recovery_description'.tr(),
|
||||||
hasBackButton: true,
|
hasBackButton: true,
|
||||||
hasFlashButton: false,
|
hasFlashButton: false,
|
||||||
onBackButtonPressed:
|
|
||||||
serverInstallation is ServerInstallationRecovery
|
|
||||||
? serverInstallation.clearAppConfig
|
|
||||||
: null,
|
|
||||||
children: [
|
children: [
|
||||||
CubitFormTextField(
|
CubitFormTextField(
|
||||||
formFieldCubit:
|
formFieldCubit:
|
||||||
|
|
|
@ -2,10 +2,9 @@ part of 'users.dart';
|
||||||
|
|
||||||
class _UserDetails extends StatelessWidget {
|
class _UserDetails extends StatelessWidget {
|
||||||
const _UserDetails({
|
const _UserDetails({
|
||||||
final Key? key,
|
|
||||||
required this.user,
|
required this.user,
|
||||||
required this.isRootUser,
|
required this.isRootUser,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
final User user;
|
final User user;
|
||||||
final bool isRootUser;
|
final bool isRootUser;
|
||||||
|
|
|
@ -32,7 +32,9 @@ extension TextExtension on Text {
|
||||||
final String? semanticsLabel,
|
final String? semanticsLabel,
|
||||||
final TextWidthBasis? textWidthBasis,
|
final TextWidthBasis? textWidthBasis,
|
||||||
final TextStyle? style,
|
final TextStyle? style,
|
||||||
}) => Text(data!,
|
}) =>
|
||||||
|
Text(
|
||||||
|
data!,
|
||||||
key: key ?? this.key,
|
key: key ?? this.key,
|
||||||
strutStyle: strutStyle ?? this.strutStyle,
|
strutStyle: strutStyle ?? this.strutStyle,
|
||||||
textAlign: textAlign ?? this.textAlign,
|
textAlign: textAlign ?? this.textAlign,
|
||||||
|
@ -44,5 +46,6 @@ extension TextExtension on Text {
|
||||||
maxLines: maxLines ?? this.maxLines,
|
maxLines: maxLines ?? this.maxLines,
|
||||||
semanticsLabel: semanticsLabel ?? this.semanticsLabel,
|
semanticsLabel: semanticsLabel ?? this.semanticsLabel,
|
||||||
textWidthBasis: textWidthBasis ?? this.textWidthBasis,
|
textWidthBasis: textWidthBasis ?? this.textWidthBasis,
|
||||||
style: style != null ? this.style?.merge(style) ?? style : this.style,);
|
style: style != null ? this.style?.merge(style) ?? style : this.style,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,8 @@ Function transitionsBuilder = (
|
||||||
final Animation<double> animation,
|
final Animation<double> animation,
|
||||||
final Animation<double> secondaryAnimation,
|
final Animation<double> secondaryAnimation,
|
||||||
final Widget child,
|
final Widget child,
|
||||||
) => SlideTransition(
|
) =>
|
||||||
|
SlideTransition(
|
||||||
position: Tween<Offset>(
|
position: Tween<Offset>(
|
||||||
begin: const Offset(0, 1),
|
begin: const Offset(0, 1),
|
||||||
end: Offset.zero,
|
end: Offset.zero,
|
||||||
|
@ -37,7 +38,11 @@ class SlideBottomRoute extends PageRouteBuilder {
|
||||||
transitionDuration: const Duration(milliseconds: 150),
|
transitionDuration: const Duration(milliseconds: 150),
|
||||||
pageBuilder: pageBuilder(widget),
|
pageBuilder: pageBuilder(widget),
|
||||||
transitionsBuilder: transitionsBuilder as Widget Function(
|
transitionsBuilder: transitionsBuilder as Widget Function(
|
||||||
BuildContext, Animation<double>, Animation<double>, Widget,),
|
BuildContext,
|
||||||
|
Animation<double>,
|
||||||
|
Animation<double>,
|
||||||
|
Widget,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
final Widget widget;
|
final Widget widget;
|
||||||
|
|
|
@ -12,7 +12,8 @@ Function transitionsBuilder = (
|
||||||
final Animation<double> animation,
|
final Animation<double> animation,
|
||||||
final Animation<double> secondaryAnimation,
|
final Animation<double> secondaryAnimation,
|
||||||
final Widget child,
|
final Widget child,
|
||||||
) => SlideTransition(
|
) =>
|
||||||
|
SlideTransition(
|
||||||
position: Tween<Offset>(
|
position: Tween<Offset>(
|
||||||
begin: const Offset(-1, 0),
|
begin: const Offset(-1, 0),
|
||||||
end: Offset.zero,
|
end: Offset.zero,
|
||||||
|
@ -36,7 +37,11 @@ class SlideRightRoute extends PageRouteBuilder {
|
||||||
: super(
|
: super(
|
||||||
pageBuilder: pageBuilder(widget),
|
pageBuilder: pageBuilder(widget),
|
||||||
transitionsBuilder: transitionsBuilder as Widget Function(
|
transitionsBuilder: transitionsBuilder as Widget Function(
|
||||||
BuildContext, Animation<double>, Animation<double>, Widget,),
|
BuildContext,
|
||||||
|
Animation<double>,
|
||||||
|
Animation<double>,
|
||||||
|
Widget,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
final Widget widget;
|
final Widget widget;
|
||||||
|
|
|
@ -6,9 +6,12 @@ void main() {
|
||||||
group('StringGenerators', () {
|
group('StringGenerators', () {
|
||||||
group('Basic', () {
|
group('Basic', () {
|
||||||
test('assert chart empty', () {
|
test('assert chart empty', () {
|
||||||
expect(() {
|
expect(
|
||||||
|
() {
|
||||||
StringGenerators.getRandomString(8);
|
StringGenerators.getRandomString(8);
|
||||||
}, throwsAssertionError,);
|
},
|
||||||
|
throwsAssertionError,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('only lowercase string', () {
|
test('only lowercase string', () {
|
||||||
|
@ -27,8 +30,11 @@ void main() {
|
||||||
|
|
||||||
test('only uppercase string', () {
|
test('only uppercase string', () {
|
||||||
const int length = 8;
|
const int length = 8;
|
||||||
final String generatedString = StringGenerators.getRandomString(length,
|
final String generatedString = StringGenerators.getRandomString(
|
||||||
hasLowercaseLetters: false, hasUppercaseLetters: true,);
|
length,
|
||||||
|
hasLowercaseLetters: false,
|
||||||
|
hasUppercaseLetters: true,
|
||||||
|
);
|
||||||
|
|
||||||
expect(generatedString, isNot(matches(regExpNewLines)));
|
expect(generatedString, isNot(matches(regExpNewLines)));
|
||||||
expect(generatedString, isNot(matches(regExpWhiteSpaces)));
|
expect(generatedString, isNot(matches(regExpWhiteSpaces)));
|
||||||
|
@ -41,10 +47,12 @@ void main() {
|
||||||
|
|
||||||
test('only numbers string', () {
|
test('only numbers string', () {
|
||||||
const int length = 8;
|
const int length = 8;
|
||||||
final String generatedString = StringGenerators.getRandomString(length,
|
final String generatedString = StringGenerators.getRandomString(
|
||||||
|
length,
|
||||||
hasLowercaseLetters: false,
|
hasLowercaseLetters: false,
|
||||||
hasUppercaseLetters: false,
|
hasUppercaseLetters: false,
|
||||||
hasNumbers: true,);
|
hasNumbers: true,
|
||||||
|
);
|
||||||
|
|
||||||
expect(generatedString, isNot(matches(regExpNewLines)));
|
expect(generatedString, isNot(matches(regExpNewLines)));
|
||||||
expect(generatedString, isNot(matches(regExpWhiteSpaces)));
|
expect(generatedString, isNot(matches(regExpWhiteSpaces)));
|
||||||
|
@ -78,12 +86,14 @@ void main() {
|
||||||
group('Strict mode', () {
|
group('Strict mode', () {
|
||||||
test('All', () {
|
test('All', () {
|
||||||
const int length = 5;
|
const int length = 5;
|
||||||
final String generatedString = StringGenerators.getRandomString(length,
|
final String generatedString = StringGenerators.getRandomString(
|
||||||
|
length,
|
||||||
hasLowercaseLetters: true,
|
hasLowercaseLetters: true,
|
||||||
hasUppercaseLetters: true,
|
hasUppercaseLetters: true,
|
||||||
hasNumbers: true,
|
hasNumbers: true,
|
||||||
hasSymbols: true,
|
hasSymbols: true,
|
||||||
isStrict: true,);
|
isStrict: true,
|
||||||
|
);
|
||||||
|
|
||||||
expect(generatedString, isNot(matches(regExpNewLines)));
|
expect(generatedString, isNot(matches(regExpNewLines)));
|
||||||
expect(generatedString, isNot(matches(regExpWhiteSpaces)));
|
expect(generatedString, isNot(matches(regExpWhiteSpaces)));
|
||||||
|
@ -95,12 +105,14 @@ void main() {
|
||||||
});
|
});
|
||||||
test('Lowercase letters and numbers', () {
|
test('Lowercase letters and numbers', () {
|
||||||
const int length = 3;
|
const int length = 3;
|
||||||
final String generatedString = StringGenerators.getRandomString(length,
|
final String generatedString = StringGenerators.getRandomString(
|
||||||
|
length,
|
||||||
hasLowercaseLetters: true,
|
hasLowercaseLetters: true,
|
||||||
hasUppercaseLetters: false,
|
hasUppercaseLetters: false,
|
||||||
hasNumbers: true,
|
hasNumbers: true,
|
||||||
hasSymbols: false,
|
hasSymbols: false,
|
||||||
isStrict: true,);
|
isStrict: true,
|
||||||
|
);
|
||||||
|
|
||||||
expect(generatedString, isNot(matches(regExpNewLines)));
|
expect(generatedString, isNot(matches(regExpNewLines)));
|
||||||
expect(generatedString, isNot(matches(regExpWhiteSpaces)));
|
expect(generatedString, isNot(matches(regExpWhiteSpaces)));
|
||||||
|
|
Loading…
Reference in New Issue