sa_progress_bar 0.0.3 sa_progress_bar: ^0.0.3 copied to clipboard
A progress bar controller
import 'package:flutter/material.dart';
import 'package:sa_progress_bar/sa_progress_bar.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
double progress = 0.0;
final ProgressController _controller = ProgressController();
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Material(
child: Container(
height: 45,
padding: EdgeInsets.symmetric(horizontal: 45),
child: SaProgressBar(
controller: _controller,
onMoved: (value) {
// progress on moved callback
_controller.moveTo(value);
//print('onMove: $value');
},
onTap: (value) {
// progress on tap callback
_controller.moveTo(value);
print('onTap: $value');
},
),
),
),
);
}
}