RollingSwitch.icon constructor
const
RollingSwitch.icon({
- Key? key,
- required dynamic onChanged(),
- RollingIconInfo rollingInfoRight = const RollingIconInfo(icon: Icons.flag),
- RollingIconInfo rollingInfoLeft = const RollingIconInfo(icon: Icons.check, backgroundColor: Colors.grey),
- bool initialState = false,
- double width = 130,
- double height = 50,
- double innerSize = 40,
- Color circularColor = Colors.white,
- bool enableDrag = false,
- Duration animationDuration = const Duration(milliseconds: 400),
- Function? onTap,
Implementation
const RollingSwitch.icon({
Key? key,
required this.onChanged,
RollingIconInfo rollingInfoRight = const RollingIconInfo(
icon: Icons.flag,
),
RollingIconInfo rollingInfoLeft = const RollingIconInfo(
icon: Icons.check,
backgroundColor: Colors.grey,
),
this.initialState = false,
this.width = 130,
this.height = 50,
this.innerSize = 40,
this.circularColor = Colors.white,
this.enableDrag = false,
this.animationDuration = const Duration(milliseconds: 400),
this.onTap,
}) : assert(height >= 50.0 && innerSize >= 40.0),
rollingInfoLeft = rollingInfoLeft,
rollingInfoRight = rollingInfoRight,
super(key: key);