Dart Tutorials

Dart List cast()
Syntax & Examples

Syntax of List.cast()

The syntax of List.cast() method is:

 List<R> cast<R>() 

This cast() method of List returns a view of this list as a list of R instances.

Parameters

ParameterOptional/RequiredDescription
Rrequiredthe type to cast the elements of the list to

Return Type

List.cast() returns value of type List<R>.