Guest User

Untitled

a guest
Jul 16th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2. import '../reusable/util_button.dart';
  3.  
  4. class BackgroundButton extends StatefulWidget {
  5. @override
  6. BackgroundButtonState createState() => BackgroundButtonState();
  7. }
  8.  
  9. class BackgroundButtonState extends State<BackgroundButton> with UtilButton {
  10. @override
  11. Widget build(BuildContext context) {
  12. return Scaffold(
  13. body: Container(
  14. child: Center(
  15. child: Column(
  16. mainAxisAlignment: MainAxisAlignment.center,
  17. children: <Widget>[
  18. buildBackgroundButton(
  19. //array of colors
  20. [Colors.green, Colors.red],
  21. //name of your button
  22. 'Click Me',
  23. //your callback function
  24. (){ print('Clicked'); }
  25. ),
  26. ],
  27. ),
  28. ),
  29. ),
  30. );
  31. }
  32. }
Add Comment
Please, Sign In to add comment