Guest User

Untitled

a guest
Jun 18th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2.  
  3. class MyButton extends StatelessWidget {
  4. const MyButton({Key key, this.color, this.onTap, this.text}) : super(key: key);
  5.  
  6. final Color color;
  7. final VoidCallback onTap;
  8. final String text;
  9.  
  10. @override
  11. Widget build(BuildContext context) {
  12. return new GestureDetector(
  13. child: new Container(
  14. color: this.color,
  15. child: new Padding(
  16. padding: new EdgeInsets.all(10.0),
  17. child: new Center(
  18. child: new Text(this.text),
  19. ),
  20. ),
  21. ),
  22. onTap: this.onTap,
  23. );
  24. }
  25. }
Add Comment
Please, Sign In to add comment