Skip to content

Commit

Permalink
Merge branch 'main' into test-presentation
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkbee1 committed Oct 2, 2024
2 parents 56e2fdf + acec87a commit 6598ae2
Show file tree
Hide file tree
Showing 46 changed files with 233 additions and 199 deletions.
2 changes: 1 addition & 1 deletion lib/app/shared/enum/type/profile/profile_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ extension ProfileTypeX on ProfileType {
case ProfileType.ebsiV3:
return 'European Blockchain Services Infrastructure (EBSI v3.x)';
case ProfileType.ebsiV4:
return 'European Blockchain Services Infrastructure (EBSI v4.x)';
return 'European Blockchain Services Infrastructure (EBSI v4.0)';
case ProfileType.diipv2point1:
return 'Decentralized Identity Interop Profile (DIIP v2.1)';
case ProfileType.enterprise:
Expand Down
8 changes: 8 additions & 0 deletions lib/app/shared/extension/color_extension.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import 'package:flutter/material.dart';

extension ColorExtension on Color {
Color get adaptiveTopColor {
final double luminance = computeLuminance();
return luminance > 0.5 ? Colors.black : Colors.white;
}
}
1 change: 1 addition & 0 deletions lib/app/shared/extension/extension.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export 'bigint_extension.dart';
export 'color_extension.dart';
export 'double_extension.dart';
export 'iterable_extension.dart';
export 'string_extension.dart';
Expand Down
15 changes: 3 additions & 12 deletions lib/app/shared/helper_functions/helper_functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -467,18 +467,9 @@ String birthDateFormater(int birthData) {
}

String chatTimeFormatter(int birthData) {
final String birthdate = birthData.toString();

// Parse the input string
final DateTime parsedBirthdate = DateTime.parse(
'${birthdate.substring(0, 4)}-${birthdate.substring(4, 6)}-${birthdate.substring(6, 8)}', // ignore: lines_longer_than_80_chars
);

// Format the parsed date
final DateFormat formatter = DateFormat('dd:MM:yyyy');
final String formattedBirthdate = formatter.format(parsedBirthdate);

return formattedBirthdate;
final dateTime = DateTime.fromMillisecondsSinceEpoch(birthData);
final formattedDate = DateFormat('dd.MM.yyyy').format(dateTime);
return formattedDate;
}

String getSignatureType(String circuitId) {
Expand Down
3 changes: 1 addition & 2 deletions lib/chat_room/cubit/chat_room_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,7 @@ abstract class ChatRoomCubit extends Cubit<ChatRoomState> {

final List<String> invites = [];

if (profileCubit.state.model.walletType == WalletType.enterprise &&
helpCenterOptions.customChatSupport &&
if (helpCenterOptions.customChatSupport &&
helpCenterOptions.customChatSupportName != null) {
invites.add(helpCenterOptions.customChatSupportName!);
}
Expand Down
28 changes: 16 additions & 12 deletions lib/chat_room/view/chat_room_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ class _ChatRoomViewState<B extends ChatRoomCubit> extends State<ChatRoomView> {
Widget build(BuildContext context) {
final l10n = context.l10n;
final colorScheme = Theme.of(context).colorScheme;

final adaptiveOnPrimary = colorScheme.primaryContainer.adaptiveTopColor;
final adaptiveOnSurface = colorScheme.surface.adaptiveTopColor;

return BasePage(
title: widget.appBarTitle,
scrollView: false,
Expand Down Expand Up @@ -114,29 +118,29 @@ class _ChatRoomViewState<B extends ChatRoomCubit> extends State<ChatRoomView> {
secondaryColor: colorScheme.secondaryContainer,
backgroundColor: colorScheme.surface,
inputBackgroundColor: colorScheme.secondaryContainer,
inputTextColor: colorScheme.onSurface,
inputTextColor: adaptiveOnSurface,
errorColor: colorScheme.error,
sentMessageBodyTextStyle: TextStyle(
color: colorScheme.onPrimary,
color: adaptiveOnPrimary,
fontSize: 16,
fontWeight: FontWeight.w500,
height: 1.5,
),
sentMessageBodyBoldTextStyle: TextStyle(
color: colorScheme.onPrimary,
color: adaptiveOnPrimary,
fontSize: 12,
fontWeight: FontWeight.w500,
height: 1.333,
),
sentMessageDocumentIconColor: colorScheme.onPrimary,
sentMessageDocumentIconColor: adaptiveOnPrimary,
sentMessageLinkTitleTextStyle: TextStyle(
color: colorScheme.onPrimary,
color: adaptiveOnPrimary,
fontSize: 16,
fontWeight: FontWeight.w800,
height: 1.375,
),
sentMessageCaptionTextStyle: TextStyle(
color: colorScheme.onPrimary,
color: adaptiveOnPrimary,
fontSize: 12,
fontWeight: FontWeight.w500,
height: 1,
Expand All @@ -149,33 +153,33 @@ class _ChatRoomViewState<B extends ChatRoomCubit> extends State<ChatRoomView> {
right: 8,
),
textStyle: TextStyle(
color: colorScheme.onPrimary,
color: adaptiveOnPrimary,
fontSize: 12,
fontWeight: FontWeight.w800,
height: 1.333,
),
),
receivedMessageBodyTextStyle: TextStyle(
color: colorScheme.onSurface,
color: adaptiveOnSurface,
fontSize: 16,
fontWeight: FontWeight.w500,
height: 1.5,
),
receivedMessageCaptionTextStyle: TextStyle(
color: colorScheme.onSurface,
color: adaptiveOnSurface,
fontSize: 12,
fontWeight: FontWeight.w500,
height: 1.333,
),
receivedMessageDocumentIconColor: colorScheme.onSurface,
receivedMessageDocumentIconColor: adaptiveOnSurface,
receivedMessageLinkDescriptionTextStyle: TextStyle(
color: colorScheme.onSurface,
color: adaptiveOnSurface,
fontSize: 14,
fontWeight: FontWeight.w400,
height: 1.428,
),
receivedMessageLinkTitleTextStyle: TextStyle(
color: colorScheme.onSurface,
color: adaptiveOnSurface,
fontSize: 16,
fontWeight: FontWeight.w800,
height: 1.375,
Expand Down
12 changes: 0 additions & 12 deletions lib/dashboard/drawer/ssi/src/view/ssi_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,6 @@ class SSIView extends StatelessWidget {
Navigator.of(context).push<void>(DidMenu.route());
},
),
DrawerItem(
title: l10n.backup,
onTap: () async {
await Navigator.of(context).push<void>(BackupMenu.route());
},
),
DrawerItem(
title: l10n.restore,
onTap: () async {
await Navigator.of(context).push<void>(RestoreMenu.route());
},
),
DrawerItem(
title: l10n.searchCredentials,
onTap: () {
Expand Down
2 changes: 0 additions & 2 deletions lib/dashboard/drawer/ssi/ssi.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
export 'backup/backup.dart';
export 'manage_did/manage_did.dart';
export 'oidc4vc_settngs/oidc4vc_settings.dart';
export 'restore/restore.dart';
export 'src/src.dart';
export 'trust_framework/trust_framework.dart';
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,18 @@ class WalletSecurityView extends StatelessWidget {
);
},
),
DrawerItem(
title: l10n.backup,
onTap: () async {
await Navigator.of(context).push<void>(BackupMenu.route());
},
),
DrawerItem(
title: l10n.restore,
onTap: () async {
await Navigator.of(context).push<void>(RestoreMenu.route());
},
),
],
),
);
Expand Down
2 changes: 2 additions & 0 deletions lib/dashboard/drawer/wallet_security/wallet_security.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export 'advanced_security_settings/advanced_security_settings.dart';
export 'backup/backup.dart';
export 'helper_function/security_check.dart';
export 'recovery_key/recovery_key.dart';
export 'restore/restore.dart';
export 'src/src.dart';
Original file line number Diff line number Diff line change
Expand Up @@ -306,26 +306,29 @@ class _CredentialsDetailsViewState extends State<CredentialsDetailsView> {

/// display widget
if (!credentialManifestSupport &&
widget.credentialModel.display != null) ...[
widget.credentialModel.display != null &&
!isDeveloperMode) ...[
const SizedBox(height: 10),
DisplayWidget(
display: widget.credentialModel.display!,
),
],

/// credentialSubjectData
CredentialSubjectData(
credentialModel: widget.credentialModel,
showVertically: showVerticalDescription,
),
if (!isDeveloperMode)
CredentialSubjectData(
credentialModel: widget.credentialModel,
showVertically: showVerticalDescription,
),

/// selective disclouse data - _sd
/// and normal data too
DisplaySelectiveDisclosure(
credentialModel: widget.credentialModel,
claims: null,
showVertically: showVerticalDescription,
),
if (!isDeveloperMode)
DisplaySelectiveDisclosure(
credentialModel: widget.credentialModel,
claims: null,
showVertically: showVerticalDescription,
),

// /// normal claims data
// if (widget.credentialModel.credentialSupported !=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ class DeveloperDetails extends StatelessWidget {
String? payload;
String? data;

String? kbHeader;
String? kbPayload;

if (credentialModel.jwt != null) {
final jsonheader = decodeHeader(
jwtDecode: jwtDecode,
Expand All @@ -61,34 +58,12 @@ class DeveloperDetails extends StatelessWidget {
final selectiveDisclosure = SelectiveDisclosure(credentialModel);

final data = createJsonByDecryptingSDValues(
encryptedJson: credentialModel.data,
encryptedJson: jsonPayload,
selectiveDisclosure: selectiveDisclosure,
);

payload = const JsonEncoder.withIndent(' ')
.convert(Map.of(data)..removeWhere((key, value) => key == 'jwt'));

final probableJwt = credentialModel.jwt?.split('~').last;
kbHeader = 'None';
kbPayload = 'None';

if (probableJwt != null &&
probableJwt.isNotEmpty &&
probableJwt.startsWith('e')) {
try {
final header = jwtDecode.parseJwtHeader(probableJwt);
kbHeader = const JsonEncoder.withIndent(' ').convert(header);
} catch (e) {
kbHeader = 'None';
}

try {
final payload = jwtDecode.parseJwt(probableJwt);
kbPayload = const JsonEncoder.withIndent(' ').convert(payload);
} catch (e) {
kbPayload = 'None';
}
}
}
} else {
data = const JsonEncoder.withIndent(' ').convert(credentialModel.data);
Expand Down Expand Up @@ -177,24 +152,6 @@ class DeveloperDetails extends StatelessWidget {
valueColor: valueColor,
showVertically: showVertically,
),
if (kbHeader != null)
CredentialField(
padding: const EdgeInsets.only(top: 10),
title: l10n.keyBindingHeader,
value: kbHeader,
titleColor: titleColor,
valueColor: valueColor,
showVertically: showVertically,
),
if (kbPayload != null)
CredentialField(
padding: const EdgeInsets.only(top: 10),
title: l10n.keyBindingPayload,
value: kbPayload,
titleColor: titleColor,
valueColor: valueColor,
showVertically: showVertically,
),
],
);
}
Expand Down
1 change: 1 addition & 0 deletions lib/l10n/arb/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,7 @@
"keyBindingHeader": "Key Binding Header",
"keyBindingPayload": "Key Binding Payload",
"ebsiV4DecentralizedId": "did:key EBSI V4 P-256",
"noNotificationsYet": "No notifications yet",
"approveProfileTitle": "Install configuration",
"approveProfileDescription": "Do you consent to install the configuration of {company}?",
"@approveProfileDescription": {
Expand Down
12 changes: 12 additions & 0 deletions lib/l10n/untranslated.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@
"keyBindingHeader",
"keyBindingPayload",
"ebsiV4DecentralizedId",
<<<<<<< HEAD
"approveProfileTitle",
"approveProfileDescription"
=======
"noNotificationsYet"
>>>>>>> main
],

"es": [
Expand Down Expand Up @@ -95,8 +99,12 @@
"keyBindingHeader",
"keyBindingPayload",
"ebsiV4DecentralizedId",
<<<<<<< HEAD
"approveProfileTitle",
"approveProfileDescription"
=======
"noNotificationsYet"
>>>>>>> main
],

"fr": [
Expand Down Expand Up @@ -150,7 +158,11 @@
"keyBindingHeader",
"keyBindingPayload",
"ebsiV4DecentralizedId",
<<<<<<< HEAD
"approveProfileTitle",
"approveProfileDescription"
=======
"noNotificationsYet"
>>>>>>> main
]
}
Loading

0 comments on commit 6598ae2

Please sign in to comment.