Timer constructor

Timer(
  1. Duration duration,
  2. void callback(
      )
    )

    Creates a new timer.

    The callback function is invoked after the given duration.

    Example:

    final timer =
        Timer(const Duration(seconds: 5), () => print('Timer finished'));
    // Outputs after 5 seconds: "Timer finished".
    

    Implementation

    factory Timer