class _MyHomePageState extends State<MyHomePage> {
final RoundedLoadingButtonController _btnController = new RoundedLoadingButtonController();
void _doSomething() async {
Timer(Duration(seconds: 3), () {
_btnController.success();
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RoundedLoadingButton(
child: Text('Tap me!', style: TextStyle(color: Colors.white)),
controller: _btnController,
onPressed: _doSomething,
)
],
),
)
);
}
}
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.