效果图
引入依赖
flutter_seekbar:
git: https://github.com/LiuC520/flutter_seekbar.git
全量demo代码
https://github.com/LiuC520/flutter_seekbar/blob/master/example/lib/main.dart
简化demo效果
简化demo代码
import 'package:flutter/material.dart';
import 'package:flutter_seekbar/flutter_seekbar.dart';
void main() => runApp(Home());
class Home extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _HomeState();
}
}
class _HomeState extends State<Home> with SingleTickerProviderStateMixin {
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Container(
padding: EdgeInsets.fromLTRB(0, 80, 0, 0),
child: Column(
children: <Widget>[
Container(
width: 200,
child: SeekBar(
min: 0,
max: 100,
value: 40,
sectionCount: 10,
)),
],
)),
);
}
}