You can achieve such design using this packages:
This usage is from their readme
import 'package:custom_switch_button/custom_switch_button.dart';
bool isChecked = false;
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Custom Switch Button example app'),
),
body: GestureDetector(
onTap: () {
setState(() {
isChecked = !isChecked;
});
},
child: Center(
child: CustomSwitchButton(
backgroundColor: Colors.blueGrey,
unCheckedColor: Colors.white,
animationDuration: Duration(milliseconds: 400),
checkedColor: Colors.lightGreen,
checked: isChecked,
),
),
),
),
);
Final result: