File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ class DatabaseConfig {
24
24
25
25
factory DatabaseConfig .fromEnvironment ({DatabaseConfig defaults}) =>
26
26
DatabaseConfig .fromJson (_jsonFromEnvironment (defaults));
27
+
28
+ static final defaults = DatabaseConfig .fromJson (< String , dynamic > {});
29
+
27
30
Map <String , dynamic > toJson () => _$DatabaseConfigToJson (this );
28
31
29
32
@JsonKey (defaultValue: 'localhost' )
@@ -38,9 +41,14 @@ class DatabaseConfig {
38
41
@JsonKey (defaultValue: 'blubb' )
39
42
final String password;
40
43
41
- DatabaseConfig copyWith ({String databaseName}) => DatabaseConfig (
42
- host: host,
43
- port: port,
44
+ DatabaseConfig copyWith ({
45
+ String host,
46
+ int port,
47
+ String databaseName,
48
+ }) =>
49
+ DatabaseConfig (
50
+ host: host ?? this .host,
51
+ port: port ?? this .port,
44
52
databaseName: databaseName ?? this .databaseName,
45
53
username: username,
46
54
password: password,
You can’t perform that action at this time.
0 commit comments