Skip to content

Commit

Permalink
Merge branch 'main' into main_android
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkbee1 committed May 31, 2024
2 parents 339c51f + c0fec39 commit c0ef3d8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2,740 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:altme/app/app.dart';
import 'package:altme/dashboard/dashboard.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:uuid/uuid.dart';

part 'credential.g.dart';

Expand Down Expand Up @@ -50,7 +51,7 @@ class Credential {
[Evidence.emptyEvidence()],
);
}

@JsonKey(fromJson: fromJsonId)
final String id;
@JsonKey(name: '@context')
final List<dynamic>? context;
Expand Down Expand Up @@ -147,4 +148,12 @@ class Credential {
return Credential.dummy();
}
}

static String fromJsonId(dynamic json) {
if (json == null || json == '') {
return const Uuid().v4();
} else {
return json.toString();
}
}
}
Loading

0 comments on commit c0ef3d8

Please sign in to comment.