Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The control is NOT implicitly set to 'double' data type in Web platform. #461

Open
cezaryjk opened this issue Aug 21, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@cezaryjk
Copy link

Environment

Flutter Web
Package version:
17.0.1

Flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.24.0, on Microsoft Windows [Version 10.0.19045.4780], locale pl-PL)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.10.4)
[√] Android Studio (version 2024.1)
[√] IntelliJ IDEA Community Edition (version 2020.3)
[√] VS Code, 64-bit edition (version 1.92.2)
[√] Connected device (3 available)
[√] Network resources

• No issues found!

Code sample
In MaterialViewModel class:

final FormGroup form = fb.group({
    'ilosc': [0.0],
  }, []);

...
In MaterialView class:

ReactiveTextField<double>(
                formControlName: 'ilosc',
              ),

Description

The control is NOT implicitly set to 'double' data type in Web platform.

Expected behavior:
The control should be implicitly set to 'double' data type.

Current behavior:
Exception:

══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following BindingCastException<double, String> was thrown building ReactiveFormPopScope:
BindingCastException: The widget ReactiveTextField bound to "ilosc" control
is expecting a "FormControl" data type,
but received a "FormControl" data type.

This is caused because the template data type declared in the widget "ReactiveTextField<double>"
is not a 'subtype' of the template data type declared in the control "FormControl<int>".
@cezaryjk cezaryjk added the bug Something isn't working label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant