ConditionalOnAsset constructor

const ConditionalOnAsset(
  1. String asset
)

The ConditionalOnAsset annotation in Jetleaf allows developers to conditionally process a class or method based on the presence of an asset.

This annotation uses OnAssetCondition to check whether a specified asset is available in the application's resources. If the asset exists, the annotated element is processed.

Usage Example:

@ConditionalOnAsset('config/app_config.json')
class AppConfigPod {
  // This pod will only be loaded if 'config/app_config.json' exists
}

Implementation

const ConditionalOnAsset(this.asset);