Flutter Test (15 Questions) : Theory
Flutter Test (15 Questions) : Theory
Theory
Let’s Fill the Code!
Fill & Draw to Code!
Theory
1. Flutter is based on? (2.5 Point)
a) JavaScript
b) Dart
c) C++
d) Python
2. What is the difference between StatefulWidget and StatelessWidget? (2.5 Point)
a) StatelessWidget is for complex UI, in other hands StatefulWidget is not
recommended for complex UI
b) StatefulWidget have their state created only once — therefore, the build method is
called only once as well. StatelessWidget have their state explicitly created, and it
can be modified during the lifetime of the widget.
c) StatelessWidget have their state created only once — therefore, the build method is
called only once as well. StatefulWidget have their state explicitly created, and it can
be modified during the lifetime of the widget.
d) None of them
3. What is NOT State Management in Flutter (2.5 Point)
a) BLoC
b) Redux
c) Retrofit
d) GetX
4. Is possible to nest a Scaffold on Flutter? (2.5 Point)
a) Yes
b) No
5. What is NOT part of the Flutter widget (2.5 Point)
a) SliverAppBar()
b) TextButton()
c) Button()
d) AnimatedContainer()
6. There is a text overflow below, choose the right widget to fill the blank space and then
the issue will be fixed. (Min 1 Answer). (2.5 Point)
Flex
Flexible
Wrap
Expanded
String giveMeCheeseBurger() {
return bun+cheese+meat;
}
}
8. Please add constructor to Serializing a JSON from API inside model class (Recipes.dart)
with Null-Aware Operator (5 Point)
Answer:
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
void main() {
int? couldBeNullButIsnt = 1;
List<int?> listThatCouldHoldNulls = [2, null, 4];
int a = couldBeNullButIsnt;
int b = listThatCouldHoldNulls.first;
int c = couldReturnNullButDoesnt().abs();
print('a is $a.');
print('b is $b.');
print('c is $c.');
}
Answer:
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
Let’s Fill the Code!
Question 10 - (14 Answers) – (15 Point)
child: _______________(
mainAxisAlignment: _______________,
children: chars. _______________((_______________) => Container(
padding: EdgeInsets. _______________(_______________),
decoration: _______________(
color: Colors.red,
borderRadius: BorderRadius. ____________(________)),
child: Text(
_______________._______________,
style: _______________,
),
)). _______________,
),
),
);
}
Question 11 - (17 Answers) - (15 Point)
@override
Widget build(BuildContext context) {
return Scaffold(
body: _______________.builder(
itemCount: _______________,
_______________: (_______________) => Container(
decoration: _______________ (
gradient: _______________ (
begin: _______________,
end: _______________,
colors: _______________,
),
),
margin: EdgeInsets. _______________ (bottom: _______________),
padding: EdgeInsets. _______________ (_______________),
child: Center(
child: Text(
_______________._______________,
style: _______________,
),
),
),
),
);
}
Question 12 - (11 Answers) - (10 Point)
@override
Widget build(BuildContext context) {
return Scaffold(
bottomNavigationBar: _______________(
_______________: (index) => toDo(),
_______________ : Colors.red,
_______________ : Colors.grey,
items: navbarItems
.___________(
(_______________) => _________________(
icon: Icon(_______________),
label: _______________,
),
)._______________,
),
);
}
Fill & Draw from the Codes! – 13,14 and 15 – (25 Point)
Fill the blank space and then DRAW the result of the code below.
Question 13
var number = [12, 30, 56, 20, 45, 23];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Fizz Buzz'),
),
body: Center(
child: Column(
children: number._____(
(_____) => _____ % 3 == 0 && _____ % 5 == 0
? Text('FizzBuzz')
: _____ % 3 == 0
? Text('Fizz')
: _____ % 5 == 0
? Text("Buzz")
: Text('$_____'),
).______,
),
),
);
}
DRAW:
Question 14
DRAW:
Question 15
DRAW: