preferredSize property

  1. @override
Size preferredSize
override

Standard overridden method of PreferredSizeWidget.

return Size of this widget with:

  • height = toolbarHeight + bottom.height
  • width = toolbarWidth

Note: if isSpeechMode == true - it will add subBarHeight pixels to height .

Implementation

@override
Size get preferredSize {
  final subBarHeight = isSpeechMode.value ? speechSubBarHeight : 0;

  return Size(
      toolbarWidth,
      (toolbarHeight ?? kToolbarHeight) +
          (bottom?.preferredSize.height ?? 0) +
          subBarHeight);
}