counter_button 1.0.1 copy "counter_button: ^1.0.1" to clipboard
counter_button: ^1.0.1 copied to clipboard

Counter Button is a flutter library that allows you to create a button with animation effects when you increase or decrease the counter value.

example/lib/main.dart

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

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

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  /// Counter value
  int _counterValue = 0;
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: CounterButton(
            loading: false,
            onChange: (int val) {
              setState(() {
                _counterValue = val;
              });
            },
            count: _counterValue,
            countColor: Colors.purple,
            buttonColor: Colors.purpleAccent,
            progressColor: Colors.purpleAccent,
          ),
        ),
      ),
    );
  }
}
29
likes
150
points
546
downloads

Publisher

unverified uploader

Weekly Downloads

Counter Button is a flutter library that allows you to create a button with animation effects when you increase or decrease the counter value.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on counter_button