number_ticker 0.0.2+1 copy "number_ticker: ^0.0.2+1" to clipboard
number_ticker: ^0.0.2+1 copied to clipboard

Number_ticker provides a simple number ticker for displaying a changing number. You can use it to display the number that updates in real time for better user experience.

Number Ticker #

pub package likes pub points

Number_ticker is a dart package that provides a Robinhood-like number ticker widget for displaying changing number.

m

Usage #

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<MyHomePage> {
  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 #

  • ✅ Support integer.
  • ❌ Support decimal.
  • ❌ Support negative number.
13
likes
130
points
10
downloads

Publisher

unverified uploader

Weekly Downloads

Number_ticker provides a simple number ticker for displaying a changing number. You can use it to display the number that updates in real time for better user experience.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on number_ticker