indicator_button 0.0.1 copy "indicator_button: ^0.0.1" to clipboard
indicator_button: ^0.0.1 copied to clipboard

outdated

A Flutter Button with indicates progress

Indicator Button #

A Flutter Button with indicates progress

Demo: #

[Demo 1]

[Demo 2]

Getting Started #

  • Add dependency to your pubspec.yaml
dependencies:
  indicator_button: ^0.0.1
  • Install packages
flutter pub get
  • Add indicator to your widget tree
  var followed = _followingUserIdList.contains(user.id);
  var buttonText = followed ? '已关注' : '关注 TA';
  var buttonBackgroundColor = followed ? Colors.white30 : Colors.white;
  var borderColor = followed ? Colors.grey : Colors.blue;
  var textColor = followed ? Colors.grey : Colors.blue;

  button = IndicatorButton(
    backgroundColor: buttonBackgroundColor,
    progressColor: textColor,
    borderColor: borderColor,
    child: Row(
      mainAxisAlignment: MainAxisAlignment.spaceAround,
      crossAxisAlignment: CrossAxisAlignment.center,
      children: <Widget>[
        Icon(
          Icons.remove_red_eye,
          size: 20.0,
          color: textColor,
        ),
        Text(
          buttonText,
          style: TextStyle(
            fontWeight: FontWeight.bold,
            fontSize: 15.0,
            color: textColor,
          ),
        ),
      ],
    ),
    onPressed: () async {
      if (followed) {
        await model.unFollow(userId: user.id);
      } else {
        await model.follow(userId: user.id);
      }
    },
  );

Contributing #

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Contributors #

See the Contributors List.

CHANGE LOG #

See the CHANGELOGS.md.

License #

This project is licensed under the MIT License - see the LICENSE file for details

0
likes
0
points
15
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter Button with indicates progress

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on indicator_button