Hibok
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

30 rivejä
840 B

  1. import 'package:chat/data/constants.dart';
  2. import 'package:flutter/material.dart';
  3. class KeyboardIcon extends StatelessWidget {
  4. final int iconCode;
  5. final VoidCallback onTap;
  6. final bool isSelect;
  7. final int selectIconCode;
  8. final double size;
  9. KeyboardIcon(
  10. {this.iconCode, this.onTap, this.isSelect = false, this.selectIconCode,this.size = 28});
  11. @override
  12. Widget build(BuildContext context) {
  13. var color = isSelect ? Color(0xFF0A80F3) : Color(0xFF797A7C);
  14. var code;
  15. if (selectIconCode == null) {
  16. code = iconCode;
  17. } else {
  18. code = isSelect ? selectIconCode : iconCode;
  19. }
  20. return InkWell(
  21. child: Icon(
  22. IconData(code, fontFamily: Constants.IconFontFamily),
  23. color: color,
  24. size: size,
  25. ),
  26. onTap: onTap);
  27. }
  28. }