Brak opisu

icon_text_button.dart 514B

123456789101112131415161718192021222324
  1. import 'package:flutter/material.dart';
  2. class IconTextButton extends StatelessWidget {
  3. final IconData icon;
  4. final String text;
  5. final Function onTap;
  6. const IconTextButton({Key key, this.icon, this.text, this.onTap})
  7. : super(key: key);
  8. @override
  9. Widget build(BuildContext context) {
  10. return InkWell(
  11. onTap: onTap,
  12. child: Container(
  13. child: ListTile(
  14. leading: Icon(icon ?? Icons.device_unknown),
  15. title: Text(text ?? ""),
  16. ),
  17. ),
  18. );
  19. }
  20. }