CustomButton class

this is the custom button to customize the button all over in the app.

Inheritance

Constructors

CustomButton({Key? key, Color? color, bool enabled = true, Gradient? customGradient, List<BoxShadow>? customBoxShadow, Color? borderColor, required String text, bool isFlexible = false, dynamic onTap()?, double horizontalPadding = 0, double horizontalMargin = 0, double? borderRadius, bool isBorder = false, double verticalMargin = 0, double verticalPadding = 8, double? width, bool showGradient = false, bool showShadow = false, double? height, Color? textColor, FontWeight? fontWeight, double? fontSize, TextAlign textAlign = TextAlign.center, String? fontFamily, bool load = false, Widget? suffix, Widget? prefix, bool isSolid = true})
this is the constructor of the custom button.

Properties

borderColor → Color?
this will be the border color of the custom button
final
borderRadius → double?
this is the border radius of the button.
final
color → Color
this will be the color of the custom button
final
customBoxShadow → List<BoxShadow>?
for giving the custom box shadow to the button you can have this
final
customGradient → Gradient?
for giving the custom gradient to the button you can have this
final
enabled → bool
if set to false then styling will be like a disabled button, also on tap will not work
final
fontFamily → String?
this is the font family of text of the custom button
final
fontSize → double?
this is the font size of the text
final
fontWeight → FontWeight?
this is the font weight of the text
final
hashCode → int
The hash code for this object.
no setterinherited
height → double?
this is the height of the custom button
final
horizontalMargin → double
this is the horizontal margin of the custom button
final
horizontalPadding → double
this is the horizontal padding of the custom button
final
isBorder → bool
setting this to true will add border to the button
final
isFlexible → bool
if set to true then it will take only required width, if false then it will take all the available width
final
isSolid → bool
if this is true then the button will be filled with color, if false then the styling will be like text button with rounded border
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
load → bool
you can show loader in the button by setting this to true, if true then on tap will be blocked.
final
onTap → dynamic Function()?
this function will be when you click on the button
final
prefix → Widget?
to add the icon to the left of the text, you can add a widget in this
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showGradient → bool
this is have the gradient in the button
final
showShadow → bool
this will show shadow in the button
final
suffix → Widget?
to add the icon to the right of the text, you can add a widget in this
final
text → String
this is the text which will be shown in the custom button
final
textAlign → TextAlign
this is the text alignment of the button
final
textColor → Color?
this is the color of the text, by default it will be primary color of custom styles config that you set in the main.
final
verticalMargin → double
this is the vertical margin of the custom button
final
verticalPadding → double
this is the vertical padding of the custom button
final
width → double?
this is the width of the button, by default it will take all the available width
final

Methods

build(BuildContext context) → Widget
Describes the part of the user interface represented by this widget.
override
createElement() → StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited