Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. import "github.com/flutter/flutter"
  2. import . "scaffold" // scaffold.go
  3.  
  4. func (m *MyHomePage) Build(ctx flutter.BuildContext) flutter.Widget {
  5. return Scaffold{
  6. AppBar: AppBar{
  7. Title: Text{ Text: "My Home Page"},
  8. },
  9. Body: Center{
  10. Child: Column{
  11. MainAxisAlignment: MainAxisAlignment.center,
  12. Children: []Widget{
  13. Text{ Text: "You have pushed the button this many times:" },
  14. Text(
  15. Text: fmt.Sprintf("%d", m.counter),
  16. Style: ctx.textTheme.display1,
  17. },
  18. }
  19. }
  20. },
  21. FloatingActionButton: FloatingActionButton{
  22. onPressed: m.incrementCounter,
  23. Tooltip: "Increment",
  24. Child: Icon{Icons.add}, // Couldn't resist just one shorthand :)
  25. }
  26. }.Construct()
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement