initialize method

  1. @override
Future<bool?> initialize({
  1. required bool firstTime,
})
override

Initializes the platform implementation.

This method should be called once to set up the native implementation. The firstTime parameter indicates whether this is the first time the plugin is being initialized in the current app session.

Returns a Future that completes with a boolean indicating success, or null if the operation is not applicable.

Implementation

@override
Future<bool?> initialize({required bool firstTime}) {
  try {
    return methodChannel.invokeMethod<bool>('initialize', {
      'firstTime': firstTime,
    });
  } catch (e) {
    throw PlatformException(
      code: 'INITIALIZATION_FAILED',
      message: 'Failed to initialize cupertino interactive keyboard',
      details: e.toString(),
    );
  }
}