0% found this document useful (0 votes)
2 views3 pages

Flutter Programs

The document provides a collection of Flutter programs, including a Weather App, Stopwatch App, Navigation App, E-Commerce App, Amazon UI App, and a Splash Screen App. Each program is structured with a main function that initializes a MaterialApp and defines a StatefulWidget. The Weather App specifically fetches weather data from an API using an API key and displays the city name and temperature.

Uploaded by

shreyachar9353
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

Flutter Programs

The document provides a collection of Flutter programs, including a Weather App, Stopwatch App, Navigation App, E-Commerce App, Amazon UI App, and a Splash Screen App. Each program is structured with a main function that initializes a MaterialApp and defines a StatefulWidget. The Weather App specifically fetches weather data from an API using an API key and displays the city name and temperature.

Uploaded by

shreyachar9353
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Flutter Programs Collection

6th - Weather App

import 'dart:convert';
import 'package:flutter/[Link]';
import 'package:http/[Link]' as http;

void main() => runApp(const MaterialApp(home: Weather()));

class Weather extends StatefulWidget {


const Weather({[Link]});

@override
State<Weather> createState() => _WeatherState();
}

class _WeatherState extends State<Weather> {


TextEditingController c = TextEditingController();

String city = "", temp = "";

String key = "YOUR_API_KEY";

getData(String name) async {


var r = await [Link]([Link](
"[Link]
q=$name&appid=$key&units=metric"));

var d = jsonDecode([Link]);

setState(() {
city = d['name'];
temp = "${d['main']['temp']} °C";
});
}
}

7th - Stopwatch App

import 'dart:async';
import 'package:flutter/[Link]';

void main() {
runApp(const MaterialApp(home: Watch()));
}

class Watch extends StatefulWidget {


const Watch({[Link]});

@override
State<Watch> createState() => _WatchState();
}

8th - Navigation App

import 'package:flutter/[Link]';

void main() => runApp(MaterialApp(home: App(),


debugShowCheckedModeBanner: false));

9th - E-Commerce App

import 'package:flutter/[Link]';

void main() => runApp(MaterialApp(home: Home(),


debugShowCheckedModeBanner: false));

Amazon UI App

import 'package:flutter/[Link]';

void main() {
runApp(MaterialApp(
debugShowCheckedModeBanner: false,
home: AmazonUI(),
));
}

10th - Splash Screen App

import 'package:flutter/[Link]';
import 'dart:async';

void main() => runApp(MaterialApp(


debugShowCheckedModeBanner: false,
home: Splash(),
));

You might also like