What is a future data type in Flutter

0 votes

Hi Guys,

I am new in Flutter. I want to create one asynchronous function using future data types in Flutter. How can I do that?

Aug 11, 2020 in Others by akhtar
• 38,170 points
185 views

1 answer to this question.

0 votes

Hi@akhtar,

Future is a type that ‘comes from the future’ and returns a value from your asynchronous function. It can complete with success or with an error. You can also see the below-given example.

void main() async {
  await waitForMe();
  print('I was waiting here :)');
}Future waitForMe() async {
  print('Started.');
  return Future.delayed(Duration(seconds: 5), () {
    print("Now I'm done!");
  });
}
answered Aug 11, 2020 by MD
• 95,180 points

Related Questions In Others

0 votes
1 answer

What is a name function in JavaScript & how to define it?

A named function declares a name as ...READ MORE

answered Mar 6, 2019 in Others by Frankie
• 9,810 points
234 views
0 votes
1 answer

What is Material Design in Flutter?

Hi@akhtar, Material is a design system created by ...READ MORE

answered Jul 23, 2020 in Others by MD
• 95,180 points
113 views
0 votes
1 answer

What sort of testing is involved in functional testing?

The following types of testing are involved ...READ MORE

answered Feb 18, 2019 in Others by Jobin
129 views
0 votes
1 answer

What is BASH in linux?

BASH is short term for Bourne Again ...READ MORE

answered Mar 8, 2019 in Others by Tushar
123 views
0 votes
1 answer

What is the future of flutter?

Hi@MD, Flutter is a rather new cross-platform framework ...READ MORE

answered Jul 17, 2020 in Others by akhtar
• 38,170 points
162 views
0 votes
1 answer

What is Flutter?

Hi@akhtar, Flutter is an app SDK for building ...READ MORE

answered Jul 17, 2020 in Others by MD
• 95,180 points
255 views
0 votes
1 answer

How to install Flutter in Windows system?

Hi@akhtar, You can follow the below-given steps to ...READ MORE

answered Jul 17, 2020 in Others by MD
• 95,180 points
435 views
0 votes
1 answer

What is pubspec.yaml file in Flutter?

Hi@akhtar, It is the project's configuration file that ...READ MORE

answered Jul 20, 2020 in Others by MD
• 95,180 points
850 views
0 votes
1 answer

What is Hot Reload in Flutter?

Hi@akhtar, The hot reload feature allows you to ...READ MORE

answered Jul 20, 2020 in Others by MD
• 95,180 points
214 views