Skip to content

Commit d595c68

Browse files
committed
Material Design 3 migration part 2
1 parent 81a8a73 commit d595c68

22 files changed

+330
-223
lines changed

ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
buildConfiguration = "Debug"
4545
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4646
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
47+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
4748
shouldUseLaunchSchemeArgsEnv = "YES"
4849
systemAttachmentLifetime = "keepAlways">
4950
<MacroExpansion>
@@ -72,6 +73,7 @@
7273
buildConfiguration = "Debug"
7374
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
7475
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
76+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
7577
launchStyle = "0"
7678
useCustomWorkingDirectory = "NO"
7779
ignoresPersistentStateOnLaunch = "NO"

lib/extension_methods.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ extension KdbxFileKDF on KdbxFile {
7070
}
7171
return false;
7272
}
73+
74+
List<String> get trimmedTags {
75+
return tags.map((tag) => tag.trim()).where((tag) => tag.isNotEmpty).toSet().toList(growable: false);
76+
}
7377
}
7478

7579
extension KdbxEntryColor on KdbxEntry {

lib/vault_backend/jwt.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class JWT {
9090
try {
9191
final keyPair = jwt.JWTKey.fromJWK(jwk);
9292
// If this does not throw an exception then we know the signature is valid
93-
final _ = jwt.JWT.verify(sig, keyPair);
93+
final _ = jwt.JWT.verify(sig, keyPair, checkHeaderType: false);
9494
return ClientVerificationResult(claim: claim, audience: claim.aud);
9595
} on jwt.JWTExpiredException {
9696
l.w('JWT expired. Token should therefore be ignored.');

lib/widgets/account_email_change.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ class _AccountEmailChangeWidgetState extends State<AccountEmailChangeWidget> {
200200
),
201201
OverflowBar(
202202
alignment: MainAxisAlignment.end,
203+
spacing: 8.0,
203204
children: [
204205
OutlinedButton(
205206
onPressed: changing

lib/widgets/autofill_save.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class _AutofillSaveWidgetState extends State<AutofillSaveWidget> with TraceableC
114114
return EntryWidget(
115115
key: ValueKey('autofillSaveDetails'),
116116
savingViaAutofill: true,
117-
endEditing: (bool keepChanges) => onEndEditing(keepChanges, vaultCubit, vault.files.current.tags),
117+
endEditing: (bool keepChanges) => onEndEditing(keepChanges, vaultCubit, vault.files.current.trimmedTags),
118118
allCustomIcons: vault.files.current.body.meta.customIcons.map(
119119
(key, value) =>
120120
MapEntry(value, Image.memory(value.data, fit: BoxFit.contain, filterQuality: FilterQuality.low)),

lib/widgets/bottom.dart

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ class VaultStatusIconWidget extends StatelessWidget {
274274
onPressed: () async {
275275
await DialogUtils.showSimpleAlertDialog(
276276
context,
277-
null,
277+
_buildTitle(state, str).data,
278278
_buildDescription(state, str),
279279
routeAppend: 'vaultStatusExplanation',
280280
);
@@ -303,6 +303,26 @@ class VaultStatusIconWidget extends StatelessWidget {
303303
return Icon(Icons.device_unknown);
304304
}
305305

306+
Text _buildTitle(VaultState state, S str) {
307+
if (state is VaultUploadCredentialsRequired) {
308+
return Text(str.vaultStatusActionNeeded);
309+
} else if (state is VaultSaving && state.remotely) {
310+
return Text(str.vaultStatusUploading);
311+
} else if (state is VaultSaving && state.locally) {
312+
return Text(str.vaultStatusSaving);
313+
} else if (state is VaultRefreshing) {
314+
return Text(str.vaultStatusRefreshing);
315+
} else if (state is VaultBackgroundError) {
316+
return Text(str.vaultStatusError);
317+
} else if (state is VaultLoaded) {
318+
if (state.vault.hasPendingChanges) {
319+
return Text(str.vaultStatusSaveNeeded);
320+
}
321+
return Text(str.vaultStatusLoaded);
322+
}
323+
return Text(str.vaultStatusUnknownState);
324+
}
325+
306326
String _buildDescription(VaultState state, S str) {
307327
if (state is VaultUploadCredentialsRequired) {
308328
return str.vaultStatusDescPasswordChanged;

lib/widgets/change_subscription.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class _ChangeSubscriptionWidgetState extends State<ChangeSubscriptionWidget> {
135135
alignment: Alignment.center,
136136
child: OutlinedButton(
137137
onPressed: () async => await DialogUtils.openUrl('https://kee.pm/keevault/delete-account/'),
138-
style: OutlinedButton.styleFrom(backgroundColor: theme.buttonTheme.colorScheme!.error),
138+
style: OutlinedButton.styleFrom(foregroundColor: theme.buttonTheme.colorScheme!.error),
139139
child: Text(str.deleteAccount),
140140
),
141141
),

lib/widgets/entry.dart

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import 'package:flutter_speed_dial/flutter_speed_dial.dart';
1515

1616
import 'package:keevault/cubit/entry_cubit.dart';
1717
import 'package:keevault/cubit/vault_cubit.dart';
18+
import 'package:keevault/extension_methods.dart';
1819
import 'package:keevault/logging/logger.dart';
1920
import 'package:keevault/model/entry.dart';
2021
import 'package:keevault/model/field.dart';
@@ -278,12 +279,8 @@ class EntryWidget extends StatelessWidget {
278279
key: key,
279280
appBar: savingViaAutofill
280281
? AppBar(
281-
title: Image(
282-
image: AssetImage('assets/vault.png'),
283-
excludeFromSemantics: true,
284-
height: 32,
285-
color: Color.fromARGB(0xFF, 0x1A, 0x46, 0x6B),
286-
),
282+
backgroundColor: theme.scaffoldBackgroundColor,
283+
title: Image(image: AssetImage('assets/vault.png'), excludeFromSemantics: true, height: 32),
287284
centerTitle: true,
288285
toolbarHeight: 48,
289286
leading: IconButton(
@@ -494,7 +491,7 @@ class EntryWidget extends StatelessWidget {
494491
),
495492
LabelsWidget(
496493
tags: entry.tags,
497-
otherKnownTags: loadedState.vault.files.current.tags
494+
otherKnownTags: loadedState.vault.files.current.trimmedTags
498495
.map((t) => Tag(t, true))
499496
.where((t) => !entry.tags.any((et) => et.lowercase == t.lowercase))
500497
.toList(),

lib/widgets/entry_list.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ class EntryListItemWidget extends StatelessWidget {
242242
final entryCubit = BlocProvider.of<EntryCubit>(context);
243243
entryCubit.revertToHistoryEntry(entry, index);
244244
final filterCubit = BlocProvider.of<FilterCubit>(context);
245-
filterCubit.reFilter(entry.file!.tags, entry.file!.body.rootGroup);
245+
filterCubit.reFilter(entry.file!.trimmedTags, entry.file!.body.rootGroup);
246246
close(returnValue: false);
247247
//TODO:f: Maybe one day we can automatically reopen the container with the updated information?
248248
// BlocProvider.of<EntryCubit>(context).startEditing(entry);
@@ -252,7 +252,7 @@ class EntryListItemWidget extends StatelessWidget {
252252
final entryCubit = BlocProvider.of<EntryCubit>(context);
253253
entryCubit.removeHistoryEntry(entry, index);
254254
final filterCubit = BlocProvider.of<FilterCubit>(context);
255-
filterCubit.reFilter(entry.file!.tags, entry.file!.body.rootGroup);
255+
filterCubit.reFilter(entry.file!.trimmedTags, entry.file!.body.rootGroup);
256256
close(returnValue: false);
257257
},
258258
);
@@ -271,7 +271,7 @@ class EntryListItemWidget extends StatelessWidget {
271271
final filterCubit = BlocProvider.of<FilterCubit>(context);
272272
await BlocProvider.of<InteractionCubit>(context).entrySaved();
273273
await iam.showIfAppropriate(InAppMessageTrigger.entryChanged);
274-
filterCubit.reFilter(entry.file!.tags, entry.file!.body.rootGroup);
274+
filterCubit.reFilter(entry.file!.trimmedTags, entry.file!.body.rootGroup);
275275
//TODO:f: A separate cubit to track state of ELIVMs might provide better performance and scroll position stability than recreating them all from scratch every time we re-filter?
276276
} else {
277277
entryCubit.endEditing(null);

lib/widgets/import_export.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ class _ImportExportWidgetState extends State<ImportExportWidget> {
9999
),
100100
OverflowBar(
101101
alignment: MainAxisAlignment.end,
102+
spacing: 8.0,
102103
children: [
103104
FilledButton(onPressed: () => {_exportFreeKdbx(context)}, child: Text(str.export)),
104105
FilledButton(

0 commit comments

Comments
 (0)