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

Flutter Assignment

Mobile app development involves creating software applications for mobile devices, focusing on user interface design, functionality, and performance. The process includes designing, coding, testing, and deploying apps for platforms like Android and iOS, often using languages such as Java, Kotlin, Swift, or Dart with frameworks like Flutter. An assignment example is provided for developing a Flutter app that converts temperatures between Celsius, Fahrenheit, and Kelvin.

Uploaded by

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

Flutter Assignment

Mobile app development involves creating software applications for mobile devices, focusing on user interface design, functionality, and performance. The process includes designing, coding, testing, and deploying apps for platforms like Android and iOS, often using languages such as Java, Kotlin, Swift, or Dart with frameworks like Flutter. An assignment example is provided for developing a Flutter app that converts temperatures between Celsius, Fahrenheit, and Kelvin.

Uploaded by

ksett92
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

1

Mobile App Development

Mobile app development is the process of creating software


applications designed to run on mobile devices such as smartphones
and tablets. With the ever-increasing use of mobile devices in daily
life, mobile apps have become an essential part of the digital
ecosystem, serving various purposes such as communication,
entertainment, education, business, and more. These apps provide
users with a convenient way to access services and information on
the go, making mobile app development a highly relevant and in-
demand field.

The development process involves designing, coding, testing, and


deploying applications for platforms like Android and iOS, which
dominate the global market. Android apps are typically built using
Java or Kotlin, while iOS apps are developed using Swift or Objective-
C. Cross-platform frameworks such as Flutter and React Native are
also popular, allowing developers to create apps that work on both
platforms with a single codebase.

Key aspects of mobile app development include user interface (UI)


design, ensuring the app is visually appealing and easy to use;
functionality, which ensures the app meets user needs; and
performance, ensuring the app runs smoothly and efficiently.
Security and scalability are also crucial to protect user data and
handle growing demand.

In this assignment, we will explore the fundamental concepts, tools,


and techniques involved in mobile app development. By
understanding these aspects, we can appreciate how mobile
applications shape modern technology and influence the way we
interact with the world.

Mobile App Development


2

Assignment 1 :- - Develop a Flutter app using Dart programming that allows users to convert
temperatures between Celsius, Fahrenheit, and Kelvin. The app should include an input field for the
temperature value, drop-down menus to select the input and output units, and a button to perform the
conversion. Display the converted temperature result within the app's interface.

Code(main.dart) :-

import 'package:flutter/material.dart';
final List<String> _units = ['Celsius', 'Fahrenheit', 'Kelvin'];
void main() {
runApp(TemperatureConverterApp()); void _convertTemperature() {
} double inputTemp = double.tryParse(_controller.text) ?? 0.0;
double outputTemp = inputTemp;
class TemperatureConverterApp extends StatelessWidget {
static final ValueNotifier<ThemeMode> _themeNotifier = if (_fromUnit == _toUnit) {
ValueNotifier(ThemeMode.light); _result = '$inputTemp $_toUnit';
} else {
@override if (_fromUnit == 'Celsius') {
Widget build(BuildContext context) { if (_toUnit == 'Fahrenheit') {
return ValueListenableBuilder<ThemeMode>( outputTemp = (inputTemp * 9 / 5) + 32;
valueListenable: _themeNotifier, } else if (_toUnit == 'Kelvin') {
builder: (context, currentTheme, child) { outputTemp = inputTemp + 273.15;
return MaterialApp( }
debugShowCheckedModeBanner: false, } else if (_fromUnit == 'Fahrenheit') {
title: 'Temperature Converter', if (_toUnit == 'Celsius') {
theme: ThemeData.light(), outputTemp = (inputTemp - 32) * 5 / 9;
darkTheme: ThemeData.dark(), } else if (_toUnit == 'Kelvin') {
themeMode: currentTheme, outputTemp = (inputTemp - 32) * 5 / 9 + 273.15;
home: TemperatureConverterScreen(), }
); } else if (_fromUnit == 'Kelvin') {
}, if (_toUnit == 'Celsius') {
); outputTemp = inputTemp - 273.15;
} } else if (_toUnit == 'Fahrenheit') {
outputTemp = (inputTemp - 273.15) * 9 / 5 + 32;
static void toggleTheme() { }
_themeNotifier.value = _themeNotifier.value == }
ThemeMode.light
? ThemeMode.dark _result = '${outputTemp.toStringAsFixed(2)} $_toUnit';
: ThemeMode.light; }
}
setState(() {});
static bool isDarkMode() { }
return _themeNotifier.value == ThemeMode.dark;
} @override
} Widget build(BuildContext context) {
bool isDark = TemperatureConverterApp.isDarkMode();
class TemperatureConverterScreen extends StatefulWidget {
@override return Scaffold(
_TemperatureConverterScreenState createState() => appBar: AppBar(
_TemperatureConverterScreenState(); centerTitle: true,
} title: Text('Temperature Converter'),
actions: [
class _TemperatureConverterScreenState // Sun/Moon Toggle Button
extends State<TemperatureConverterScreen> { IconButton(
final TextEditingController _controller = icon: Icon(isDark ? Icons.nightlight_round :
TextEditingController(); Icons.wb_sunny),
String _fromUnit = 'Celsius'; onPressed: () {
String _toUnit = 'Fahrenheit'; TemperatureConverterApp.toggleTheme();
String _result = ''; },
Mobile App Development
3

), Icon(Icons.arrow_forward),
], DropdownButton<String>(
), value: _toUnit,
body: Padding( items: _units.map((String unit) {
padding: const EdgeInsets.all(16.0), return DropdownMenuItem<String>(
child: Column( value: unit,
mainAxisAlignment: MainAxisAlignment.center, child: Text(unit),
children: [ );
TextField( }).toList(),
controller: _controller, onChanged: (String? newValue) {
keyboardType: TextInputType.number, setState(() {
decoration: InputDecoration( _toUnit = newValue!;
labelText: 'Enter Temperature', });
border: OutlineInputBorder(), },
), ),
), ],
SizedBox(height: 16), ),
Row( SizedBox(height: 16),
mainAxisAlignment: MainAxisAlignment.spaceBetween, ElevatedButton(
children: [ onPressed: _convertTemperature,
DropdownButton<String>( child: Text('Convert'),
value: _fromUnit, ),
items: _units.map((String unit) { SizedBox(height: 16),
return DropdownMenuItem<String>( Text(
value: unit, _result,
child: Text(unit), style: TextStyle(fontSize: 20, fontWeight:
); FontWeight.bold),
}).toList(), ),
onChanged: (String? newValue) { ],
setState(() { ),
_fromUnit = newValue!; ),
}); );
}, }
), }

Output:-

Mobile App Development

You might also like