import 'package:flutter/material.dart'; import 'bottom_sheet_text.dart'; /// Description: 联系人卡片 /// Time : 2021年12月03日 Friday /// Author : liuyuqi.gov@msncn class ContactCard extends StatelessWidget { ContactCard( {required this.imagePath, required this.infection, this.username = "", required this.updateTime, this.deviceid = ""}); final String imagePath; final String infection; final String username; final String updateTime; final String deviceid; @override Widget build(BuildContext context) { return Card( elevation: 3.0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0)), child: ListTile( leading: CircleAvatar( backgroundImage: AssetImage(imagePath), ), trailing: Icon(Icons.more_horiz), title: Text( username, style: TextStyle( color: Colors.deepPurple[700], fontWeight: FontWeight.bold, ), ), subtitle: Text(infection), onTap: () => showModalBottomSheet( context: context, builder: (builder) { return Padding( padding: const EdgeInsets.symmetric( vertical: 50.0, horizontal: 10.0), child: Column( children: [ BottomSheetText(question: '姓名:', result: username), const SizedBox(height: 5.0), BottomSheetText(question: '设备ID:', result: deviceid), const SizedBox(height: 5.0), BottomSheetText(question: '更新时间:', result: updateTime), const SizedBox(height: 5.0), BottomSheetText(question: '健康状态:', result: infection), ], ), ); }), // 38:FC:E6:22:23:C2 // ), ); } }