toTypedList2<T> function
PIComposer APIPIComposer API

toTypedList2<T>#

Option<List<List<T>>> toTypedList2<T>(dynamic value)

Converts a dynamic value to a typed 2-dimensional list of T, if possible.

Returns Some(List<List<T>>) if the value is a 2D list where all elements are of type T, or None if the conversion fails.

Example:

final result = toTypedList2<int>([[1, 2], [3, 4]]); // Some([[1, 2], [3, 4]])