-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #454 from 0xPolygonID/feature/env_cache_folder
Added cacheDir to env config.
- Loading branch information
Showing
17 changed files
with
58 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,39 @@ | ||
import 'package:polygonid_flutter_sdk/common/domain/entities/chain_config_entity.dart'; | ||
import 'package:polygonid_flutter_sdk/common/domain/entities/did_method_entity.dart'; | ||
|
||
/// https://github.com/0xPolygonID/c-polygonid?tab=readme-ov-file#configuration | ||
class EnvConfigEntity { | ||
final String ipfsNodeUrl; | ||
final Map<String, ChainConfigEntity> chainConfigs; | ||
final List<DidMethodEntity> didMethods; | ||
final String? cacheDir; | ||
|
||
EnvConfigEntity({ | ||
required this.ipfsNodeUrl, | ||
this.chainConfigs = const {}, | ||
this.didMethods = const [], | ||
this.cacheDir, | ||
}); | ||
|
||
factory EnvConfigEntity.fromJson(Map<String, dynamic> json) { | ||
return EnvConfigEntity( | ||
ipfsNodeUrl: json['ipfsNodeUrl'], | ||
chainConfigs: (json['chainConfigs'] as Map<dynamic, dynamic>).map( | ||
(key, value) => MapEntry(key, ChainConfigEntity.fromJson(value))), | ||
didMethods: (json['didMethods'] as List<dynamic>) | ||
.map((value) => DidMethodEntity.fromJson(value)) | ||
.toList(), | ||
cacheDir: json['cacheDir'], | ||
); | ||
} | ||
|
||
Map<String, dynamic> toJson() { | ||
return { | ||
'ipfsNodeUrl': ipfsNodeUrl, | ||
'chainConfigs': | ||
chainConfigs.map((key, value) => MapEntry(key, value.toJson())), | ||
'didMethods': didMethods.map((e) => e.toJson()).toList(), | ||
'cacheDir': cacheDir, | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
lib/credential/domain/use_cases/cache_credential_use_case.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.