# convertTo<T> abstract method

Object? convertTo<T>(

1. Object? source,
2. Class targetType, [
3. Class? sourceType

])

Converts the `source` object from a known `sourceType` to a `targetType` using full type metadata via Class.

This method provides the most powerful form of type conversion and supports deep, generic-aware resolution.

### Example:

    final source = {'date': '2025-07-01'};

    final targetType = Class.mapOf(Class<String>(), Class<DateTime>());
    final result = service.convertTo(source, Class.forObject(source), targetType);

## Implementation

    Object? convertTo<T>(Object? source, Class targetType, [Class? sourceType]);