Toggle constructor

Toggle({
  1. Text? text,
  2. List<Text> texts = const [],
  3. List<Block> children = const [],
})

Main toggle constructor.

Can receive a single text or a list of texts. If both are included also both fields are added to the heading content adding first the text field. Also can receive the children of the block.

Implementation

Toggle({
  Text? text,
  List<Text> texts: const [],
  List<Block> children: const [],
}) {
  if (text != null) {
    _content.add(text);
  }
  _content.addAll(texts);
  _children.addAll(children);
}