AdvancedSegment<K extends Object, V extends String> constructor

const AdvancedSegment<K extends Object, V extends String>({
  1. Key? key,
  2. required Map<K, V> segments,
  3. ValueNotifier<K>? controller,
  4. TextStyle activeStyle = const TextStyle(fontWeight: FontWeight.w600),
  5. TextStyle? inactiveStyle,
  6. EdgeInsetsGeometry itemPadding = const EdgeInsets.symmetric(horizontal: 15, vertical: 10),
  7. BorderRadius borderRadius = const BorderRadius.all(Radius.circular(8.0)),
  8. Color backgroundColor = const Color(0x42000000),
  9. Color sliderColor = const Color(0xFFFFFFFF),
  10. double sliderOffset = 2.0,
  11. Duration animationDuration = const Duration(milliseconds: 250),
  12. List<BoxShadow>? shadow = const <BoxShadow>[BoxShadow(color: Color(0x42000000), blurRadius: 8.0)],
  13. BoxDecoration? sliderDecoration,
})

Implementation

const AdvancedSegment({
  Key? key,
  required this.segments,
  this.controller,
  this.activeStyle = const TextStyle(
    fontWeight: FontWeight.w600,
  ),
  this.inactiveStyle,
  this.itemPadding = const EdgeInsets.symmetric(
    horizontal: 15,
    vertical: 10,
  ),
  this.borderRadius = const BorderRadius.all(Radius.circular(8.0)),
  this.backgroundColor = const Color(0x42000000),
  this.sliderColor = const Color(0xFFFFFFFF),
  this.sliderOffset = 2.0,
  this.animationDuration = const Duration(milliseconds: 250),
  this.shadow = const <BoxShadow>[
    BoxShadow(
      color: Color(0x42000000),
      blurRadius: 8.0,
    ),
  ],
  this.sliderDecoration,
})  : assert(segments.length > 1, 'Minimum segments amount is 2'),
      super(key: key);