flutter_advanced_segment
An advanced segment widget, that can be fully customized with bunch of properties, just try it and enjoy!

Examples
Regular Segment
final _controller = AdvancedSegmentController('all');
AdvancedSegment(
controller: _controller,
segments: {
'all': 'All',
'starred': 'Starred',
},
),
Customized Segment
final _controller = AdvancedSegmentController('all');
AdvancedSegment(
controller: _controller,
segments: {
'all': 'All',
'primary': 'Primary',
'secondary': 'Secondary',
'tertiary': 'Tertiary',
},
activeStyle: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w600,
),
inactiveStyle: TextStyle(
color: Colors.white54,
),
backgroundColor: Colors.black26,
sliderColor: Colors.white,
sliderOffset: 2.0,
borderRadius: const BorderRadius.all(Radius.circular(8.0)),
itemPadding: const EdgeInsets.symmetric(
horizontal: 15,
vertical: 10,
),
animationDuration: Duration(milliseconds: 250),
sliderShadow: const <BoxShadow>[
BoxShadow(
color: Colors.black26,
blurRadius: 8.0,
),
],
),
AdvancedSegment Parameters
Parameter |
Description |
Type |
Default |
controller |
Manage AdvancedSegment state |
AdvancedSegmentController |
|
segments |
Map of presented segments |
Map<String, String> |
required |
activeStyle |
|
TextStyle |
fontWeight: FontWeight.w600 |
inactiveStyle |
|
TextStyle |
|
backgroundColor |
|
Color |
Colors.black26 |
sliderColor |
|
Color |
Colors.white |
sliderOffset |
|
double |
2.0 |
borderRadius |
|
BorderRadius |
Radius.circular(8.0) |
itemPadding |
|
EdgeInsets |
EdgeInsets.symmetric(h: 15, v: 10) |
animationDuration |
|
Duration |
Duration(milliseconds: 250) |
sliderShadow |
|
BoxShadow |
Shadow |
Demo
