indicator_button 0.0.3
indicator_button: ^0.0.3 copied to clipboard
A Flutter Button with indicates progress
Indicator Button #
A Flutter Button with indicates progress
Demo: #


Getting Started #
- Add dependency to your pubspec.yaml
dependencies:
indicator_button: ^0.0.3
- 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 #
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Added some feature') - Push to the branch (
git push origin my-new-feature) - 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