Skip to content

Commit

Permalink
backup ux fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mocodesmo committed May 2, 2024
1 parent 4431e5a commit 792cc92
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 27 deletions.
43 changes: 26 additions & 17 deletions lib/wallet_settings/backup.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ class InfoRead extends Cubit<bool> {
}

class BackupPage extends StatelessWidget {
const BackupPage(
{super.key, required this.walletBloc, required this.walletSettings});
const BackupPage({
super.key,
required this.walletBloc,
required this.walletSettings,
});

final WalletBloc walletBloc;
final WalletSettingsCubit walletSettings;
Expand All @@ -36,22 +39,28 @@ class BackupPage extends StatelessWidget {
],
child: BlocBuilder<InfoRead, bool>(
builder: (context, state) {
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
flexibleSpace: BBAppBar(
text: 'Backup',
onBack: () {
if (state) context.read<InfoRead>().unread();
context.read<WalletSettingsCubit>().clearSensitive();
// context.pop();
context.go('/home');
},
return PopScope(
canPop: false,
onPopInvoked: (canPop) {
context.go('/home');
},
child: Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
flexibleSpace: BBAppBar(
text: 'Backup',
onBack: () {
if (state) context.read<InfoRead>().unread();
context.read<WalletSettingsCubit>().clearSensitive();
// context.pop();
context.go('/home');
},
),
),
body: AnimatedSwitcher(
duration: const Duration(milliseconds: 300),
child: state ? const BackupScreen() : const BackUpInfoScreen(),
),
),
body: AnimatedSwitcher(
duration: const Duration(milliseconds: 300),
child: state ? const BackupScreen() : const BackUpInfoScreen(),
),
);
},
Expand Down
26 changes: 16 additions & 10 deletions lib/wallet_settings/test-backup.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,24 @@ class TestBackupPage extends StatelessWidget {
child: TestBackupListener(
child: Builder(
builder: (context) {
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
flexibleSpace: BBAppBar(
text: 'Test Backup',
onBack: () {
context.pop();
context.read<WalletSettingsCubit>().resetBackupTested();
},
return PopScope(
canPop: false,
onPopInvoked: (canPop) {
context.go('/home');
},
child: Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
flexibleSpace: BBAppBar(
text: 'Test Backup',
onBack: () {
context.pop();
context.read<WalletSettingsCubit>().resetBackupTested();
},
),
),
body: const TestBackupScreen(),
),
body: const TestBackupScreen(),
);
},
),
Expand Down

0 comments on commit 792cc92

Please sign in to comment.