contact_card.dart 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import 'package:flutter/material.dart';
  2. import 'bottom_sheet_text.dart';
  3. /// Description: 联系人卡片
  4. /// Time : 2021年12月03日 Friday
  5. /// Author : liuyuqi.gov@msncn
  6. class ContactCard extends StatelessWidget {
  7. ContactCard(
  8. {required this.imagePath,
  9. required this.infection,
  10. this.username = "",
  11. required this.updateTime,
  12. this.deviceid = ""});
  13. final String imagePath;
  14. final String infection;
  15. final String username;
  16. final String updateTime;
  17. final String deviceid;
  18. @override
  19. Widget build(BuildContext context) {
  20. return Card(
  21. elevation: 3.0,
  22. shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0)),
  23. child: ListTile(
  24. leading: CircleAvatar(
  25. backgroundImage: AssetImage(imagePath),
  26. ),
  27. trailing: Icon(Icons.more_horiz),
  28. title: Text(
  29. username,
  30. style: TextStyle(
  31. color: Colors.deepPurple[700],
  32. fontWeight: FontWeight.bold,
  33. ),
  34. ),
  35. subtitle: Text(infection),
  36. onTap: () => showModalBottomSheet(
  37. context: context,
  38. builder: (builder) {
  39. return Padding(
  40. padding: const EdgeInsets.symmetric(
  41. vertical: 50.0, horizontal: 10.0),
  42. child: Column(
  43. children: <Widget>[
  44. BottomSheetText(question: '姓名:', result: username),
  45. const SizedBox(height: 5.0),
  46. BottomSheetText(question: '设备ID:', result: deviceid),
  47. const SizedBox(height: 5.0),
  48. BottomSheetText(question: '更新时间:', result: updateTime),
  49. const SizedBox(height: 5.0),
  50. BottomSheetText(question: '健康状态:', result: infection),
  51. ],
  52. ),
  53. );
  54. }),
  55. // 38:FC:E6:22:23:C2
  56. //
  57. ),
  58. );
  59. }
  60. }