computeNumDimensions static method
Returns the number of dimensions of a multi-dimensional array, otherwise 0.
Implementation
static int computeNumDimensions(Object? o) {
if (o == null || o is! List) {
return 0;
}
if (o.isEmpty) {
throw ArgumentError('Array lengths cannot be 0.');
}
return 1 + computeNumDimensions(o.elementAt(0));
}