# canConvert abstract method

bool canConvert(

1. Class? sourceType,
2. Class targetType

)

Determines whether objects of `sourceType` can be converted to `targetType`.

This allows frameworks to optimize or validate before performing conversions.

### Example:

    if (conversionService.canConvert<String, DateTime>(Class<String>(), Class<DateTime>())) {
      final date = conversionService.convert<DateTime>('2025-01-01', Class<DateTime>());
    }

## Implementation

    bool canConvert(Class? sourceType, Class targetType);