Minor UI fixes on recovery key pages

pull/90/head
NaiJi ✨ 2022-06-01 17:29:37 +03:00
parent e8d5ecccf6
commit 5909b9a3e6
2 changed files with 5 additions and 15 deletions

View File

@ -27,17 +27,14 @@ class _RecoveryKeyState extends State<RecoveryKey> {
final keyStatus = context.watch<RecoveryKeyCubit>().state;
final List<Widget> widgets;
final String? subtitle =
String? subtitle =
keyStatus.exists ? null : 'recovery_key.key_main_description'.tr();
switch (keyStatus.loadingStatus) {
case LoadingStatus.refreshing:
subtitle = 'recovery_key.key_synchronizing'.tr();
widgets = [
const Center(child: CircularProgressIndicator()),
const SizedBox(height: 16),
BrandText(
'recovery_key.key_synchronizing'.tr(),
type: TextType.h1,
),
];
break;
case LoadingStatus.success:
@ -47,13 +44,9 @@ class _RecoveryKeyState extends State<RecoveryKey> {
break;
case LoadingStatus.uninitialized:
case LoadingStatus.error:
subtitle = 'recovery_key.key_connection_error'.tr();
widgets = [
const Icon(Icons.sentiment_dissatisfied_outlined),
const SizedBox(height: 16),
BrandText(
'recovery_key.key_connection_error'.tr(),
type: TextType.h1,
),
];
break;
}

View File

@ -2,8 +2,6 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:selfprivacy/ui/components/brand_button/filled_button.dart';
import 'package:selfprivacy/ui/components/brand_hero_screen/brand_hero_screen.dart';
import 'package:selfprivacy/ui/pages/root_route.dart';
import 'package:selfprivacy/utils/route_transitions/basic.dart';
class RecoveryKeyReceiving extends StatelessWidget {
const RecoveryKeyReceiving({required this.recoveryKey, Key? key})
@ -44,8 +42,7 @@ class RecoveryKeyReceiving extends StatelessWidget {
FilledButton(
title: 'recovery_key.key_receiving_done'.tr(),
onPressed: () {
Navigator.of(context)
.pushReplacement(materialRoute(const RootPage()));
Navigator.of(context).popUntil((route) => route.isFirst);
},
),
],