writeGeneralUtilities method
void
writeGeneralUtilities(
- ObjcOptions generatorOptions,
- Root root,
- Indent indent, {
- required String dartPackageName,
override
Writes any necessary helper utilities to indent
if needed.
This method is not required, and does not need to be overridden.
Implementation
@override
void writeGeneralUtilities(
ObjcOptions generatorOptions,
Root root,
Indent indent, {
required String dartPackageName,
}) {
final bool hasHostApi = root.apis.any((Api api) =>
api.methods.isNotEmpty && api.location == ApiLocation.host);
final bool hasFlutterApi = root.apis.any((Api api) =>
api.methods.isNotEmpty && api.location == ApiLocation.flutter);
if (hasHostApi) {
_writeWrapError(indent);
indent.newln();
}
if (hasFlutterApi) {
_writeCreateConnectionError(indent);
indent.newln();
}
_writeGetNullableObjectAtIndex(indent);
}