A PHP Error was encountered
Severity: Notice
Message: Undefined index: userid
Filename: views/question.php
Line Number: 195
Backtrace:
File: /home/u125378470/domains/lawhelpguru.org/public_html/application/views/question.php
Line: 195
Function: _error_handler
File: /home/u125378470/domains/lawhelpguru.org/public_html/application/controllers/Questions.php
Line: 416
Function: view
File: /home/u125378470/domains/lawhelpguru.org/public_html/index.php
Line: 315
Function: require_once
Flutter Interview Questions and Answers
Question 1
Given the following class:
class Recipe {
int cows;
int trampolines;
Recipe(this.cows, this.trampolines);
int makeMilkshake() {
return cows + trampolines;
}
}
Convert makeMilkshake()
to a getter called milkshake
using the shorthand “fat arrow” syntax.
Question 2
Given the following widget:
class MyWidget extends StatelessWidget {
final personNextToMe = 'That reminds me about the time when I was ten and our neighbor, her name was Mrs. Mable, and she said...';
@override
Widget build(BuildContext context) {
return Row(children: [
Icon(Icons.airline_seat_legroom_reduced),
Text(personNextToMe),
Icon(Icons.airline_seat_legroom_reduced),
]);
}
}
There is a text overflow on some narrow devices:
How would you fix this?
Question 3
Refactor the code below so that the children of Row
will wrap to the next line when the display width is too narrow for them to fit.
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Row(children: [
Chip(label: Text('I')),
Chip(label: Text('really')),
Chip(label: Text('really')),
Chip(label: Text('really')),
Chip(label: Text('really')),
Chip(label: Text('really')),
Chip(label: Text('really')),
Chip(label: Text('need')),
Chip(label: Text('a')),
Chip(label: Text('job')),
]);
}
}
Question 4
You’ve declared list1
with var
, list2
with final
and list3
with const
. What’s the difference between these keywords? Will the last two lines compile?
var list1 = ['I', '