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