Fixed comments

This commit is contained in:
Jacques Doeleman 2022-09-22 09:53:26 +02:00
parent 2f633eff7c
commit 29a90a377b
2 changed files with 7 additions and 14 deletions

View file

@ -19,12 +19,9 @@ class ItemBuilder {
); );
late InputDecoration inputDecoration; late InputDecoration inputDecoration;
if (options.inputDecorationField != null &&
options.inputDecorationField![key] != null) { inputDecoration =
inputDecoration = options.inputDecorationField![key]!; options.inputDecorationField?[key] ?? options.inputDecoration;
} else {
inputDecoration = options.inputDecoration;
}
return Form( return Form(
key: formKey, key: formKey,
@ -39,11 +36,7 @@ class ItemBuilder {
} }
}, },
validator: (value) { validator: (value) {
if (options.validators != null && return options.validators?[key]?.call(value);
options.validators![key] != null) {
return options.validators![key]!(value);
}
return null;
}, },
), ),
); );

View file

@ -1,11 +1,11 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
/// ItemBuilderOptions is a class to store all settings for a field in the profile page. /// ItemBuilderOptions is a class to store all settings for a field in the profile page.
/// ///
/// InputDecoration sets the decoration for all standard textfields. This is overridden if a field specific decoration is set by inputDecorationField. /// InputDecoration sets the decoration for all standard textfields. This is overridden if a field specific decoration is set by inputDecorationField.
/// ///
/// inputDecorationField sets the inputdecoration by key of the user data field. So a field can have its own specific decoration. /// inputDecorationField sets the inputdecoration by key of the user data field. So a field can have its own specific decoration.
/// ///
/// Validator can be used to set a validator for the standard textfield. /// Validator can be used to set a validator for the standard textfield.
class ItemBuilderOptions { class ItemBuilderOptions {
ItemBuilderOptions({ ItemBuilderOptions({