LabelTheme constructor

const LabelTheme({
  1. TextStyle textStyle = const TextStyle(fontSize: 12.0),
  2. Color? backgroundColor,
  3. BoxBorder? border,
  4. BorderRadius borderRadius = const BorderRadius.all(Radius.circular(4.0)),
  5. EdgeInsets padding = const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
  6. double maxWidth = double.infinity,
  7. int? maxLines,
  8. double offset = 0.0,
  9. double labelGap = 8.0,
})

Creates a label theme with the specified styling properties.

Parameters:

  • textStyle: The text style for the label text
  • backgroundColor: Background color of the label container
  • border: Border decoration (use Border.all() for simple borders)
  • borderRadius: Border radius for rounded corners
  • padding: Padding inside the label container
  • maxWidth: Maximum width before text wraps (default: infinite, no wrapping)
  • maxLines: Maximum number of lines (default: null, unlimited)
  • offset: Default perpendicular offset from the connection path
  • labelGap: Minimum gap from endpoints when anchor is 0.0 or 1.0 (default: 8.0)

Implementation

const LabelTheme({
  this.textStyle = const TextStyle(fontSize: 12.0),
  this.backgroundColor,
  this.border,
  this.borderRadius = const BorderRadius.all(Radius.circular(4.0)),
  this.padding = const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
  this.maxWidth = double.infinity,
  this.maxLines,
  this.offset = 0.0,
  this.labelGap = 8.0,
});