Create management portal in Flutter #39
This commit is contained in:
parent
0fd2dc3ddb
commit
6602e7eff6
@ -142,16 +142,19 @@ bool validateSettings(
|
|||||||
String? rootKey,
|
String? rootKey,
|
||||||
}) {
|
}) {
|
||||||
settings.forEach((key, value) {
|
settings.forEach((key, value) {
|
||||||
|
final checkKey = rootKey == null ? key : '$rootKey.$key';
|
||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
|
debugPrint('nested: $checkKey');
|
||||||
validateSettings(
|
validateSettings(
|
||||||
value as Map<String, dynamic>,
|
value as Map<String, dynamic>,
|
||||||
failed,
|
failed,
|
||||||
rootKey: rootKey == null ? key : '$rootKey.$key',
|
rootKey: checkKey,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
for (var validator in getSettingValidators(key)) {
|
debugPrint('validate: $checkKey--$value');
|
||||||
|
for (var validator in getSettingValidators(checkKey)) {
|
||||||
if (!validator(value.toString())) {
|
if (!validator(value.toString())) {
|
||||||
failed.add(rootKey == null ? key : '$rootKey.$key');
|
failed.add(checkKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user