number_animation 0.1.2 number_animation: ^0.1.2 copied to clipboard
A simple and easy to use widget to help you show numbers by animation.
number_animation #
A simple and easy to use widget to help you show numbers by animation.
Add dependency #
dependencies:
number_animation: ^0.1.2
Super simple to use #
import 'package:flutter/material.dart';
import 'package:number_animation/number_animation.dart';
...
@override
Widget build(BuildContext context) {
return NumberAnimation(end: 100);
}
Fields API #
param | description | type | default value |
---|---|---|---|
start | start number | num | 0.0 |
end | end nunber | String | null |
isInt | true for int, false for double | String | false |
duration | animation duration | String | const Duration(milliseconds: 1000) |
style | TextStyle | String | null |
textAlign | TextAlign | String | null |
strutStyle | StrutStyle | String | null |
before | number prefix | String | '' |
after | number suffix | String | '' |
decimalPoint | decimal point, enable when 'isInt = false' | int | 2 |
isLoading | is on loading | String | false |
loadingPlaceHolder | loading placeholder, enable when 'isLoading = true' | String | '' |
Full example code #
Preview: