ocHeaderCode static method
Implementation
static String ocHeaderCode(UniAPIOptions options) {
return CodeTemplate(children: [
CommentUniAPI(),
EmptyLine(),
OCImport(fullImportName: 'Foundation/Foundation.h'),
OCImport(fullImportName: 'Flutter/Flutter.h'),
OneLine(body: 'NS_ASSUME_NONNULL_BEGIN'),
EmptyLine(),
OneLine(body: '@protocol ${disposeProtocolName(options)}'),
OneLine(body: '@required'),
OneLine(body: '- (void)disposeCallback:(id)params;'),
OneLine(body: '@end'),
EmptyLine(),
OneLine(body: '@interface ${className(options)} : NSObject'),
OneLine(
body:
'+ (void)init:(NSObject<FlutterBinaryMessenger>* _Nonnull)binaryMessenger;'),
OneLine(
body:
'+ (void)registe:(NSString * _Nonnull)name callback:(id _Nonnull)subscriber;'),
OneLine(body: '@end'),
EmptyLine(),
OneLine(body: 'NS_ASSUME_NONNULL_END'),
]).build();
}