Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- class MyButton extends StatelessWidget {
- const MyButton({Key key, this.color, this.onTap, this.text}) : super(key: key);
- final Color color;
- final VoidCallback onTap;
- final String text;
- @override
- Widget build(BuildContext context) {
- return new GestureDetector(
- child: new Container(
- color: this.color,
- child: new Padding(
- padding: new EdgeInsets.all(10.0),
- child: new Center(
- child: new Text(this.text),
- ),
- ),
- ),
- onTap: this.onTap,
- );
- }
- }
Add Comment
Please, Sign In to add comment