Advertisement
mat8854

Custom Button

May 9th, 2020
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 1.15 KB | None | 0 0
  1. @override
  2.   Widget build(BuildContext context) {
  3.     return new Expanded(child: new Container(
  4.       //padding: new EdgeInsets.only(top: statusBarHeight),
  5.       //height: 150.0,
  6.       child: new FlatButton(
  7.         onPressed: () {
  8.           Navigator.push(
  9.             context, SlideInFromRight(builder: (context) => widget)
  10.           );
  11.         },
  12.         child: Center(child:
  13.         new Column(children: <Widget>[
  14.           new Expanded(flex: 70, child:
  15.           //new Icon(icon, color: _getColorIcon(), size: 50.0)),
  16.           new Image.asset(icon, width: 50.0)),
  17.           new Expanded(flex: 30, child:
  18.           new Text(title,
  19.               style: _getTextStyle())
  20.           ),
  21.         ],),
  22.         ),
  23.       ),
  24.       decoration: new BoxDecoration(
  25.         border: new Border.all(color: Colors.grey, width: 0.3),
  26.         gradient: new LinearGradient(
  27.             colors: [
  28.               _getColorStart(),
  29.               _getColorEnd()
  30.             ],
  31.             begin: Alignment.topCenter,
  32.             end: Alignment.bottomCenter,
  33.             //stops: [0.0, 1.0],
  34.             tileMode: TileMode.clamp
  35.         ),
  36.       ),
  37.     ),
  38.     );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement