This is a sample Flutter Weather Forecast App for Android and iOS.

Overview

Basic Flutter (Android + iOS) App (Dart + Dio) - Weather App

This is a very beginning friendly project of Flutter. A simple weather forecast App using Open Weather Map API. I have used StatefulWidget for state management. For network calls I used the popular Flutter package Dio.

Prerequisite

Basic understanding of Dart programming language. Have to familiar with REST API and network calls with HTTP protocol.

Project Description

We will develop a weather forecast Android Application with Flutter. The UI will be as like as above screenshot. There is a DropdownButton with some City name. After selection a city, user need to hit the View Weather button. Then App will send request to Open Weather web API and show the weather information in the UI.

Open Weather API

We will use Open Weather Map API for collecting weather information. To get the real weather information of a city, you need to sign up and get your own APP ID. Otherwise you can test the API with their sample BASE URL and sample APP ID without creating account.

Project Setup

Clone the project and open it using Android Studio. Then create a file config.json inside assets folder. Add baseUrl and appId JSON field inside the parent JSON object.

Use Sample API without creating account

Add below lines at your config.json file. Then run the project. You'll get dummy or static API response from Open Weather API.

{
  "baseUrl": "https://samples.openweathermap.org/data/2.5",
  "appId": "b6907d289e10d714a6e88b30761fae22"
}

Use Real APP ID after sign up and activation of your APP ID

After Sign up at the website collect your own APP ID from their API Keys page. Then add your APP ID in config.json file like below.

" } ">
{
  "baseUrl": "http://api.openweathermap.org/data/2.5",
  "appId": "
   
    "
}

   

The BASE URL and APP ID will be fetched from main.dart file and will be stored it in our local configuration file.

Note: The free version of Open Weather API allows maximum 60 API calls per minute.

Run the project

Run flutter pub get to sync the packages. Then run the app to your real device or emulator.

Disclaimer

This is my first project in Flutter. So there are lots of things to improve. It is not guaranteed about the best practices and Flutter convention in this project. Please don't use this project as a reference or as a boilerplate of your other project. For the sake of simplicity, I avoided to use Bloc, GetX etc. Next time I'll create different repositories for them. Feel free to create issues for improvement.Thanks.

You might also like...

This project is by taking the sample application of the

This project is by taking the sample application of the

debo_eyu A new Flutter project. Any one who want to contact me, use my email [email protected] or on my telegram account using @LindaAug1 let's se

Oct 15, 2021

Sample project for an employee management application.

HR App Sample project for an employee management application. Getting Started Choose a storage implementation to be used. The application currently su

Jul 14, 2022

A simple fully working weather app with state management build using flutter.

A simple fully working weather app with state management build using flutter.

A simple fully working weather app with state management build using flutter.

Apr 12, 2022

A Brand New Flutter Weather App

A Brand New Flutter Weather App

A Brand New Flutter Weather App

Aug 25, 2022

Weather App Using Flutter

Weather App Using Flutter

weather_app A new Flutter project. ITS NOT COMPLETED YET!! Getting Started This project is a starting point for a Flutter application. A few resources

Aug 21, 2022

A Simple Weather App Using Flutter

A Simple Weather App Using Flutter

Hi there, I'm Ayush Maji ! 👋 weather_app Use the Weather app to check the weather for your current location or in other places. You can view the hour

Apr 20, 2022

Weather app with http

weather_application_http A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you

Oct 29, 2021

The Medito app is a 100% free meditation app built with flutter. The app is available on Android and iOS.

Medito App Meditation can positively transform people's lives. We believe no one should have to pay for it. We are the Medito Foundation, and we've bu

Sep 28, 2022

A Flutter Project to display arduino sensors values about weather

A Flutter Project to display arduino sensors values about weather

worldwide_weather_watcher A new Flutter project. Getting Started This project is a starting point for a Flutter application. The Arduino send each 10

Aug 9, 2022
Owner
Hasan Abdullah
I'm an Android Mobile App developer. Love to solve problem on Online Programming Judge sites. Write on my own website.
Hasan Abdullah
Weather App - Test application Weather for 8app.ru

Weather App Test application Weather for 8app.ru Getting Started In order to run the first build of the application, use the Makefile for code generat

Dmitry Munitsyn 0 Apr 15, 2022
Flutter Advanced: Background Fetch | Run code in the background Android & iOS | Run code in the background Android & iOS

flutterbackground A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you starte

Pawan Kumar 39 Aug 29, 2022
An (Sample)app that allows users to donate their pets and adopt others pets.

PetApp An (Sample)app that allows users to donate their pets and adopt others pets. About I created this app to learn more about Flutter and UI/UX in

VIDIT SINGH BRAHAMANIA 32 Sep 6, 2022
Sample flutter app for getting started with the Amplify Flutter Library.

Amplify Flutter Example Sample flutter app for getting started with the Amplify Flutter Library. This example uses the Auth, Analytics, and Storage co

Dao Hong Vinh 10 Jan 19, 2022
💙 A simple Flutter app sample with hooks_riverpod, includes HTTP requests by dio using GitHub APIs.

?? A simple Flutter app sample with hooks_riverpod, includes HTTP requests by dio using GitHub APIs.

Kosuke Saigusa 15 Aug 31, 2022
Firebase + Flutter sample apps with code snippets, supported by comprehensive articles for each implementation.

FlutterFire Samples This repo is created to contain various sample apps demonstrating the integration of Firebase with Flutter. The final goal is to c

Souvik Biswas 159 Sep 22, 2022
Flutter Multichannel Packaging Detail Sample Project

Flutter 多渠道打包详解 多渠道打包介绍 多渠道打包的主要作用是满足产品的运营需求,统计渠道和活动效果。 在之前原生(Android、iOS)开发 App 有各种工具来辅助我们完成多渠道打包。 在我们开发过程中也需要为渠道功能负责,原生的开发工具就基本满足我们调试渠道包内容,但是在 Flutt

Zero 25 Jun 27, 2022
Sample that produces the following issue with Firebase Database web in Flutter

issue_rtdb_controller_already_firing_event Sample that produces the following issue with Firebase Database web in Flutter. @firebase/database: Error:

Deepak Goyal 0 Oct 25, 2021
A sample Google Chrome browser extension built in flutter web

My Activities It is a sample Google Chrome browser extension The extension was built in Flutter Web. How to build % cd /path/to/project/root % flutter

Viktor BORBÉLY 3 Nov 12, 2021
A collection of sample apps that use Stream

Flutter samples Quick Links Register to get an API key for Stream Chat Flutter Chat Tutorial Chat UI Kit Flutter SDK Repo What is Stream? Stream allow

Stream 234 Sep 21, 2022