writeGeneralUtilities method
void
writeGeneralUtilities(
- DartOptions 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(
DartOptions generatorOptions,
Root root,
Indent indent, {
required String dartPackageName,
}) {
final bool hasHostApi =
root.apis.any((Api api) => api.methods.isNotEmpty && api is AstHostApi);
final bool hasFlutterApi = root.apis
.any((Api api) => api.methods.isNotEmpty && api is AstFlutterApi);
if (hasHostApi) {
_writeCreateConnectionError(indent);
}
if (hasFlutterApi || generatorOptions.testOutPath != null) {
_writeWrapResponse(generatorOptions, root, indent);
}
}