connect static method
Establishes a connection to iCloud storage.
On success, returns a singleton instance of ICloudProvider.
This method requires the iCloud containerId
specific to your app.
It will throw an UnsupportedError if called on a non-iOS platform.
Implementation
static Future<ICloudProvider?> connect({required String containerId}) async {
// iCloud is only available on iOS.
if (Platform.isIOS == false && Platform.isMacOS == false) {
debugPrint('iCloud Storage is only available on iOS and.');
throw UnsupportedError(
'iCloud Storage is only available on iOS and MacOs.');
}
_instance ??= ICloudProvider._create(containerId);
return _instance;
}