counter 0.2.1 copy "counter: ^0.2.1" to clipboard
counter: ^0.2.1 copied to clipboard

A Flutter counter widget, supports min/max/initial/bound/step value with type int/double, and supports appearance configuration.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:counter/counter.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Counter Example',
      theme: ThemeData(primarySwatch: Colors.blue),
      home: MyHomePage(title: 'Counter Example'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text(widget.title)),
      body: Container(
        child: Center(
          child: Counter(
            min: 0,
            max: 10,
            bound: 3,
            step: 1,
            onValueChanged: print,
          ),
        ),
      ),
    );
  }
}
3
likes
135
pub points
81%
popularity

Publisher

unverified uploader

A Flutter counter widget, supports min/max/initial/bound/step value with type int/double, and supports appearance configuration.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on counter