initialize method

Future<Lyra> initialize({
  1. required String publicKey,
  2. required LyraInitializeOptions options,
})

initialize function used to create an instance of Lyra

on Android, this function can throw an uncatchable error Be sure to give the correct publicKey and options (It won't throw any errors if you are not connected to internet)

Implementation

// TODO: catch the errors on Android
Future<Lyra> initialize({
  required String publicKey,
  required LyraInitializeOptions options,
}) async {
  final lyraKeyInterface = await _platform.initialize(
    publicKey: publicKey,
    options: LyraInitializeOptionsConverter.toInterface(options),
  );

  return Lyra(
    publicKey: lyraKeyInterface.publicKey,
    options: LyraInitializeOptionsConverter.fromInterface(
      lyraKeyInterface.options,
    ),
  );
}