myanmarlinks
6/14/2019 - 1:52 PM

Dart Async and Await

Dart Async and Await

import 'dart:async';

const data = "I'm expansive data";

void getDataA() {
  print("dataA");
}

void getDataB() {
  print("dataB");
}

String getDataC() {
  return "dataC";
}

void printMyData(String data) {
  print(data);
}

main() async {
  await getDataA();
  await getDataB();
  printMyData(await getDataC());
}