flush static method

Future<bool> flush(
  1. int timeoutMs
)

Drain the offline queue now, blocking (natively) up to timeoutMs. Returns whether nothing was left pending.

Implementation

static Future<bool> flush(int timeoutMs) async {
  try {
    return await _channel.invokeMethod<bool>('flush', {
          'timeoutMs': timeoutMs,
        }) ??
        false;
  } on PlatformException catch (e) {
    if (kDebugMode) {
      debugPrint(
        "Smart Grow Logs ✉️: PlatformException during flush: ${e.message}",
      );
    }
    return false;
  }
}