sync method

Future<Null> sync({
  1. bool force = false,
})
override

Sync the local-database on this phone with a remote-database You can sync the database forcefully by using force=true option. NOTE: You need to set a method channel before using this method.

Implementation

Future<Null> sync({bool force = false}) async {
  if (_channel == null) {
    print("Please set a method channel before use the start method.");
    return null;
  }
  try {
    await _channel?.invokeMethod('sync', {"force": force});
  } on PlatformException catch (e) {
    print(e.message);
  }
}