StackToCollectionGenericConverter constructor

StackToCollectionGenericConverter(
  1. ConversionService cs
)

A converter that transforms a Stack to a specific collection subtype.

Supported conversions:

  • StackStack
  • StackQueue
  • StackList
  • StackSet
  • StackIterable
  • StackLinkedQueue
  • StackLinkedStack
  • Stackcol.LinkedHashSet
  • Stackcol.ListBase
  • Stackcol.SetBase
  • Stackcol.Queue

Example:

final converter = StackToCollectionConverter();
print(converter.convert(Stack.from([1, 2, 3]), Class.forType(Stack), Class<List>(null, PackageNames.DART))); // prints: [1, 2, 3]

Implementation

StackToCollectionGenericConverter(ConversionService cs) : super(cs, Class<Stack>(null, PackageNames.LANG));