Final - Ans
Final - Ans
Q1 Choose the correct answer or answers from the answer below each question? (10 Marks)
1. What is sqflite?
a. A programming language
b. A database management system
c. A library for SQLite database in Flutter
d. A mobile application framework
a. It is a NoSQL database
b. It is platform-dependent and works only on Android
c. It allows developers to perform CRUD operations on a local SQLite database
d. It is primarily used for server-side database management
a. Child
b. OnPressed
c. Both A & B
d. None of above
a. State-management Widget
b. Platform-specific Widget
c. Layout Widget
d. None of above
7. Which constructor class are used for give padding on both side (left and right)?
a. EdgeInsets ()
b. EdgeInsets.all ()
c. EdgeInsets.only()
d. EdgeInsets.symmentric()
a. background Color
b. body
c. resizeToAvoidBottomInset
d. All of above
a. Arithmetic
b. Type-test
c. Equality
d. I/O(input/output)
10. Which of the following operations can you perform using sqflite?
1. Text Field widget allows app users to type text into an app.
a. True
b. False
2. Adding a Slider widget in a Flutter app interface should be used to select multiple
values at the same time.
a. True
b. False
The Slider widget in Flutter is typically used to allow users to select a single value
within a range by dragging a thumb along a track. It is not designed to select
multiple values simultaneously.
3. The Container is a Flutter widget that allows you to customize, compose, decorate
and position its child widget.
a. True
b. False
a. True
b. False
In Flutter, the AlertDialog widget is used to display a modal dialog window that
interrupts the user's interaction with the app.
5. When you want to create a Flutter app, you need to configure a lot of widgets and
change their format. You don't need to create everything from scratch. You can
easily add the Scaffold class or widget to your app. This class implements the
basic material design visual layout structure for your app.
a. True
b. False
6. If you want to create a Flutter app using a Mac computer, you need to install
Android Studio or another IDE software and another prerequisite software Flutter
SDK. However, you can test your Flutter apps using IPhone emulator only.
a. True
b. False
While it's true that you need to install Android Studio or another IDE and Flutter
SDK to develop Flutter apps on a Mac computer, you are not limited to testing
your Flutter apps using only an iPhone emulator. Flutter allows you to test your
apps on both Android and iOS
7. If you install the Flutter SDK on your computer and configure it as a plug-in for
Android Studio or another IDE software, Android Studio will be able to create
Flutter apps.
a. True
b. False
8. Flutter widgets are the basic building blocks of a Flutter user interface. Almost
everything in Flutter app is a widget such as images, icons, texts, menus, buttons,
row, column etc.
a. True
b. False
9. In Flutter development, you can add three rows inside a column and add an image
within each row.
a. True
b. False
10. Flutter apps are compiled directly to native code for optimal performance
a. True
b. False
Q3What the output this program? (5 Marks)
void main () {
print (factorial (6));
}
factorial(number) {
if (number <= 0) {
return 1;
} else {
return (number * factorial (number - 1));
}
}
output
720
Q4What the output this program? (5 Marks)
class Student {
String name;
int age;
output
// ignore_for_file: prefer_const_constructors
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
backgroundColor: Colors.purple,
body: SafeArea(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
CircleAvatar(
radius: 50.0,
backgroundImage: AssetImage('Images/yourProfilePhoto.jpg'),
),
Text(
"AmirHossein Bayat",
style: TextStyle(
fontSize: 28.0,
color: Colors.white,
fontFamily: 'Pacifico',
fontWeight: FontWeight.bold),
),
Text(
"iOS & Android Developer",
style: TextStyle(
fontSize: 18.0,
color: Colors.white,
fontFamily: 'SourceSansPro',
letterSpacing: 2.5,
fontWeight: FontWeight.normal,
),
),
SizedBox(
height: 19.0,
width: 160.0,
child: Divider(
color: Colors.white,
),
),
Card(
color: Colors.white,
margin: EdgeInsets.symmetric(vertical: 12.0, horizontal: 20.0),
child: Padding(
padding: EdgeInsets.all(15.0),
child: Row(
children: const [
Icon(
Icons.phone,
color: Colors.purple,
),
SizedBox(
width: 20.0,
),
Text(
'+98 922 505 8169',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20.0,
color: Colors.deepPurple),
),
],
),
),
),
Card(
color: Colors.white,
margin: EdgeInsets.symmetric(vertical: 0.0, horizontal: 20.0),
child: Padding(
padding: EdgeInsets.all(15.0),
child: Row(
// ignore: prefer_const_literals_to_create_immutables
children: [
Icon(
Icons.email,
color: Colors.purple,
),
SizedBox(width: 20.0),
Text(
'[email protected]',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18.0,
color: Colors.deepPurple),
),
],
),
),
),Card(
color: Colors.white,
margin: EdgeInsets.symmetric(vertical: 12.0, horizontal: 20.0),
child: Padding(
padding: EdgeInsets.all(15.0),
child: Row(
// ignore: prefer_const_literals_to_create_immutables
children: [
Icon(
Icons.account_circle_rounded,
color: Colors.purple,
),
SizedBox(width: 20.0),
Text(
'@CodeWithflexz',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18.0,
color: Colors.deepPurple),
),
],
),
),
)
],
),
),
),
);
}
}
good luck
Nesrin alshagi