Minor UI fixes on recovery key pages
parent
e8d5ecccf6
commit
5909b9a3e6
|
@ -27,17 +27,14 @@ class _RecoveryKeyState extends State<RecoveryKey> {
|
||||||
final keyStatus = context.watch<RecoveryKeyCubit>().state;
|
final keyStatus = context.watch<RecoveryKeyCubit>().state;
|
||||||
|
|
||||||
final List<Widget> widgets;
|
final List<Widget> widgets;
|
||||||
final String? subtitle =
|
String? subtitle =
|
||||||
keyStatus.exists ? null : 'recovery_key.key_main_description'.tr();
|
keyStatus.exists ? null : 'recovery_key.key_main_description'.tr();
|
||||||
|
|
||||||
switch (keyStatus.loadingStatus) {
|
switch (keyStatus.loadingStatus) {
|
||||||
case LoadingStatus.refreshing:
|
case LoadingStatus.refreshing:
|
||||||
|
subtitle = 'recovery_key.key_synchronizing'.tr();
|
||||||
widgets = [
|
widgets = [
|
||||||
const Center(child: CircularProgressIndicator()),
|
const Center(child: CircularProgressIndicator()),
|
||||||
const SizedBox(height: 16),
|
|
||||||
BrandText(
|
|
||||||
'recovery_key.key_synchronizing'.tr(),
|
|
||||||
type: TextType.h1,
|
|
||||||
),
|
|
||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
case LoadingStatus.success:
|
case LoadingStatus.success:
|
||||||
|
@ -47,13 +44,9 @@ class _RecoveryKeyState extends State<RecoveryKey> {
|
||||||
break;
|
break;
|
||||||
case LoadingStatus.uninitialized:
|
case LoadingStatus.uninitialized:
|
||||||
case LoadingStatus.error:
|
case LoadingStatus.error:
|
||||||
|
subtitle = 'recovery_key.key_connection_error'.tr();
|
||||||
widgets = [
|
widgets = [
|
||||||
const Icon(Icons.sentiment_dissatisfied_outlined),
|
const Icon(Icons.sentiment_dissatisfied_outlined),
|
||||||
const SizedBox(height: 16),
|
|
||||||
BrandText(
|
|
||||||
'recovery_key.key_connection_error'.tr(),
|
|
||||||
type: TextType.h1,
|
|
||||||
),
|
|
||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,6 @@ import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:selfprivacy/ui/components/brand_button/filled_button.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/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 {
|
class RecoveryKeyReceiving extends StatelessWidget {
|
||||||
const RecoveryKeyReceiving({required this.recoveryKey, Key? key})
|
const RecoveryKeyReceiving({required this.recoveryKey, Key? key})
|
||||||
|
@ -44,8 +42,7 @@ class RecoveryKeyReceiving extends StatelessWidget {
|
||||||
FilledButton(
|
FilledButton(
|
||||||
title: 'recovery_key.key_receiving_done'.tr(),
|
title: 'recovery_key.key_receiving_done'.tr(),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context)
|
Navigator.of(context).popUntil((route) => route.isFirst);
|
||||||
.pushReplacement(materialRoute(const RootPage()));
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in New Issue