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

outdated

An animated button that expands and changes colour on clicking

example/example.dart

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

class Example extends StatefulWidget {
  @override
  _ExampleState createState() => _ExampleState();
}

class _ExampleState extends State<Example> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Expanding Button Example'),
      ),
      body: Material(
        child: Center(
          // Using the Expanding Button
          child: ExpandingButton(
            // child <Widget>
            child: Text('Finesse', style: TextStyle(color: Colors.white)),
            // onTap <VoidCallback>
            onTap: () {print('expand');},
            // onTapWhenExpanded <VoidCallback>
            onTapWhenExpanded: () {print('collapse');},
            // background <Color>
            background: Colors.blue,
            // backgroundAfterAnimation <Color>
            backgroundAfterAnimation: Colors.greenAccent,
          ),
        ),
      ),
    );
  }
}
8
likes
30
pub points
10%
popularity

Publisher

unverified uploader

An animated button that expands and changes colour on clicking

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on expanding_button