Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/livinglist/number_ticker
A simple number ticker for flutter app.
https://github.com/livinglist/number_ticker
dart dart-library dart-package dartlang flutter flutter-examples
Last synced: 21 days ago
JSON representation
A simple number ticker for flutter app.
- Host: GitHub
- URL: https://github.com/livinglist/number_ticker
- Owner: Livinglist
- License: mit
- Created: 2021-03-04T07:21:58.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-12T22:31:57.000Z (almost 3 years ago)
- Last Synced: 2024-10-04T15:42:45.811Z (about 1 month ago)
- Topics: dart, dart-library, dart-package, dartlang, flutter, flutter-examples
- Language: Dart
- Homepage: https://pub.dev/packages/number_ticker
- Size: 25.4 KB
- Stars: 15
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Number Ticker
[![pub package](https://img.shields.io/pub/v/number_ticker.svg)](https://pub.dartlang.org/packages/number_ticker)
[![likes](https://badges.bar/number_ticker/likes)](https://pub.dev/packages/number_ticker/score)
[![pub points](https://badges.bar/number_ticker/pub%20points)](https://pub.dev/packages/number_ticker/score)Number_ticker is a dart package that provides a Robinhood-like number ticker widget for displaying changing number.
![m](https://user-images.githubusercontent.com/7277662/110279104-61089200-7f8d-11eb-973a-f747ebc7c77d.gif)
## Usage
```dart
import 'package:flutter/material.dart';
import 'package:number_ticker/number_ticker.dart';void main() {
runApp(MyApp());
}class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(),
);
}
}class MyHomePage extends StatefulWidget {
MyHomePage({Key key}) : super(key: key);@override
_MyHomePageState createState() => _MyHomePageState();
}class _MyHomePageState extends State {
final controller = NumberTickerController();@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Number Ticker Demo"),
),
body: ListView(
children: [
NumberTicker(controller: controller, initialNumber: 123, textStyle: TextStyle(fontSize: 24),),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
RaisedButton(onPressed: (){
controller.number = controller.number - 1;
}, child: Text('-'),),
RaisedButton(onPressed: (){
controller.number = controller.number + 1;
}, child: Text('+'),),
RaisedButton(onPressed: (){
controller.number = controller.number - 10;
}, child: Text('- 10'),),
RaisedButton(onPressed: (){
controller.number = controller.number + 10;
}, child: Text('+ 10'),),
],
),
],
),// This trailing comma makes auto-formatting nicer for build methods.
);
}
}```
## TODO
- [x] Support integer.
- [ ] Support decimal.
- [ ] Support negative number.