ThemeConfig constructor
ThemeConfig(
- Map<
String, String> properties, { - RemoteAddresses addresses = const RemoteAddresses(),
- ThemeDesigns designs = ThemeDesigns.none,
Sorts properties, whose keys are relative to spring.flutter.theme
in any form (as a Binder gives them).
Implementation
ThemeConfig(
Map<String, String> properties, {
this.addresses = const RemoteAddresses(),
this.designs = ThemeDesigns.none,
}) {
for (final MapEntry(:key, :value) in properties.entries) {
final segments = key.split('.');
if (segments.length >= 3 &&
ThemeValues.canonical(segments[0]) == 'themes') {
final name = segments[1];
final canonicalName = ThemeValues.canonical(name);
final display = _displayNames.putIfAbsent(canonicalName, () => name);
_own.putIfAbsent(display, () => {})[_canonicalPath(segments.skip(2))] =
value;
continue;
}
final path = _canonicalPath(segments);
switch (path) {
case 'active':
active = value.trim();
case 'systemlight':
systemLight = value.trim();
case 'systemdark':
systemDark = value.trim();
case 'remember':
remember = value.trim().toLowerCase() != 'false';
case 'source' || 'sourcesha256' || 'refresh':
break;
default:
_base[path] = value;
}
}
}