Flutter button effect pub warehouse address
Flutter button effect github repository address
The effect is as follows:
Download and install:
Add dependencies in pubspec.yaml
dependencies: ... Twinkle_button: ^ 0.0.1Copy the code
Execute this statement on the command line
flutter packages get
Copy the code
Usage:
import 'package:twinkle_button/twinkle_button.dart';
Copy the code
TwinkleButton(
buttonTitle: Text(
'Subscribe with Free Trial',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w300,
fontSize: 17.0,
),
),
buttonColor: Color(0xff3dce89),
onclickButtonFunction: () {
print('hello'); });Copy the code
parameter
Parameter | Default | Description |
---|---|---|
buttonTitle | null | The text of the button cannot be empty. |
buttonColor | null | The color of the button cannot be empty. |
buttonHeight | 50.0 | The height of the button. |
buttonWidth | 200.0 | The width of the button. |
durationTime | 3 | Blink interval. (Unit: second) |
twinkleTime | 300 | Blink time. (In milliseconds) |
highlightColor | Colors.white | Flicker background color. |
onclickButtonFunction | null | The event triggered by clicking a button cannot be null. |