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

Inherited_provider.dart class _CreateInheritedProviderState<T> throws error when I pass in 440 as double? works with 440.0 #846

Open
QCIPaulCardno opened this issue Nov 7, 2023 · 1 comment
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@QCIPaulCardno
Copy link

Its difficult to see exactly what is happening here as the call stack doesn't have any reference to my code but here is my code and the change that I make to get it to work.

Where I call
GenericSidePanelState(panelType: ContourThematicPanelType.meticDisplay, width: 440);

I get
"Exception has occurred.
_TypeError (type 'int' is not a subtype of type 'double?')"
line 743
Inherited_provider.dart class _CreateInheritedProviderState

Where
class GenericSidePanelState extends PanelDetailsState {
ContourThematicPanelType panelType;

GenericSidePanelState({width, required this.panelType}) : super(width: width);
}

and
abstract class PanelDetailsState {
double? width;
PanelDetailsState({required this.width});
}

When I change this to (note the ".0" added to 440)
GenericSidePanelState(panelType: ContourThematicPanelType.meticDisplay, width: 440.0);

then it works.

@rrousselGit
Copy link
Owner

Please provide a full example. As is, it's very hard to tell what's going on

@rrousselGit rrousselGit added question Further information is requested and removed needs triage labels Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants