mirrored_repositories
import 'dart:io';

void main() {
  performTask();
}

void performTask() async {
  task1();
  String task2Data = await task2();
  task3(task2Data);
}

void task1()  {
  String result = 'task 1 data';
  print('Task 1 complete');
}

Future<String> task2() async {
  Duration threeSeconds = Duration(seconds: 3);
  String result;
  // simulating loading of data
  await Future.delayed(threeSeconds, () {
    result = 'task 2 data';
    print('Task 2 complete');
  });
  return result;
}

void task3(String task2Data)  {
  String result = 'task 3 data';
  print('Task 3 complete with $task2Data');
}
