swift<T> function
Creates a SwiftValue with optional type inference.
Usage with automatic inference: swift(0) creates SwiftValue<int>.
Usage with explicit type: swift<int>(0) creates SwiftValue<int>.
Usage for models: swift<MyModel>(myModel) creates SwiftValue<MyModel>.
Example:
final counter = swift(0); // Automatically SwiftValue<int>
final name = swift('Hello'); // Automatically SwiftValue<String>
final user = swift<User>(user); // Explicit type for models
Implementation
SwiftValue<T> swift<T>(T value, {String? name}) => SwiftValue<T>(value, name: name);