getConfig function
Fetches config based on URL
Implementation
Config? getConfig(
Uri url, {
required Map<String, List<Config>> configs,
int configIndex = 0,
}) {
for (final i in configs.keys) {
if (url.host.contains(i)) {
Config? config = configs[i]!.firstWhereIndexedOrNull(
(i, _) => i == configIndex,
);
if (config == null) {
return configs[i]![0];
}
return config;
}
}
return null;
}