Quiero hacer un interruptor deslizante como este.
y también lo hice a través de CupertinoSlidingSegmentedControl()
pero no cumple con mis requisitos. Me gustaría un interruptor deslizante similar.
he hecho así.
Neumorphic( style: NeumorphicStyle( depth: NeumorphicTheme.embossDepth(context), boxShape: const NeumorphicBoxShape.stadium(), intensity: 1), child: ToggleSwitch( minWidth: 120.0, minHeight: 70, cornerRadius: 50.0, activeBgColors: const [ [Colors.cyan], [Colors.cyan] ], inactiveBgColor: Colors.grey[200], inactiveFgColor: Colors.grey, totalSwitches: 2, labels: ['Agency', 'Freelancer'], radiusStyle: true, onToggle: (index) {}, ), ),
puede usar este paquete toggle_switch: ^ 1.4.0 y crearlo así
SizedBox( height: 40, child: ToggleSwitch( minWidth: 90.0, cornerRadius: 20.0, activeBgColors: [const [Colors.cyan],const [Colors.cyan]], activeFgColor: Colors.white, inactiveBgColor: Colors.grey, inactiveFgColor: Colors.white, initialLabelIndex: 1, totalSwitches: 2, labels: ['Agency', 'Freelancer'], radiusStyle: true, onToggle: (index) { print('switched to: $index'); }, ), ),