Weather App - Flutterflow Typing CST Test
Loading…
Weather App — Flutterflow Code
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 Language Guide
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.
Primary Use Cases
- ▸Cross-platform mobile apps
- ▸Startup MVPs and prototypes
- ▸SaaS and dashboard apps
- ▸Internal tools and admin panels
- ▸Apps with Firebase or API-based backends
Notable Features
- ▸Drag-and-drop UI builder
- ▸Firebase integration and authentication
- ▸Custom actions and custom Flutter code
- ▸API/REST integration
- ▸Workflow logic and animations
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.