Skip to content

Commit

Permalink
feat: Added format attribute in card details #1799
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Aug 17, 2023
1 parent 4434ee6 commit ce5b832
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 16 deletions.
8 changes: 1 addition & 7 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@
"request": "launch",
"type": "dart",
"program": "lib/main_production.dart",
"args": [
"--flavor",
"production",
"--target",
"lib/main_production.dart",
"--release"
]
"args": ["--flavor", "production", "--target", "lib/main_production.dart"]
}
]
}
4 changes: 2 additions & 2 deletions lib/app/shared/widget/base/credential_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ class DisplayCredentialField extends StatelessWidget {
Widget build(BuildContext context) {
return Padding(
padding: padding,
child: RichText(
child: SelectableText.rich(
textAlign: TextAlign.left,
text: TextSpan(
TextSpan(
children: <InlineSpan>[
if (title != null)
TextSpan(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ class CredentialDynamicDetial extends StatelessWidget {

return Padding(
padding: padding,
child: RichText(
child: SelectableText.rich(
textAlign: TextAlign.left,
text: TextSpan(
TextSpan(
children: <InlineSpan>[
TextSpan(text: '$title: ', style: titleTheme),
TextSpan(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import 'dart:convert';

import 'package:altme/app/shared/shared.dart';
import 'package:altme/dashboard/dashboard.dart';
import 'package:altme/l10n/l10n.dart';
import 'package:altme/theme/theme.dart';
import 'package:credential_manifest/credential_manifest.dart';
import 'package:flutter/material.dart';
Expand All @@ -17,6 +21,11 @@ class CredentialManifestDetails extends StatelessWidget {
Widget build(BuildContext context) {
final titleColor = Theme.of(context).colorScheme.titleColor;
final valueColor = Theme.of(context).colorScheme.valueColor;

final l10n = context.l10n;

final data = credentialModel.jwt ?? credentialModel.data;

return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expand All @@ -33,6 +42,13 @@ class CredentialManifestDetails extends StatelessWidget {
titleColor: titleColor,
valueColor: valueColor,
),
CredentialField(
padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 8),
title: l10n.format,
value: data.toString(),
titleColor: titleColor,
valueColor: valueColor,
),
],
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class DisplayPropertiesWidget extends StatelessWidget {
),
);
});

if (widgets.isNotEmpty) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
Expand Down
3 changes: 2 additions & 1 deletion lib/l10n/arb/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -929,5 +929,6 @@
},
"oidc4vcProfile": "OIDC4VC Profile",
"pleaseSwitchToCorrectOIDC4VCProfile": "Please switch to correct OIDC4VC profile.",
"authenticationSuccess": "Authentication Success"
"authenticationSuccess": "Authentication Success",
"format": "Format"
}
12 changes: 8 additions & 4 deletions lib/l10n/untranslated.json
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,8 @@
"pleaseSwitchPolygonNetwork",
"oidc4vcProfile",
"pleaseSwitchToCorrectOIDC4VCProfile",
"authenticationSuccess"
"authenticationSuccess",
"format"
],

"es": [
Expand Down Expand Up @@ -1686,7 +1687,8 @@
"pleaseSwitchPolygonNetwork",
"oidc4vcProfile",
"pleaseSwitchToCorrectOIDC4VCProfile",
"authenticationSuccess"
"authenticationSuccess",
"format"
],

"fr": [
Expand Down Expand Up @@ -1834,7 +1836,8 @@
"pleaseSwitchPolygonNetwork",
"oidc4vcProfile",
"pleaseSwitchToCorrectOIDC4VCProfile",
"authenticationSuccess"
"authenticationSuccess",
"format"
],

"it": [
Expand Down Expand Up @@ -2679,6 +2682,7 @@
"pleaseSwitchPolygonNetwork",
"oidc4vcProfile",
"pleaseSwitchToCorrectOIDC4VCProfile",
"authenticationSuccess"
"authenticationSuccess",
"format"
]
}

0 comments on commit ce5b832

Please sign in to comment.