import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; class SocialButton extends StatelessWidget { final String type; final double width; final double height; final Function press; SocialButton({ Key key, this.type, this.width = 32.0, this.height = 32.0, this.press, }) : super(key: key); String iconSrc; Color bgColor; @override Widget build(BuildContext context) { switch(type){ case 'kakao': iconSrc = "assets/icons/kakao_talk_A.svg"; bgColor = Color(0xFFFFE600); break; case 'naver': iconSrc = "assets/icons/naver_n.svg"; bgColor = Color(0xFF4AB749); break; case 'google': iconSrc = "assets/icons/google_A.svg"; bgColor = Colors.white; break; case 'facebook': iconSrc = "assets/icons/facebook.svg"; bgColor = Color(0xFF3C5A99); break; } return GestureDetector( onTap: press, child: Container( margin: EdgeInsets.all(10), padding: EdgeInsets.all(5), decoration: BoxDecoration( color: bgColor, border: Border.all( width: 1, color: bgColor, ), shape: BoxShape.circle, ), child: SvgPicture.asset( iconSrc, height: width, width: height, ), ), ); } }