Giter Club home page Giter Club logo

flutterweather's Introduction

FlutterWeather

Updated to Flutter 3.0 & New Updated Design

A simple weather App created using Flutter and Dart and using API from OpenWeatherMap

New Design Inspired by Rina Damayanti on Dribbble.

API Docs

Important

This project uses version 2.5 of the OpenWeatherMap API
API used in this project:

Features

  • Automatically acquire user current location
  • Searchable location
  • Hourly weather information
  • 7 days weather information

How to Run

  1. Create an account at OpenWeatherMap.
  2. Then get your API key from https://home.openweathermap.org/api_keys.

    Sometimes after getting your OpenWeatherMap API key it won't work right away
    To test if your API key is working or not copy and paste the following link to your browser
    https://api.openweathermap.org/data/2.5/weather?lat=53.4794892&lon=-2.2451148&units=metric&appid=YOUR_API_KEY
    Then replace YOUR_API_KEY with your own API key from OpenWeatherMap

  3. Clone the repo
    git clone https://github.com/ArizArmeidi/FlutterWeather.git
  4. Install all the packages by typing
    flutter pub get
  5. Navigate to lib/provider/weatherProvider.dart and paste your API key to the apiKey variable
    String apiKey = 'Paste Your API Key Here';
  6. Run the App

Contact

License

Distributed under the MIT License. See LICENSE for more information.

flutterweather's People

Contributors

arizarmeidi avatar morenosh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

flutterweather's Issues

error: 'SearchBar' isn't a function

[. (invocation_of_non_function at [flutter_weather] lib\Screens\homeScreen.dart:63)](error: The name 'SearchBar' is defined in the libraries 'package:flutter/src/material/search_anchor.dart (via package:flutter/material.dart)' and 'package:flutter_weather/widgets/searchBar.dart'. (ambiguous_import at [flutter_weather] lib\Screens\homeScreen.dart:63))

App Crash

Running on a Pixel 6A with poor internet connectivity where I am, and with Location allowed "while using App", it just crashes.
The UI goes straight to reporting "No search results"...
When I press Return Home, it shows the search box briefly but not long enough to type anything (can't even type a few letters), then goes back to No Search Results.
Loop ad nauseum.

I did put my OWM API key in place :-) 'git diff' shows that the only change, from 09918c1

$ flutter run
. . .
๐Ÿ’ช Running with sound null safety ๐Ÿ’ช

An Observatory debugger and profiler on Pixel 6a is available at: http://127.0.0.1:4156/74dQjtPQmp4=/
I/flutter_weather(11763): Compiler allocated 4579KB to compile void android.view.ViewRootImpl.performTraversals()
The Flutter DevTools debugger and profiler on Pixel 6a is available at: http://127.0.0.1:9100?uri=http://127.0.0.1:4156/74dQjtPQmp4=/
E/SurfaceSyncer(11763): Failed to find sync for id=0
D/CompatibilityChangeReporter(11763): Compat change id reported: 78294732; UID 10306; state: DISABLED
I/flutter (11763): NoSuchMethodError: The method '[]' was called on null.
I/flutter (11763): Receiver: null
I/flutter (11763): Tried calling:
E/flutter (11763): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: NoSuchMethodError: The method '[]' was called on null.
E/flutter (11763): Receiver: null
E/flutter (11763): Tried calling:
E/flutter (11763): #0 WeatherProvider.getDailyWeather (package:flutter_weather/provider/weatherProvider.dart:105:7)
E/flutter (11763):
E/flutter (11763): #1 WeatherProvider.getWeatherData. (package:flutter_weather/provider/weatherProvider.dart:36:11)
E/flutter (11763):
E/flutter (11763): #2 WeatherProvider.getWeatherData (package:flutter_weather/provider/weatherProvider.dart:30:5)
E/flutter (11763):
E/flutter (11763):
I/flutter (11763): NoSuchMethodError: The method '[]' was called on null.
I/flutter (11763): Receiver: null
I/flutter (11763): Tried calling:
E/flutter (11763): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: NoSuchMethodError: The method '[]' was called on null.
E/flutter (11763): Receiver: null
E/flutter (11763): Tried calling:
E/flutter (11763): #0 WeatherProvider.getDailyWeather (package:flutter_weather/provider/weatherProvider.dart:105:7)
E/flutter (11763):
E/flutter (11763): #1 WeatherProvider.getWeatherData. (package:flutter_weather/provider/weatherProvider.dart:36:11)
E/flutter (11763):
E/flutter (11763): #2 WeatherProvider.getWeatherData (package:flutter_weather/provider/weatherProvider.dart:30:5)
E/flutter (11763):
E/flutter (11763):

Installing the obvious "if-null check print; return" at line 36 just makes it crash further down.

Thoughts?

F-Droid

Please release app on F-Droid

App hangs at "no search result"

Hello,
just compiled this app using my OpenWeather API key.
On first start, it says "No Search Result" after a few second.
Return Home > spinning wheel then same result again.
How do I get started with this app?
Many thanks

getDailyWeather uses the previous location

If I'm reading this correctly, in weatherProvider.dart, in searchweather,
the code is saving the latitude, and longitude, then calls searchweatherWithLocation, which sets the weather object that has been entered in the searchBar.dart.
Then calls getDailyweather, which uses the lat and long from before searchWeatherWithLocation was called, so it is the previous location.
simply moving the code around fixes this,
// first call this with will set the weather object
await searchWeatherWithLocation(location);
// then get that lat and long,
double latitude = weather.lat;
double longitude = weather.long;

await getDailyWeather(LatLng(latitude, longitude));

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.