enum ProtocolType { USER, VIP, PRIVATE, } class Protocols { static Map protocols = { ProtocolType.USER : 'Here is user protocol', ProtocolType.VIP: 'Welcome ! Here is VIP protocol', ProtocolType.PRIVATE: 'Welcome ! Here is private protocol', }; static Map protocolNames = { ProtocolType.USER : '用户注册协议', ProtocolType.VIP: '美天旺会员协议', ProtocolType.PRIVATE: '隐私政策', }; static String getType(ProtocolType type) => protocols[type]; static String getTitle(ProtocolType type) => protocolNames[type]; }