Reputation: 125
I want to make my switch look like this:
But i haven't found a way to increase the size of track. Is there any?
Upvotes: 1
Views: 1970
Reputation: 63649
To increase the height of track we have to use constraints
and FittedBox
.
check this
Container(
// color: Colors.cyanAccent,
constraints: BoxConstraints(
minHeight: 170,
maxHeight: 170,
minWidth: 200,
maxWidth: 200,
),
child: FittedBox(
child: CupertinoSwitch(
value: _on,
onChanged: (value) {
setState(() {
_on = value;
});
print(value);
},
),
),
),
Upvotes: 1
Reputation: 41
It looks like you want to use a CupertinoSwitch.
Cupertino switches are the iOS style switches where the track is larger than the node.
Upvotes: 1