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

A button that animates on tap

example/lib/main.dart

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

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

class MyApp extends StatefulWidget {
  const MyApp({super.key});

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

class _MyAppState extends State<MyApp> {
  bool buttonValue = false;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Animated Tap Button Example'),
        ),
        body: Center(
          child: AnimatedTapButton(
            iconSize: 50.0,
            initialValue: buttonValue,
            onValueChanged: (bool newValue) {
              buttonValue = !buttonValue;
              setState(() {});
            },
            selectedIcon: Icons.thumb_up,
            unselectedIcon: Icons.thumb_up_off_alt,
            iconColor: Colors.blue,
          ),
        ),
      ),
    );
  }
}
0
likes
140
points
23
downloads

Publisher

unverified uploader

Weekly Downloads

A button that animates on tap

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on animated_tap_button