Completer and Future in dart?

Correct answer has errors in DartPad, the reason could be Dart version.

error : The argument type 'int' can't be assigned to the parameter type 'Duration'.
error : The argument type '(dynamic) → void' can't be assigned to the parameter type '() → void'.

The following snippet is complement

import 'dart:async';

Future<dynamic> someFutureResult(){
   final c = new Completer();
   // complete will be called in 3 seconds by the timer.
   new Timer(Duration(seconds: 3), () {     
       print("Yeah, this line is printed after 3 seconds");
       c.complete("you should see me final");       
   });
   return c.future;

}

main(){
   someFutureResult().then((dynamic result) => print('$result'));
   print("you should see me first");
}

reslut

you should see me first
Yeah, this line is printed after 3 seconds
you should see me final

The Future object that is returned by that method is, in a sense, connected to that completer object, which will complete at some point "in the future". The .complete() method is called on the Completer, which signals the future that it is complete. Here's a more simplified example:

Future<String> someFutureResult(){
   final c = new Completer();
   // complete will be called in 3 seconds by the timer.
   new Timer(3000, (_) => c.complete("you should see me second"));
   return c.future;
}

main(){
   someFutureResult().then((String result) => print('$result'));
   print("you should see me first");
}

Here's a link to a blog post which details other scenarios where futures are helpful