Flutter: Add example in FlatButton, RaisedButton, etc that shows setting the text of the button

Created on 3 Oct 2017  路  3Comments  路  Source: flutter/flutter

I checked the FlatButton and I couldn't find the simple of example of "a button with text". There isn't an obvious "declare the text of the button here". I assume it's the child widget?

https://docs.flutter.io/flutter/material/FlatButton-class.html

It would be sufficient, IMO, to show a simple example snippet in the top of the docs.

api docs material design framework

Most helpful comment

I agree!
for instance here's a piece of code to update in documentation

new RaisedButton(
  child: new Text('Play!'),
  color: Colors.blueAccent,
),

All 3 comments

cc @Hixie

I agree!
for instance here's a piece of code to update in documentation

new RaisedButton(
  child: new Text('Play!'),
  color: Colors.blueAccent,
),

Yeah we should add sample code and screen shots to those API docs.

Was this page helpful?
0 / 5 - 0 ratings