Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,9 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
case BackupFrequencyType.afterClosingAWallet:
// ignore this case here
break;
case BackupFrequencyType.afterChanges:
ref.read(autoSWBServiceProvider);
break;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
BackupFrequencyType.everyTenMinutes,
BackupFrequencyType.everyAppStart,
BackupFrequencyType.afterClosingAWallet,
BackupFrequencyType.afterChanges,
];

String passwordFeedback =
Expand Down Expand Up @@ -170,9 +171,8 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
passwordRepeatController.text = "";

if (!Util.isDesktop) {
Navigator.of(
context,
).popUntil(ModalRoute.withName(AutoBackupView.routeName));
Navigator.of(context)
.popUntil(ModalRoute.withName(AutoBackupView.routeName));
}
}
} else {
Expand Down Expand Up @@ -243,9 +243,9 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
condition: !isDesktop,
builder: (child) => Background(
child: Scaffold(
backgroundColor: Theme.of(
context,
).extension<StackColors>()!.background,
backgroundColor: Theme.of(context)
.extension<StackColors>()!
.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () {
Expand Down Expand Up @@ -325,9 +325,9 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
const SizedBox(width: 16),
SvgPicture.asset(
Assets.svg.folder,
color: Theme.of(
context,
).extension<StackColors>()!.textDark3,
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
width: 16,
height: 16,
),
Expand Down Expand Up @@ -394,9 +394,9 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
hidePassword
? Assets.svg.eye
: Assets.svg.eyeSlash,
color: Theme.of(
context,
).extension<StackColors>()!.textDark3,
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
width: 16,
height: 16,
),
Expand Down Expand Up @@ -473,15 +473,15 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
fillColor: passwordStrength < 0.51
? Theme.of(context).extension<StackColors>()!.accentColorRed
: passwordStrength < 1
? Theme.of(
context,
).extension<StackColors>()!.accentColorYellow
: Theme.of(
context,
).extension<StackColors>()!.accentColorGreen,
backgroundColor: Theme.of(
context,
).extension<StackColors>()!.buttonBackSecondary,
? Theme.of(context)
.extension<StackColors>()!
.accentColorYellow
: Theme.of(context)
.extension<StackColors>()!
.accentColorGreen,
backgroundColor: Theme.of(context)
.extension<StackColors>()!
.buttonBackSecondary,
percent: passwordStrength < 0.25 ? 0.03 : passwordStrength,
),
),
Expand Down Expand Up @@ -524,9 +524,9 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
hidePassword
? Assets.svg.eye
: Assets.svg.eyeSlash,
color: Theme.of(
context,
).extension<StackColors>()!.textDark3,
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
width: 16,
height: 16,
),
Expand All @@ -547,9 +547,9 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
"Auto Backup frequency",
style: isDesktop
? STextStyles.desktopTextExtraSmall(context).copyWith(
color: Theme.of(
context,
).extension<StackColors>()!.textDark3,
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
)
: STextStyles.smallMed12(context),
),
Expand All @@ -572,6 +572,9 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
case BackupFrequencyType.afterClosingAWallet:
message = "After closing a cryptocurrency wallet";
break;
case BackupFrequencyType.afterChanges:
message = "After editing a note or contact";
break;
}

return DropdownMenuItem(
Expand Down Expand Up @@ -604,18 +607,18 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
Assets.svg.chevronDown,
width: 10,
height: 5,
color: Theme.of(
context,
).extension<StackColors>()!.textDark3,
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
),
),
dropdownStyleData: DropdownStyleData(
offset: const Offset(0, -10),
elevation: 0,
decoration: BoxDecoration(
color: Theme.of(
context,
).extension<StackColors>()!.textFieldDefaultBG,
color: Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultBG,
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
Expand All @@ -637,9 +640,9 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
),
Positioned.fill(
child: RawMaterialButton(
splashColor: Theme.of(
context,
).extension<StackColors>()!.highlight,
splashColor: Theme.of(context)
.extension<StackColors>()!
.highlight,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
Expand Down Expand Up @@ -676,9 +679,9 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
padding: const EdgeInsets.only(right: 4.0),
child: SvgPicture.asset(
Assets.svg.chevronDown,
color: Theme.of(
context,
).extension<StackColors>()!.textSubtitle2,
color: Theme.of(context)
.extension<StackColors>()!
.textSubtitle2,
width: 12,
height: 6,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ import '../../../../../utilities/enums/backup_frequency_type.dart';
import '../../../../../utilities/text_styles.dart';

class BackupFrequencyTypeSelectSheet extends ConsumerWidget {
const BackupFrequencyTypeSelectSheet({
super.key,
});
const BackupFrequencyTypeSelectSheet({super.key});

String prettyFrequencyType(BackupFrequencyType type) {
switch (type) {
Expand All @@ -30,6 +28,8 @@ class BackupFrequencyTypeSelectSheet extends ConsumerWidget {
return "Every app start";
case BackupFrequencyType.afterClosingAWallet:
return "After closing a cryptocurrency wallet";
case BackupFrequencyType.afterChanges:
return "After editing a note or contact";
}
}

Expand All @@ -44,9 +44,7 @@ class BackupFrequencyTypeSelectSheet extends ConsumerWidget {
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).extension<StackColors>()!.popupBG,
borderRadius: const BorderRadius.vertical(
top: Radius.circular(20),
),
borderRadius: const BorderRadius.vertical(top: Radius.circular(20)),
),
child: Padding(
padding: const EdgeInsets.only(
Expand All @@ -73,9 +71,7 @@ class BackupFrequencyTypeSelectSheet extends ConsumerWidget {
height: 4,
),
),
const SizedBox(
height: 36,
),
const SizedBox(height: 36),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expand All @@ -84,9 +80,7 @@ class BackupFrequencyTypeSelectSheet extends ConsumerWidget {
style: STextStyles.pageTitleH2(context),
textAlign: TextAlign.left,
),
const SizedBox(
height: 24,
),
const SizedBox(height: 24),
for (int i = 0; i < BackupFrequencyType.values.length; i++)
Column(
children: [
Expand Down Expand Up @@ -131,9 +125,7 @@ class BackupFrequencyTypeSelectSheet extends ConsumerWidget {
},
),
),
const SizedBox(
width: 12,
),
const SizedBox(width: 12),
Flexible(
child: Column(
children: [
Expand All @@ -151,14 +143,10 @@ class BackupFrequencyTypeSelectSheet extends ConsumerWidget {
),
),
),
const SizedBox(
height: 20,
),
const SizedBox(height: 20),
],
),
const SizedBox(
height: 24,
),
const SizedBox(height: 24),
],
),
],
Expand Down
8 changes: 8 additions & 0 deletions lib/pages/wallet_view/transaction_views/edit_note_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

import '../../../models/isar/models/transaction_note.dart';
import '../../../providers/global/auto_swb_service_provider.dart';
import '../../../providers/providers.dart';
import '../../../themes/stack_colors.dart';
import '../../../utilities/constants.dart';
Expand Down Expand Up @@ -195,6 +196,10 @@ class _EditNoteViewState extends ConsumerState<EditNoteView> {
),
);

ref
.read(autoSWBServiceProvider)
.requestBackupAfterChange();

if (context.mounted) {
Navigator.of(context).pop();
}
Expand All @@ -214,6 +219,9 @@ class _EditNoteViewState extends ConsumerState<EditNoteView> {
value: _noteController.text,
),
);

ref.read(autoSWBServiceProvider).requestBackupAfterChange();

if (context.mounted) {
Navigator.of(context).pop();
}
Expand Down
Loading
Loading