- Beautiful Number Animations
- Customizable Duration
- Seamless Integration
- Supports Any Number Range
dependencies: number_rolling_widget: ^1.0.0
import 'package:flutter/material.dart';
import 'package:number_rolling_widget/number_rolling_widget.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Number Rolling Widget Example'),
),
body: Center(
child: NumberRollingWidgetExample(),
),
),
);
}
}
class NumberRollingWidgetExample extends StatefulWidget {
@override
_NumberRollingWidgetExampleState createState() => _NumberRollingWidgetExampleState();
}
class _NumberRollingWidgetExampleState extends State<NumberRollingWidgetExample> {
int _targetValue = 123;
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Target Value: $_targetValue',
style: TextStyle(fontSize: 20),
),
SizedBox(height: 20),
NumberRollingWidget(endValue: _targetValue),
SizedBox(height: 20),
ElevatedButton(
onPressed: () {
setState(() {
_targetValue += 100; // Change the target value for demonstration
});
},
child: Text('Change Target Value'),
),
],
);
}
}
additional_information:
usage_guidelines: |
To use the NumberRollingWidget, simply add it to your widget tree and provide
the endValue property. You can customize the animation duration, and the widget
will smoothly transition to the specified number.
contributing_guidelines: | Contributions are welcome! If you have any issues or feature requests, please open an issue on GitHub. Pull requests are also appreciated.
license: MIT