A simple weather application built with Flutter that allows users to view weather details for their location. The app uses Material 3 design and a dark theme to provide a modern and user-friendly interface.
- Displays current weather information.
- Allows users to input a location to get weather details.
- Uses a dark theme for a visually appealing experience.
To get a local copy up and running, follow these steps.
- Flutter installed on your machine.
- Clone the repository:
git clone https://github.com/your-username/weather_app.git
- Navigate to the project directory:
cd weather_app - Install dependencies:
flutter pub get
- Run the app:
flutter run
Open the app to see the current weather information. Enter a location in the text field to get weather details for that location.
The 'main.dart' file is the entry point of the application. It sets up the 'MyApp' widget, which in turn sets up the 'MaterialApp' and the home screen.
code:
import 'package:flutter/material.dart';
import 'package:weather_app/weather_material_scaffold_app.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'weather_app',
theme: ThemeData.dark(
useMaterial3: true,
),
home: const MyWeatherApp(),
);
}
}The 'MyWeatherApp' widget is responsible for displaying the weather information. It includes a 'SingleChildScrollView' to prevent overflow issues and a 'SafeArea' to avoid system UI overlaps. Code:
class MyWeatherApp extends StatelessWidget {
const MyWeatherApp({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Weather App'),
),
body: SafeArea(
child: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text('Weather Details'),
TextField(
decoration: InputDecoration(
labelText: 'Enter location',
),
),
// Add more widgets as needed
],
),
),
),
),
);
}
}Ankit Kumar - ankitkumar81919895@gmail.com
Project Link: https://github.com/your-username/weather_app Project Link: https://github.com/ak0586/weather_app
For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

