Dashstrap Button
A simple yet elegant button for your apps. Dashstrap supports multiple sizes and styles of buttons, Dashstrap also supports multiple feedback styles for pointer events.
Installation
Using command line:
flutter pub add dashstrap-button
As a dependency in your pubspec.yaml file
dependencies:
dashstrap_button: ^1.0.0
You can also follow the instructions on pub.dev
Usage
Simple Usage
Import the package
import 'package:dashstrap_button/dashstrap_button.dart';
Create the button
DSButton(
text: "Click Me",
)
Modifying the appearance
DSButton(
text: "Click Me",
size: DSButtonSize.large,
icon: Icons.email,
)
All properties
* - Required
Property Name | Type | Description | Default Value |
---|---|---|---|
text* | String | Text to be rendered inside the button | "" |
size | DSButtonSize | Size of the button | normal |
feedbackStyle | DSButtonFeedbackStyle | How the button's appearance responds to pointer events | normal |
fontSize | double? | Size of the text and icon (if any) | Based on button size |
fontColor | Color | Color of the text and icon (if any) | Colors.white |
color | Color? | Background color of the button, used for border color for outline buttons | accentColor of Theme |
icon | IconData? | Icon to use to the left side of the text | null |
style | DSButtonStyle | Appearance style of the button | normal |
activeOpacity | double | Opacity of the button when a pointer down event is active, only applicable for feedbackStyle opacity | 0.3 |
disabled | bool | Whether or not the button is disabled (will ignore pointer events) | false |
disabledColor | Color? | Color of button in disabled state | Color(0xFFEAEAEA) |
onTapUp | Function(TapUpDetails)? | Function to call when a pointer up event is received | null |
onTapDown | Function(TapDownDetails)? | Function to call when a pointer down event is received | null |
Enumerations
enum DSButtonSize { small, normal, large, fullwidth }
enum DSButtonFeedbackStyle { normal, opacity }
enum DSButtonFontStyle { normal, strong }
enum DSButtonStyle { normal, outline }
Troubleshooting
For any issues or questions create an issue in the issue tracker
Contributors
Contributions are always welcome, you can find the steps to setup the project and the steps involved in making contributions here