donut_thumb_shape 0.1.0
donut_thumb_shape: ^0.1.0 copied to clipboard
Flutter Widget of Donut Shape to be used with SliderTheme to create donut style for thumb in any color or size.
import 'package:flutter/material.dart';
import 'package:donut_thumb_shape/donut_thumb_shape.dart';
class Example extends StatefulWidget {
@override
_ExampleState createState() => _ExampleState();
}
class _ExampleState extends State<Example> {
@override
Widget build(BuildContext context) {
return SliderTheme(
data: SliderThemeData(
overlayColor: Colors.transparent,
thumbColor: Colors.white,
activeTrackColor: Color.fromRGBO(102, 0, 78, 1),
inactiveTrackColor: Colors.white,
tickMarkShape: SliderTickMarkShape.noTickMark,
thumbShape: DonutThumbShape(
insideCircleRadius: 6,
outsideCircleRadius: 8,
outsideCircleColor: Colors.white,
insideCircleColor: Color.fromRGBO(102, 0, 78, 1))),
child: Slider(
onChanged: (v) { },
value: 2,
min: 0,
max: 10,
),
);
}
}
Output
![]()
Other example
![]()