Android Flutter
Android Flutter
1. Design Student Registration Form in flutter which takes input like Full Name, Password,
Email, Phone Number, Gender, Address, and Courses Applied For. (Note:
• Courses Applied for (B.C.A, B.Com, B.Sc, B.A.) – Use CheckboxListTile widget. •
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
@override
Widget build(BuildContext context) { return
MaterialApp( title: 'Flutter
Demo', theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Login'),
);
}
}
@override
State<MyHomePage> createState() => _MyHomePageState(); }
@override
Widget build(BuildContext context) {
return Scaffold( appBar:
AppBar(
title: Text(widget.title)
),
1
Moin Khan 405-2MOBILE APPLICATION DEVELOPMENT SPID:2021042078
2
Moin Khan 405-2MOBILE APPLICATION DEVELOPMENT SPID:2021042078
SizedBox(height: 5),
Text("Gender",style: TextStyle(fontSize: 18),),
Row( children:
[
Radio(value: "Male", groupValue: gender, onChanged: (value){
setState(() {
gender=value.toString();
});
}),
Text("Male"),
Radio(value: "Female", groupValue: gender, onChanged: (value){
setState(() {
gender=value.toString();
});
}),
Text("Female"),
Radio(value: "Other", groupValue: gender, onChanged: (value){
setState(() {
gender=value.toString();
});
}),
Text("Other"),
],
),
Row(
children: [ Container(
width: 150,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 5),
Text("Course",style: TextStyle(fontSize: 18),),
CheckboxListTile( title: Text('B.C.A'),
value: bca, onChanged: (value){
setState(() { bca=value!;
});
}),
CheckboxListTile( title:
Text('B.Com'), value: bco, onChanged:
(value){
setState(() { bco=value!;
});
})
],
),
),
3
Moin Khan 405-2MOBILE APPLICATION DEVELOPMENT SPID:2021042078
Container(
width: 150, child:
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 23),
CheckboxListTile( title:
Text('B.Sc'), value: bsc, onChanged:
(value){
setState(() { bsc=value!;
});
}),
CheckboxListTile( title:
Text('B.A.'), value: bba,
onChanged: (value){
setState(() { bba=value!;
});
})
],
),
),
],
),
SizedBox(height: 10,),
Center(
child: ElevatedButton(onPressed: () {
}, child: Text('Submit')),
)
],
),
)
],
),
),
),
);
} }
Output:
4
Moin Khan 405-2MOBILE APPLICATION DEVELOPMENT SPID:2021042078
2. Create flutter application to draw bar chart in flutter based on the following data.
Number of Students 60 50 80 55 90
Passed
ANS:-
import 'package:flutter/material.dart'; import
'package:syncfusion_flutter_charts/charts.dart';
5
Moin Khan 405-2MOBILE APPLICATION DEVELOPMENT SPID:2021042078
@override
_MyHomePageState createState() => _MyHomePageState();
}
@override void
initState() { data
=[
_ChartData('Science', 60),
_ChartData('English', 50),
_ChartData('History', 80),
_ChartData('Maths', 55),
_ChartData('Music', 90)
];
_tooltip = TooltipBehavior(enable: true); super.initState();
}
6
Moin Khan 405-2MOBILE APPLICATION DEVELOPMENT SPID:2021042078
@override
Widget build(BuildContext context) {
return Scaffold( appBar: AppBar(
title: const Text('Charts'),
),
body: Padding(
padding: const EdgeInsets.all(12),
child: SfCartesianChart(
backgroundColor: Colors.grey.shade100,
primaryXAxis: CategoryAxis(),
primaryYAxis: NumericAxis(minimum: 0, maximum: 95, interval: 5),
tooltipBehavior: _tooltip,
series: <ChartSeries<_ChartData, String>>[
ColumnSeries<_ChartData, String>( dataSource: data,
xValueMapper: (_ChartData data, _) => data.x,
yValueMapper: (_ChartData data, _) => data.y, color:
Colors.black,
),
]),
));
}
}
class _ChartData {
_ChartData(this.x, this.y);
final String x;
final double y;
}
7
Moin Khan 405-2MOBILE APPLICATION DEVELOPMENT SPID:2021042078
OUTPUT:-
ANS:-
import 'dart:io';
8
Moin Khan 405-2MOBILE APPLICATION DEVELOPMENT SPID:2021042078
@override
Widget build(BuildContext context) {
return MaterialApp( title: 'Flutter Demo',
theme: ThemeData( primarySwatch:
Colors.green,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
@override
State<MyHomePage> createState() => _MyHomePageState();
}
9
Moin Khan 405-2MOBILE APPLICATION DEVELOPMENT SPID:2021042078
@override
Widget build(BuildContext context) {
return Scaffold( appBar: AppBar(
title: Text('Login'),
),
body: Stack(
children: [
Container( height: double.infinity, width: double.infinity,
decoration:
BoxDecoration(image: DecorationImage(image: AssetImage('assets/back.jpg'),fit: BoxFit.fill)),
),
Center(
child: Container(height: 400,
width: 300,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),boxShadow: [
BoxShadow(color: Colors.transparent.withOpacity(0.7),blurRadius: 10)
]
), child:
Padding(
padding: const
EdgeInsets.only(left:
25,right: 25),
child: Column(children: [
SizedBox(height: 60),
10
Moin Khan 405-2MOBILE APPLICATION DEVELOPMENT SPID:2021042078
11
Moin Khan 405-2MOBILE APPLICATION DEVELOPMENT SPID:2021042078
),
TextButton(
child: const Text("No"),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
},
);
}, child: Text('Exit'),),
),
]),
),
),
)
],
)
);
}
}
OUTPUT:-
12
Moin Khan 405-2MOBILE APPLICATION DEVELOPMENT SPID:2021042078
@override
13
Moin Khan 405-2MOBILE APPLICATION DEVELOPMENT SPID:2021042078
@override
State<MyHomePage> createState() => _MyHomePageState();
}
14
Moin Khan 405-2MOBILE APPLICATION DEVELOPMENT SPID:2021042078
15
Moin Khan 405-2MOBILE APPLICATION DEVELOPMENT SPID:2021042078
Row( children:
[
Text('QUALIFICATION: ',style: TextStyle(fontSize: 17,fontWeight:
FontWeight.bold),),
Text('B.C.A',style: TextStyle(fontSize: 17),)
],
),
SizedBox(height: 4),
Text('ABOUT:',style: TextStyle(fontSize: 16,fontWeight: FontWeight.bold)),
Text('We are looking out for a Flutter Developer who will be running anddesigning
product application features across various cross platform devices. Just like Lego boxes that fit on top of
one another, we are looking out for someone who has experience using Flutter widgets that can be
plugged together, customized and deployed anywhere. Someone who is passionate about code writing,
solving technical errors and taking up full ownership of app development.',style: TextStyle(fontSize:
14),),
SizedBox(height: 4),
Text('GOAL:',style: TextStyle(fontSize: 16,fontWeight: FontWeight.bold)),
Text('Flutter offers a common code that works on both iOS and Android . There are no
restrictions; you can practically realise anything imaginable.',style: TextStyle(fontSize: 14),),
Text('Finally, some say that Flutter is so simple to comprehend that it’s not even necessary to have solid
developing knowledge in order to handle it.',style: TextStyle(fontSize: 14),),
Text('A wide range of material components are available: Material Design is a visual
language proposed by Google for mobile first applications with a ‘Flat Design’ approach.',style:
TextStyle(fontSize: 14),),
Text('NEEDS:',style: TextStyle(fontSize: 16,fontWeight: FontWeight.bold),),
Text('As a popular framework for mobile app development, Flutter offers faster
development, exceptional performance, and cost-effectiveness. It makes use of widgets for reusability
across applications. This reduces the entire coding time and go-to-market time for apps. It has its own
rendering engine with a similar user interface for all platforms. There are enriched libraries for enhanced
performance.',style: TextStyle(fontSize: 14),),
Text('SKILLS:',style: TextStyle(fontSize: 16,fontWeight: FontWeight.bold),),
Text('In depth understanding of front end languages like HTML, CSS3 and JavaScript. In
depth understanding of Object Oriented programming languages like Java and C++. Familiarity using
version control tools like Git, Subversion etc.',style: TextStyle(fontSize: 14),),
Text('CONTACT',style: TextStyle(fontSize: 16,fontWeight: FontWeight.bold),),
Text('+91 8000000000',style: TextStyle(fontSize: 14),),
SizedBox(height: 20,),
16
Moin Khan 405-2MOBILE APPLICATION DEVELOPMENT SPID:2021042078
],
)
),
],
),
),
)
);
}
}
OUTPUT:-
17
Moin Khan 405-2MOBILE APPLICATION DEVELOPMENT SPID:2021042078
18