expert_list.dart 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849
  1. import 'package:flutter/material.dart';
  2. import 'package:liftmanager/res/gaps.dart';
  3. import 'package:liftmanager/net/api_service.dart';
  4. import 'package:liftmanager/utils/toast.dart';
  5. import 'package:liftmanager/widgets/app_bar.dart';
  6. import 'package:liftmanager/internal/search/search_router.dart';
  7. import 'package:liftmanager/widgets/app_search_bar.dart';
  8. import 'package:liftmanager/res/resources.dart';
  9. import 'package:liftmanager/routers/fluro_navigator.dart';
  10. import 'package:liftmanager/widgets/load_image.dart';
  11. import 'package:liftmanager/internal/bbs/bbs_router.dart';
  12. import 'package:flutter_screenutil/flutter_screenutil.dart';
  13. import 'package:liftmanager/utils/time_format.dart';
  14. import 'package:liftmanager/internal/search/presenter/base_list_provider.dart';
  15. import 'package:liftmanager/widgets/state_layout.dart';
  16. import 'package:provider/provider.dart';
  17. import 'package:liftmanager/widgets/my_refresh_list.dart';
  18. import 'package:liftmanager/utils/url.dart';
  19. import 'package:flutter_spinkit/flutter_spinkit.dart';
  20. import 'package:liftmanager/mvp/base_page_state.dart';
  21. import 'package:liftmanager/internal/bbs/model/expert_model.dart';
  22. import 'package:liftmanager/internal/bbs/presenter/expert_list_presenter.dart';
  23. import 'package:shared_preferences/shared_preferences.dart';
  24. import 'dart:convert';
  25. import 'dart:async';
  26. import 'package:permission_handler/permission_handler.dart';
  27. // import 'package:amap_all_fluttify/amap_all_fluttify.dart';
  28. import 'package:amap_location_flutter_plugin/amap_location_flutter_plugin.dart';
  29. import 'package:liftmanager/utils/theme_utils.dart';
  30. import 'package:liftmanager/widgets/star_item.dart';
  31. int dataId;
  32. String dataTable;
  33. class ExpertList extends StatefulWidget {
  34. ExpertList(this.id);
  35. final String id;
  36. @override
  37. ExpertListState createState() => ExpertListState();
  38. }
  39. class ExpertListState extends BasePageState<ExpertList, ExpertListPresenter> {
  40. BaseListProvider<Records> provider = BaseListProvider<Records>();
  41. // ExpertListState({Key key}) : super(key: key);
  42. AmapLocationFlutterPlugin _locationPlugin = new AmapLocationFlutterPlugin();
  43. StreamSubscription<Map<String, Object>> _locationListener;
  44. Map<String, Object> _locationResult;
  45. bool sortBool = true;
  46. String sortName = "采纳排序";
  47. int indexNowConst = 999999;
  48. String checkId = "";
  49. int _page = 1;
  50. double apiExpertFee = 0.0;
  51. int sortNum = 0;
  52. List<String> sortListChiose = [
  53. "采纳排序",
  54. "咨询人数",
  55. "评论星级",
  56. "距离优先"
  57. ];
  58. @override
  59. void initState() {
  60. super.initState();
  61. ///移除定位监听
  62. if (null != _locationListener) {
  63. _locationListener.cancel();
  64. }
  65. ///销毁定位
  66. if (null != _locationPlugin) {
  67. _locationPlugin.destroy();
  68. }
  69. _locationListener = _locationPlugin
  70. .onLocationChanged()
  71. .listen((Map<String, Object> result) {
  72. setState(() {
  73. _locationPlugin.stopLocation();
  74. _locationResult = result;
  75. // address latitude longitude
  76. lat = _locationResult["latitude"];
  77. lng = _locationResult["longitude"];
  78. _onRefresh();
  79. // _locationResult.forEach((key, value) {
  80. // if(key == 'city'){
  81. // cityName = '$value';
  82. // setState(() {
  83. // });
  84. // }
  85. // print(111);
  86. // print('key:$key :');
  87. // print('value:$value :');
  88. // });
  89. });
  90. });
  91. getDataId();
  92. getApiFee();
  93. getType();
  94. sortType = "adopt_counts";
  95. _onRefresh();
  96. }
  97. Future getApiFee() async {
  98. await NewApiService().getFee(onSuccess: (res) {
  99. if (res != null) {
  100. apiExpertFee = res;
  101. setExpertFee(apiExpertFee);
  102. setState(() {});
  103. print(res);
  104. print(6666544);
  105. }
  106. }, onError: (code, msg) {
  107. toasts(msg);
  108. });
  109. }
  110. void setExpertFee (double expertFee)async{
  111. SharedPreferences prefs = await SharedPreferences.getInstance();
  112. prefs.setDouble("expertFee", expertFee);
  113. }
  114. void getDataId() async {
  115. SharedPreferences prefs = await SharedPreferences.getInstance();
  116. dataId = prefs.getInt("dataId");
  117. }
  118. void getType() async {
  119. SharedPreferences prefs = await SharedPreferences.getInstance();
  120. dataTable = prefs.getString("questionType");
  121. }
  122. // 绑定专家
  123. void generateRoom(expertId) {
  124. NewApiService().generateRoom({
  125. "id": dataId,
  126. "chargerId": expertId,
  127. }, onSuccess: (res) {
  128. getRoom();
  129. }, onError: (code, msg) {
  130. toasts(msg);
  131. });
  132. }
  133. //用诊单Id获取房间号
  134. Future getRoom() async {
  135. await NewApiService().findOne(dataId, onSuccess: (res) {
  136. print(res);
  137. String roomId = res.sessionid;
  138. toasts("即将进入聊天室!");
  139. NavigatorUtils.push(context, "${BbsRouter.chatRoom}?id=$roomId&type=someToOne&toUserId=''");
  140. print(666);
  141. }, onError: (code, msg) {
  142. toasts(msg);
  143. });
  144. }
  145. ///获取定位权限
  146. Future<bool> requestPermission() async {
  147. final permissions = await PermissionHandler()
  148. .requestPermissions([PermissionGroup.location]);
  149. if (permissions[PermissionGroup.location] == PermissionStatus.granted) {
  150. return true;
  151. } else {
  152. toasts('需要定位权限!');
  153. return false;
  154. }
  155. }
  156. double lat;
  157. double lng;
  158. ///获取位置信息
  159. getLocation() async {
  160. if (await requestPermission()) {
  161. // final location = await AmapLocation.fetchLocation();
  162. // LatLng latlng = await location.latLng;
  163. // print(latlng.latitude);
  164. // print(latlng.longitude);
  165. // print(latlng);
  166. // lat = latlng.latitude;
  167. // lng = latlng.longitude;
  168. // _onRefresh();
  169. if (null != _locationPlugin) {
  170. _locationPlugin.startLocation();
  171. }
  172. }
  173. }
  174. @override
  175. void dispose() {
  176. ///移除定位监听
  177. if (null != _locationListener) {
  178. _locationListener.cancel();
  179. }
  180. ///销毁定位
  181. if (null != _locationPlugin) {
  182. _locationPlugin.destroy();
  183. }
  184. super.dispose();
  185. }
  186. String sortType = "create_time";
  187. @override
  188. Widget build(BuildContext context) {
  189. double width = MediaQuery.of(context).size.width;
  190. double height = MediaQuery.of(context).size.height;
  191. return Container(
  192. child: ChangeNotifierProvider<BaseListProvider<Records>>(
  193. create: (_) => provider,
  194. child: Scaffold(
  195. appBar: MyAppBar(
  196. centerTitle: "选专家",
  197. isFun: true,
  198. fun: () {
  199. Navigator.popUntil(context, ModalRoute.withName('/home'));
  200. },
  201. actions: <Widget>[
  202. // FlatButton(
  203. // child: Text("下一步"),
  204. // textColor: Colours.dark_text,
  205. // highlightColor: Colors.transparent,
  206. // onPressed: () {
  207. // if (checkId.isNotEmpty && checkId != null) {
  208. // if (dataTable != "2") {
  209. // NavigatorUtils.push(
  210. // context, "${BbsRouter.expertDetail}?id=$checkId");
  211. // } else {
  212. // // 绑定专家
  213. // generateRoom(checkId);
  214. // }
  215. // } else {
  216. // toasts("请选择专家");
  217. // }
  218. // },
  219. // )
  220. ],
  221. ),
  222. body: Container(
  223. child: Stack(
  224. children: <Widget>[
  225. Column(
  226. children: <Widget>[
  227. Container(
  228. height: ScreenUtil().setWidth(140),
  229. ),
  230. Expanded(
  231. flex: 1,
  232. child: Consumer<BaseListProvider<Records>>(
  233. builder: (_, provider, __) {
  234. return MyListView(
  235. key: Key('expert_list'),
  236. pageSize: 10,
  237. itemCount: provider.list.length,
  238. stateType: provider.stateType,
  239. onRefresh: _onRefresh,
  240. loadMore: _loadMore,
  241. hasMore: provider.hasMore,
  242. itemBuilder: (_, index) {
  243. return ExpertListWidget(
  244. changeState: (params, id) {
  245. setState(() {
  246. indexNowConst = params;
  247. checkId = id;
  248. if (dataTable != "2") {
  249. NavigatorUtils.push(
  250. context, "${BbsRouter.expertDetail}?id=$checkId");
  251. } else {
  252. // 绑定专家
  253. generateRoom(checkId);
  254. }
  255. });
  256. },
  257. indexNow: indexNowConst,
  258. checkIdConst: checkId,
  259. item: provider.list[index],
  260. index: index);
  261. },
  262. );
  263. }))
  264. ],
  265. ),
  266. !sortBool
  267. ? Positioned(
  268. top: ScreenUtil().setWidth(140),
  269. left: 0,
  270. child: GestureDetector(
  271. onTap: (){
  272. setState(() {
  273. sortBool = true;
  274. });
  275. },
  276. child: Container(
  277. width: width,
  278. height: height,
  279. color: Color.fromRGBO(0, 0, 0, 0.5)),
  280. )
  281. )
  282. : Container(child: null),
  283. Positioned(
  284. top: 0,
  285. left: 0,
  286. child: GestureDetector (
  287. onTap: () async{
  288. SharedPreferences prefs = await SharedPreferences.getInstance();
  289. prefs.remove("expertName");
  290. prefs.remove("expertFee");
  291. if (dataTable != "2") {
  292. NavigatorUtils.push(context, "${BbsRouter.buyService}?id=");
  293. } else {
  294. // 绑定专家
  295. generateRoom(null);
  296. }
  297. },
  298. child: Container(
  299. width: width,
  300. height: ScreenUtil().setWidth(70),
  301. decoration: BoxDecoration(
  302. border: Border(
  303. bottom: BorderSide(width: 0.5, color: Colours.line),
  304. ),
  305. ),
  306. padding: EdgeInsets.only(
  307. left: ScreenUtil().setWidth(15),
  308. right: ScreenUtil().setWidth(15)),
  309. child: Row(children: <Widget>[
  310. Container(
  311. padding:
  312. EdgeInsets.only(right: ScreenUtil().setWidth(10)),
  313. child: LoadAssetImage(
  314. // image: AssetImage(i['img']),
  315. "tab_first/zhiding",
  316. width: ScreenUtil().setWidth(36),
  317. height: ScreenUtil().setWidth(36),
  318. // alignment: Alignment.centerLeft,
  319. ),
  320. ),
  321. Container(
  322. child:Column(
  323. crossAxisAlignment: CrossAxisAlignment.start,
  324. mainAxisAlignment: MainAxisAlignment.center,
  325. children: <Widget>[
  326. Row(
  327. children: <Widget>[
  328. Text(
  329. "平台指定专家",
  330. style: TextStyle(
  331. fontSize: ScreenUtil().setSp(14)),
  332. textAlign: TextAlign.start,
  333. ),
  334. Text(
  335. dataTable != "2" ? "¥$apiExpertFee" : "",
  336. style: TextStyle(
  337. color: Color(0xffff0000),
  338. fontSize: ScreenUtil().setSp(14)),
  339. textAlign: TextAlign.start,
  340. ),
  341. ],
  342. ),
  343. SizedBox(
  344. height:5
  345. ),
  346. Text(
  347. "平台根据问题和品牌自动指定优质专家",
  348. style: TextStyle(
  349. color: Color(0xff999999),
  350. fontSize: ScreenUtil().setSp(14)),
  351. textAlign: TextAlign.start,
  352. ),
  353. ],
  354. ),
  355. )
  356. ]),
  357. ),
  358. ),
  359. ),
  360. Positioned(
  361. left: 0,
  362. top: ScreenUtil().setWidth(70),
  363. child: Container(
  364. padding: EdgeInsets.symmetric(horizontal: 0),
  365. child: Container(
  366. width: width,
  367. height: ScreenUtil().setWidth(70),
  368. decoration: BoxDecoration(
  369. border: Border(
  370. bottom: BorderSide(width: 0.5, color: Colours.line),
  371. ),
  372. ),
  373. padding: EdgeInsets.only(
  374. left: ScreenUtil().setWidth(15),
  375. right: ScreenUtil().setWidth(15)),
  376. child: Row(
  377. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  378. children: <Widget>[
  379. Container(
  380. child: Row(children: <Widget>[
  381. Container(
  382. padding: EdgeInsets.only(
  383. right: ScreenUtil().setWidth(10)),
  384. child: LoadAssetImage(
  385. // image: AssetImage(i['img']),
  386. "tab_first/tuijian",
  387. width: ScreenUtil().setWidth(36),
  388. height: ScreenUtil().setWidth(36),
  389. // alignment: Alignment.centerLeft,
  390. ),
  391. ),
  392. Text(
  393. "系统推荐专家",
  394. style: TextStyle(
  395. fontSize: ScreenUtil().setSp(15)),
  396. textAlign: TextAlign.start,
  397. ),
  398. ]),
  399. ),
  400. GestureDetector(
  401. onTap: () {
  402. print("7898");
  403. setState(() {
  404. sortBool = !sortBool;
  405. });
  406. },
  407. child: sortBool
  408. ? Container(
  409. child: Row(children: <Widget>[
  410. Text(
  411. sortName,
  412. style: TextStyle(
  413. fontSize: ScreenUtil().setSp(15)),
  414. textAlign: TextAlign.start,
  415. ),
  416. Container(
  417. padding: EdgeInsets.only(top: 3),
  418. child: Icon(
  419. Icons.keyboard_arrow_down,
  420. size: 26.0,
  421. ),
  422. )
  423. ]),
  424. )
  425. : Container(
  426. child: Row(children: <Widget>[
  427. Text(
  428. sortName,
  429. style: TextStyle(
  430. color: Color(0xff01A4FF),
  431. fontSize: ScreenUtil().setSp(15)),
  432. textAlign: TextAlign.start,
  433. ),
  434. Container(
  435. padding: EdgeInsets.only(top: 3),
  436. child: Icon(
  437. Icons.keyboard_arrow_up,
  438. size: 26.0,
  439. color: Color(0xff01A4FF),
  440. ),
  441. )
  442. ]),
  443. ),
  444. ),
  445. ],
  446. )),
  447. )),
  448. !sortBool
  449. ? Positioned(
  450. top: ScreenUtil().setWidth(140),
  451. left: 0,
  452. child: Container(
  453. width: width,
  454. color: ThemeUtils.getDialogTextFieldColor(context),
  455. padding: EdgeInsets.only(
  456. left: ScreenUtil().setWidth(15),
  457. right: ScreenUtil().setWidth(15),
  458. bottom: ScreenUtil().setWidth(10)),
  459. child: Column(
  460. crossAxisAlignment: CrossAxisAlignment.start,
  461. children: sortListChiose.asMap().keys.map((index) {
  462. return InkWell(
  463. onTap: () {
  464. print("666");
  465. setState(() {
  466. sortBool = true;
  467. sortName = sortListChiose[index];
  468. if (index == 0) {
  469. sortNum=0;
  470. lat = null;
  471. lng = null;
  472. sortType = "adopt_counts";
  473. _onRefresh();
  474. } else if (index == 1) {
  475. sortNum=1;
  476. lat = null;
  477. lng = null;
  478. sortType = "service_counts";
  479. _onRefresh();
  480. } else if (index == 2) {
  481. sortNum=2;
  482. lat = null;
  483. lng = null;
  484. sortType = "average_score";
  485. _onRefresh();
  486. }else if (index == 3){
  487. sortNum=3;
  488. getLocation();
  489. }
  490. indexNowConst = 99999;
  491. checkId = "";
  492. });
  493. },
  494. child: Container(
  495. width: width,
  496. padding: EdgeInsets.only(
  497. bottom: ScreenUtil().setWidth(10),
  498. top: ScreenUtil().setWidth(5)),
  499. decoration: BoxDecoration(
  500. border: Border(
  501. bottom: BorderSide(
  502. width: 0.5, color: Colours.line),
  503. ),
  504. ),
  505. child: Row(
  506. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  507. children: <Widget>[
  508. Text(
  509. sortListChiose[index],
  510. style: TextStyle(
  511. color: sortNum == index?Color(0xffff0000):Color(0xff666666),
  512. fontSize: ScreenUtil().setSp(16)),
  513. textAlign: TextAlign.start,
  514. ),
  515. sortNum == index?Text(
  516. "√",
  517. style: TextStyle(
  518. color: sortNum == index?Color(0xffff0000):Colors.transparent,
  519. fontSize: ScreenUtil().setSp(20)),
  520. textAlign: TextAlign.start,
  521. ):Container(child: null,),
  522. ],
  523. )
  524. ),
  525. );
  526. }).toList(),
  527. )))
  528. : Container(child: null),
  529. ],
  530. ))),
  531. ));
  532. }
  533. Future _onRefresh() async {
  534. _page = 1;
  535. await presenter.getExpertList(_page, sortType, int.parse(widget.id),lat,lng);
  536. // await presenter.getExpertList(_page,sortType,int.parse(widget.id));
  537. }
  538. Future _loadMore() async {
  539. _page++;
  540. await presenter.getExpertList(_page, sortType, int.parse(widget.id),lat,lng);
  541. }
  542. @override
  543. ExpertListPresenter createPresenter() {
  544. return ExpertListPresenter();
  545. }
  546. }
  547. class ExpertListWidget extends StatelessWidget {
  548. ExpertListWidget(
  549. {Key key,
  550. this.changeState,
  551. this.indexNow,
  552. this.checkIdConst,
  553. this.item,
  554. this.index})
  555. : super(key: key);
  556. int indexNow;
  557. String checkFalse = "tab_first/check_false";
  558. String checkTrue = "tab_first/check_true";
  559. String checkIdConst;
  560. Function changeState;
  561. dynamic item;
  562. int index;
  563. getLevel(level){
  564. String img;
  565. if(level == 1){
  566. img = "L1@2x";
  567. }else if (level == 2){
  568. img = "L2@2x";
  569. }else if (level == 3){
  570. img = "L3@2x";
  571. }else if (level == 4){
  572. img = "L4@2x";
  573. }else if (level == 5){
  574. img = "L5@2x";
  575. }
  576. return img;
  577. }
  578. @override
  579. Widget build(BuildContext context) {
  580. double width = MediaQuery.of(context).size.width;
  581. return InkWell(
  582. onTap: () {
  583. changeState(index, item.userId.toString());
  584. print(indexNow);
  585. print(66663);
  586. print(item.userId);
  587. },
  588. child: Container(
  589. // height: 20,
  590. padding: EdgeInsets.only(
  591. bottom: ScreenUtil().setWidth(8), top: ScreenUtil().setWidth(10)),
  592. margin: EdgeInsets.only(left: ScreenUtil().setWidth(10)),
  593. decoration: BoxDecoration(
  594. border: Border(
  595. bottom: BorderSide(width: 0.5, color: Colours.line),
  596. ),
  597. ),
  598. child: Row(
  599. crossAxisAlignment: CrossAxisAlignment.start,
  600. children: <Widget>[
  601. // Container(
  602. // padding: EdgeInsets.only(
  603. // top: ScreenUtil().setWidth(10),
  604. // left: ScreenUtil().setWidth(5),
  605. // right: ScreenUtil().setWidth(5),
  606. // bottom: ScreenUtil().setWidth(10)),
  607. // child: LoadAssetImage(
  608. // // image: AssetImage(i['img']),
  609. // indexNow == index ? checkTrue : checkFalse,
  610. // width: ScreenUtil().setWidth(20),
  611. // height: ScreenUtil().setWidth(20),
  612. // // alignment: Alignment.centerLeft,
  613. // ),
  614. // ),
  615. Expanded(
  616. child: Row(
  617. crossAxisAlignment: CrossAxisAlignment.start,
  618. children: <Widget>[
  619. Container(
  620. margin: EdgeInsets.only(
  621. left: ScreenUtil().setWidth(5),
  622. right: ScreenUtil().setWidth(10),
  623. top: ScreenUtil().setWidth(5)),
  624. decoration: BoxDecoration(
  625. borderRadius:
  626. BorderRadius.circular(ScreenUtil().setWidth(27)),
  627. ),
  628. child: Container(
  629. width: ScreenUtil().setWidth(50),
  630. height: ScreenUtil().setWidth(70),
  631. child: Stack(
  632. children: <Widget>[
  633. Container(
  634. padding: EdgeInsets.only(left:ScreenUtil().setWidth(3)),
  635. child: ClipRRect(
  636. borderRadius: BorderRadius.all(
  637. Radius.circular(50)),
  638. child: LoadNetworkImage(
  639. // image: AssetImage(i['img']),
  640. item.avatarUrl,
  641. width: ScreenUtil().setWidth(44),
  642. height: ScreenUtil().setWidth(44),
  643. // alignment: Alignment.centerLeft,
  644. ),
  645. ),
  646. ),
  647. Positioned(
  648. top:ScreenUtil().setWidth(34),
  649. left: 0,
  650. child: LoadAssetImage(
  651. // image: AssetImage(i['img']),
  652. getLevel(item.expertLevel),
  653. width: ScreenUtil().setWidth(50),
  654. height: ScreenUtil().setWidth(13),
  655. // alignment: Alignment.centerLeft,
  656. ),
  657. )
  658. ],
  659. ),
  660. )
  661. ),
  662. Expanded(
  663. child: Container(
  664. padding: EdgeInsets.only(
  665. right: ScreenUtil().setWidth(15)),
  666. child: Column(
  667. crossAxisAlignment: CrossAxisAlignment.start,
  668. children: <Widget>[
  669. Container(
  670. child: Row(
  671. mainAxisAlignment:
  672. MainAxisAlignment.spaceBetween,
  673. children: <Widget>[
  674. Row(
  675. crossAxisAlignment:
  676. CrossAxisAlignment.center,
  677. children: <Widget>[
  678. Container(
  679. width: width * 0.3,
  680. // width: width * 0.2,
  681. child: Text(
  682. item.name ?? "",
  683. style: TextStyle(
  684. fontSize:
  685. ScreenUtil().setSp(18)),
  686. textAlign: TextAlign.start,
  687. maxLines: 1,
  688. overflow: TextOverflow.ellipsis,
  689. ),
  690. ),
  691. // Container(
  692. // padding: EdgeInsets.only(left: 5,right:5),
  693. // width: width * 0.2,
  694. // child: Text(
  695. // item.proficiencyBrandName ?? "",
  696. // style: TextStyle(
  697. // color: Color(0xff666666),
  698. // fontSize:
  699. // ScreenUtil().setSp(14)),
  700. // textAlign: TextAlign.start,
  701. // maxLines: 1,
  702. // overflow: TextOverflow.ellipsis,
  703. // ),
  704. // ),
  705. // item.platformInvitedFlag==0?Container(
  706. // padding:EdgeInsets.only(left:5,right:5),
  707. // margin: EdgeInsets.only(right:5),
  708. // // color:Colors.red,
  709. // decoration: BoxDecoration(
  710. // borderRadius: BorderRadius.circular(1.0),
  711. // border: Border.all(
  712. // width:0.5,
  713. // color:Color(0xffB0E2FF),
  714. // ),
  715. // ),
  716. // child:Text(
  717. // "特邀专家",
  718. // style: TextStyle(
  719. // color:Color(0xff01A7FF),
  720. // fontSize:ScreenUtil().setSp(12)
  721. // ),
  722. // textAlign:TextAlign.center,
  723. // ),
  724. // ):Container(child: null,)
  725. ]),
  726. // Container(
  727. // child: Text(
  728. // "${item.averageScore ?? 0}分",
  729. // style: TextStyle(
  730. // color: Colors.red,
  731. // fontSize: ScreenUtil().setSp(14)),
  732. // textAlign: TextAlign.end,
  733. // ),
  734. // )
  735. StarItemShow(
  736. starRating: item.averageScore!=null?double.parse(item.averageScore.toString()):0.0,
  737. ),
  738. ])),
  739. Container(
  740. child: Text(
  741. "擅长品牌:"+(item.proficiencyBrandName ?? ''),
  742. // "擅长:"+(item.proficiency ?? ''),
  743. style: TextStyle(
  744. color: Color(0xff999999),
  745. fontSize: ScreenUtil().setSp(14)),
  746. textAlign: TextAlign.start,
  747. maxLines: 1,
  748. overflow: TextOverflow.ellipsis,
  749. ),
  750. ),
  751. item.platformInvitedFlag==0?Container(
  752. padding:EdgeInsets.only(left:5,right:5),
  753. margin: EdgeInsets.only(right:5,top:5),
  754. // color:Colors.red,
  755. decoration: BoxDecoration(
  756. borderRadius: BorderRadius.circular(1.0),
  757. border: Border.all(
  758. width:0.5,
  759. color:Color(0xffB0E2FF),
  760. ),
  761. ),
  762. child:Text(
  763. "特邀专家",
  764. style: TextStyle(
  765. color:Color(0xff01A7FF),
  766. fontSize:ScreenUtil().setSp(12)
  767. ),
  768. textAlign:TextAlign.center,
  769. ),
  770. ):Container(child: null,),
  771. Container(
  772. margin: EdgeInsets.only(top: 6),
  773. decoration: BoxDecoration(
  774. border: Border(
  775. top: BorderSide(
  776. width: 0.5, color: Colours.line),
  777. ),
  778. ),
  779. child: Row(children: <Widget>[
  780. Container(
  781. padding: EdgeInsets.only(right: 5),
  782. child: Text(
  783. dataTable != "2" ? "¥${item.serviceFee ?? 0}" : "",
  784. style: TextStyle(
  785. color: Colors.red,
  786. fontSize: ScreenUtil().setSp(16)),
  787. textAlign: TextAlign.start,
  788. ),
  789. ),
  790. Container(
  791. child: Text(
  792. "服务次数${item.serviceCounts ?? 0}",
  793. style: TextStyle(
  794. color: Color(0xff666666),
  795. fontSize: ScreenUtil().setSp(14)),
  796. textAlign: TextAlign.start,
  797. ),
  798. )
  799. ]))
  800. ],
  801. )))
  802. ]),
  803. ),
  804. ],
  805. ),
  806. ),
  807. );
  808. }
  809. }