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

I followed all steps of tutorial, but still getting this error. #10

Open
azeemgujjar opened this issue Jul 16, 2020 · 2 comments
Open

Comments

@azeemgujjar
Copy link

════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
The following _TypeError was thrown building Builder:
type 'int' is not a subtype of type 'double'

The relevant error-causing widget was: 
  MaterialApp file:///D:/Clients/experiments/Clima-Flutter/lib/main.dart:9:12
When the exception was thrown, this was the stack: 
#0      _LocationScreenState.updateUI.<anonymous closure> (package:clima/screens/location_screen.dart:36:14)
#1      State.setState (package:flutter/src/widgets/framework.dart:1233:30)
#2      _LocationScreenState.updateUI (package:clima/screens/location_screen.dart:28:5)
#3      _LocationScreenState.initState (package:clima/screens/location_screen.dart:24:5)
#4      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4640:58)
...
════════════════════════════════════════════════════════════════════════════════════════════════════

Please help

@azeemgujjar
Copy link
Author

i find the issue, actually sometimes if weather value is not in double type this through error, seems dart is not that smart as other popular old languages. i don't know why google choose this garbage.
i change my variable type from double to "var" and this fixes the issue.

@kiranojhanp
Copy link

i find the issue, actually sometimes if weather value is not in double type this through error, seems dart is not that smart as other popular old languages. i don't know why google choose this garbage.
i change my variable type from double to "var" and this fixes the issue.

because its also a strongly typed language?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants