merge method
Implementation
AppConfig merge(BaseConfig? config) {
if (config == null) return this;
AppConfig newConfig;
if (config is EnvConfig) {
newConfig = AppConfig(
disableUpdateCheck: disableUpdateCheck,
cachePath: config.cachePath,
useGitCache: config.useGitCache,
gitCachePath: config.gitCachePath,
flutterUrl: config.flutterUrl,
);
}
if (config is ProjectConfig) {
newConfig = AppConfig(
cachePath: config.cachePath,
useGitCache: config.useGitCache,
gitCachePath: config.gitCachePath,
flutterUrl: config.flutterUrl,
priviledgedAccess: config.priviledgedAccess,
runPubGetOnSdkChanges: config.runPubGetOnSdkChanges,
updateVscodeSettings: config.updateVscodeSettings,
updateGitIgnore: config.updateGitIgnore,
);
}
if (config is AppConfig) {
return copyWith.$merge(config);
}
newConfig = AppConfig(
cachePath: config.cachePath,
useGitCache: config.useGitCache,
gitCachePath: config.gitCachePath,
flutterUrl: config.flutterUrl,
);
return copyWith.$merge(newConfig);
}