YSDoctorListView.dart 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import 'package:flutter/cupertino.dart';
  2. import 'package:flutter/material.dart';
  3. import '../../YSAskQuestion.dart';
  4. class YSDoctorListView extends StatelessWidget {
  5. final Map doctorItem;
  6. const YSDoctorListView({Key key, this.doctorItem}) : super(key: key);
  7. @override
  8. Widget build(BuildContext context) {
  9. return GestureDetector(
  10. behavior: HitTestBehavior.opaque,
  11. onTap: (){
  12. Navigator.of(context,rootNavigator: true).push(
  13. CupertinoPageRoute(
  14. builder: (context){
  15. return YSAskQuestion(info: doctorItem,isPolicy: false,);
  16. }
  17. )
  18. );
  19. },
  20. child: Container(
  21. height: 90,
  22. child: Row(
  23. children: [
  24. Container(
  25. height: 70,
  26. width: 70,
  27. decoration: BoxDecoration(
  28. borderRadius: BorderRadius.all(Radius.circular(35)),
  29. color: Color(0xFFD1D1D1),
  30. image: DecorationImage(
  31. fit: BoxFit.fill,
  32. image: NetworkImage('${doctorItem['avatar']}'),
  33. )
  34. ),
  35. ),
  36. Container(
  37. margin: EdgeInsets.only(left: 10),
  38. height: 60,
  39. width: MediaQuery.of(context).size.width-140,
  40. child: Column(
  41. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  42. crossAxisAlignment: CrossAxisAlignment.start,
  43. children: [
  44. RichText(text: TextSpan(
  45. text: '${doctorItem['name']}医生',
  46. style: TextStyle(color: Color(0xFF0F0F0F),fontSize: 14,decoration: TextDecoration.none,fontWeight: FontWeight.w600),
  47. children: [
  48. TextSpan(
  49. text: '(${doctorItem['hospital_name']})',
  50. style: TextStyle(color: Color(0xFF7F3344),fontSize: 12)
  51. )
  52. ]
  53. ),maxLines: 1,),
  54. Text('${doctorItem['introduction']}',style: TextStyle(color: Color(0xFF0F0F0F),fontSize: 11,
  55. decoration: TextDecoration.none,fontWeight: FontWeight.normal),maxLines: 2,overflow: TextOverflow.ellipsis,),
  56. ],
  57. ),
  58. )
  59. ],
  60. ),
  61. ),
  62. );
  63. }
  64. }