Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
Fetches weather data using an API and displays it using FlutterFlow visual widgets.
import 'package:flutter/material.dart';
import 'dart:convert';
import 'package:http/http.dart' as http;
class WeatherApp extends StatefulWidget {
@override
_WeatherAppState createState() => _WeatherAppState();
}
class _WeatherAppState extends State<WeatherApp> {
final controller = TextEditingController();
Map<String, dynamic>? weather;
Future<void> fetchWeather() async {
final res = await http.get(Uri.parse('https://api.weatherapi.com/v1/current.json?key=YOUR_API_KEY&q=${controller.text}'));
setState(()=>weather=jsonDecode(res.body));
}
@override
Widget build(BuildContext context){
return Scaffold(
appBar: AppBar(title: Text('Weather App')),
body: Column(children:[
TextField(controller: controller, decoration: InputDecoration(hintText:'Enter City')),
ElevatedButton(onPressed: fetchWeather, child: Text('Search')),
if(weather!=null) Text('Temp: '+weather!['current']['temp_c'].toString()+'°C')
])
);
}
}FlutterFlow is a low-code visual app builder that enables users to create native iOS, Android, and web applications using a drag-and-drop interface, powered by Google’s Flutter framework.
Origin & Creator
FlutterFlow was created by Abel Mengistu and Alex Greaves, launched in 2021 to simplify Flutter app development for both developers and non-developers.
Industrial Note
FlutterFlow is popular among startup founders, Flutter developers, and product teams building cross-platform applications rapidly with both visual UI editing and optional custom coding.