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,230 points
608 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,440 points

Related Questions In Others

0 votes
1 answer

Is there a way to quickly check what attribute the data is in a cell in a spreadsheet?

Excel will automatically make assumptions about the ...READ MORE

answered Jan 8, 2023 in Others by narikkadan
• 63,420 points
296 views
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 7, 2019 in Others by Frankie
• 9,830 points
4,162 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,440 points
594 views
0 votes
1 answer
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,230 points
891 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,440 points
1,058 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,440 points
1,506 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,440 points
3,031 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,440 points
1,048 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP