build method
Implementation
String? build() {
if (providers.isEmpty && commands.isEmpty) return null;
final allVars = providers.map((p) => p.providerVarName).toSet().toList();
final enriched = providers
.map(
(p) => ProviderInfo(
name: p.name,
dataType: p.dataType,
isKeepAlive: p.isKeepAlive,
type: p.type,
params: p.params,
commands: p.commands,
isFunctional: p.isFunctional,
functionName: p.functionName,
requiresRef: p.requiresRef,
isSettable: p.isSettable,
hasPagedMapper: p.hasPagedMapper,
allProviderVarNames: allVars,
publicMethods: p.publicMethods,
),
)
.toList();
return """
${enriched.map((provider) => provider.build()).join('\n')}
${commands.map((command) => command.build()).join('\n')}
""";
}