DEV Community

Pablo L
Pablo L

Posted on

RaisedButton Examples

RaisedButton

  Widget _makeButton() {
    return RaisedButton(
        child: Text("PUSH ME"),
        color: Colors.red,
        onPressed: () {
          print("OK!!");
        }
    );
  }
Enter fullscreen mode Exit fullscreen mode

Alt Text

RaisedButton + Border

  Widget _makeButton() {
    return RaisedButton(
      child: Text("PUSH ME"),
      shape: Border.all(),
      color: Colors.red,
      onPressed: () {
        print("PUSHED");
      },
    );
  }
Enter fullscreen mode Exit fullscreen mode

Alt Text

RaisedButton + Border + Elevation

  Widget _makeButton() {
    return RaisedButton(
      color: Colors.red,
      elevation: 15,
      child: Text("PUSH ME"),
      shape: Border.all(),
      onPressed: () {
        print("PUSHED");
      },
    );
  }
Enter fullscreen mode Exit fullscreen mode

Alt Text

RaisedButton + Elevation + Round Shape

  Widget _makeButton() {
    return RaisedButton(
      color: Colors.red,
      elevation: 15,
      shape: StadiumBorder(),
      child: Text("PUSH ME"),
      onPressed: () {
        print("PUSHED");
      },
    );
  }
Enter fullscreen mode Exit fullscreen mode

Alt Text

RaisedButton + Border + Elevation + Round Shape and Border

  Widget _makeButton() {
    return RaisedButton(
      color: Colors.red,
      elevation: 15,
      shape: StadiumBorder(side: BorderSide(color: Colors.black, width: 1)),
      child: Text("PUSH ME"),
      onPressed: () {
        print("PUSHED");
      },
    );
  }
Enter fullscreen mode Exit fullscreen mode

Alt Text

RaisedButton + Border + Icon + Elevation + Round Shape and Border

  Widget _makeButton() {
    return RaisedButton(
      color: Colors.red,
      elevation: 15,
      child: Row(
          mainAxisSize: MainAxisSize.min,
          children: <Widget>[Icon(Icons.access_alarm), Text("TIME ALARM")]),
      shape: StadiumBorder(side: BorderSide(color: Colors.black, width: 1)),
      onPressed: () {
        print("PUSHED");
      },
    );
  }
Enter fullscreen mode Exit fullscreen mode

Alt Text

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay