pushable button
a 3d pushable button built in flutter. ideal for important ctas in the app.
usage
pushablebutton(
child: text('enroll now', style: sometextstyle),
height: 60,
elevation: 8,
hslcolor: hslcolor.fromahsl(1.0, 120, 1.0, 0.37),
shadow: boxshadow(
color: colors.grey.withopacity(0.5),
spreadradius: 5,
blurradius: 7,
offset: offset(0, 2),
),
onpressed: () => print('button pressed!'),
)
configurable properties
- child: child widget (normally a
text
oricon
) - height: height of the top layer
- elevation: elevation or “gap” between the top and bottom layer
- hslcolor: color of the top layer.
hslcolor
is used instead ofcolor
so that the bottom layer is automatically calculated by reducing the luminosity - shadow: an optional shadow to make the button look better
- onpressed: button callback
Comments are closed.