You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.16.3, on Ubuntu 22.04.3 LTS 6.2.0-37-generic, locale de_DE.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2023.1)
[✓] IntelliJ IDEA Community Edition (version 2023.2)
[✓] Connected device (3 available)
[✓] Network resources
• No issues found!
Minimal code example
class FormBuilderNumericField extends FormBuilderFieldDecoration<double> {
FormBuilderNumericField({
super.key,
required super.name,
super.validator,
super.onChanged,
double? initialValue,
}) : super(
builder: (FormFieldState<double?> field) {
final state = field as _FormBuilderNumericFieldState;
return NumericField(
value: initialValue,
onChanged: (newValue) {
if(onChanged != null) {
onChanged(newValue);
}
state.didChange(newValue);
}
);
}
);
@override
FormBuilderFieldDecorationState<FormBuilderNumericField, double> createState() => _FormBuilderNumericFieldState();
}
class _FormBuilderNumericFieldState extends FormBuilderFieldDecorationState<FormBuilderNumericField, double> {
}
Current Behavior
exception in form_builder_field.dart: type 'String' is not a subtype of type 'double?' in type cast
Expected Behavior
I wrote my own field which gives me a double. That all works too. However, if I don't set "initialValue" (=null), I get the following exception in form_builder_field.dart: type 'String' is not a subtype of type 'double?' in type cast
This is the line:
T? get initialValue =>
widget.initialValue ??
(_formBuilderState?.initialValue ??
const <String, dynamic>{})[widget.name] as T?;
Steps To Reproduce
Use the small snippet of my code.
Aditional information
No response
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Package/Plugin version
9.1.1
Platforms
Flutter doctor
Minimal code example
Current Behavior
exception in form_builder_field.dart:
type 'String' is not a subtype of type 'double?' in type cast
Expected Behavior
I wrote my own field which gives me a double. That all works too. However, if I don't set "initialValue" (=null), I get the following exception in form_builder_field.dart:
type 'String' is not a subtype of type 'double?' in type cast
This is the line:
Steps To Reproduce
Use the small snippet of my code.
Aditional information
No response
The text was updated successfully, but these errors were encountered: