File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -75,10 +75,14 @@ class Configuration {
7575 }
7676
7777 /// Load configuration from environment variables
78- static fromEnv ({String prefix = "" }) {
79- final accessToken = Platform .environment["${prefix }ACCESS_TOKEN" ];
80- return Configuration (
81- accessToken: accessToken,
82- );
78+ static Configuration ? fromEnv ({String prefix = "" }) {
79+ final String ? accessToken = Platform .environment["${prefix }ACCESS_TOKEN" ];
80+ if (accessToken != null && accessToken.isNotEmpty) {
81+ return Configuration (
82+ accessToken: accessToken,
83+ );
84+ }
85+
86+ return null ;
8387 }
8488}
Original file line number Diff line number Diff line change @@ -4,10 +4,11 @@ import 'dart:math';
44import 'package:aspose_barcode_cloud/aspose_barcode_cloud.dart' ;
55
66class TestConfig {
7- static final configuration =
8- Configuration .load ("test${Platform .pathSeparator }configuration.json" ) ??
9- Configuration .fromEnv (prefix: "TEST_CONFIGURATION_" );
10- static final apiClient = ApiClient (configuration);
7+ static final Configuration ? configuration =
8+ Configuration .fromEnv (prefix: "TEST_CONFIGURATION_" ) ??
9+ Configuration .load ("test${Platform .pathSeparator }configuration.json" );
10+
11+ static final apiClient = ApiClient (configuration! );
1112
1213 static final barcodeApi = BarcodeApi (apiClient);
1314
You can’t perform that action at this time.
0 commit comments