Skip to content

Commit

Permalink
fix: Fix warning regarding - dont cast a nullable value to a non-null…
Browse files Browse the repository at this point in the history
…able type
  • Loading branch information
bibash28 committed Jun 21, 2024
1 parent b934d9d commit 88a6a47
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Future<CredentialManifest?> getCredentialManifest({
final credentialManifestMap = credentialManifestPath
.read(openidConfigurationJson)
.first
.value as Map<String, dynamic>;
.value! as Map<String, dynamic>;

/// create credentialManisfest object
final credentialManifest = CredentialManifest.fromJson(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ void main() {
final credentialManifestMap = credentialManifestPath
.read(jsonDecode(openIdConf))
.first
.value as Map<String, dynamic>;
.value! as Map<String, dynamic>;

/// create credentialManisfest object
final credentialManifest = CredentialManifest.fromJson(
Expand All @@ -205,7 +205,7 @@ void main() {
final Map<String, dynamic> outputDescriptorMap = outputDescriptorPath
.read(jsonDecode(openIdConf))
.first
.value as Map<String, dynamic>;
.value! as Map<String, dynamic>;
final OutputDescriptor outputDescriptor =
OutputDescriptor.fromJson(outputDescriptorMap);

Expand Down
12 changes: 6 additions & 6 deletions packages/oidc4vc/lib/src/oidc4vc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ class OIDC4VC {
) {
final jsonPath = JsonPath(r'$..issuer');

final data = jsonPath.read(openidConfigurationResponse.data).first.value
final data = jsonPath.read(openidConfigurationResponse.data).first.value!
as Map<String, dynamic>;

return data['id'] as String;
Expand All @@ -957,9 +957,9 @@ class OIDC4VC {
late dynamic data;

if (holderKid == null) {
data = (jsonPath.read(didDocument).first.value as List).first;
data = (jsonPath.read(didDocument).first.value! as List).first;
} else {
data = (jsonPath.read(didDocument).first.value as List)
data = (jsonPath.read(didDocument).first.value! as List)
.where(
(dynamic e) => e['kid'].toString() == holderKid,
)
Expand All @@ -972,9 +972,9 @@ class OIDC4VC {
late List<dynamic> data;

if (holderKid == null) {
data = (jsonPath.read(didDocument).first.value as List).toList();
data = (jsonPath.read(didDocument).first.value! as List).toList();
} else {
data = (jsonPath.read(didDocument).first.value as List)
data = (jsonPath.read(didDocument).first.value! as List)
.where(
(dynamic e) => e['id'].toString() == holderKid,
)
Expand Down Expand Up @@ -1334,7 +1334,7 @@ class OIDC4VC {

final credentialEndpoint = jsonPathCredential
.readValues(jsonDecode(jsonEncode(openIdConfiguration)))
.first as String;
.first! as String;
return credentialEndpoint;
}

Expand Down

0 comments on commit 88a6a47

Please sign in to comment.