button2outline function
dynamic
button2outline()
Implementation
button2outline(String text, TextStyle style, Color color, double _radius, Function _callback, bool enable, Color colorBkg){
return Stack(
children: <Widget>[
Container(
width: double.maxFinite,
padding: EdgeInsets.only(top: 10, bottom: 10),
decoration: BoxDecoration(
color: colorBkg,
border: Border.all(color: color, width: 2),
borderRadius: BorderRadius.circular(_radius),
),
child: Text(text, style: style, textAlign: TextAlign.center, overflow: TextOverflow.ellipsis,)
),
if (enable)
Positioned.fill(
child: Material(
color: Colors.transparent,
clipBehavior: Clip.hardEdge,
shape: RoundedRectangleBorder(borderRadius:BorderRadius.circular(_radius) ),
child: InkWell(
splashColor: Colors.black.withOpacity(0.2),
onTap: (){
_callback();
}, // needed
)),
)
],
);
}