count

int count(

  1. JSAny? children
)

Returns the total number of children.

Empty nodes (null, undefined, and Booleans), strings, numbers, and React elements count as individual nodes. Arrays don't count as individual nodes, but their children do.

Example:

final childCount = Children.count(props['children']);

Implementation

static int count(JSAny? children) => _childrenCount(children);