Compare commits
No commits in common. "637f123c246201e77d3a28aae535a85463a9682d" and "0fd2dc3ddb73977416cc573b6c23729a5a4d0c31" have entirely different histories.
637f123c24
...
0fd2dc3ddb
@ -142,17 +142,16 @@ bool validateSettings(
|
||||
String? rootKey,
|
||||
}) {
|
||||
settings.forEach((key, value) {
|
||||
final checkKey = rootKey == null ? key : '$rootKey.$key';
|
||||
if (value is Map) {
|
||||
validateSettings(
|
||||
value as Map<String, dynamic>,
|
||||
failed,
|
||||
rootKey: checkKey,
|
||||
rootKey: rootKey == null ? key : '$rootKey.$key',
|
||||
);
|
||||
} else {
|
||||
for (var validator in getSettingValidators(checkKey)) {
|
||||
for (var validator in getSettingValidators(key)) {
|
||||
if (!validator(value.toString())) {
|
||||
failed.add(checkKey);
|
||||
failed.add(rootKey == null ? key : '$rootKey.$key');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -127,11 +127,6 @@ class _AddMountScreenState extends State<AddMountScreen> {
|
||||
onPressed: () {
|
||||
List<String> failed = [];
|
||||
if (!validateSettings(_settings[_mountType]!, failed)) {
|
||||
for (var key in failed) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text("'$key' is not valid")),
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user