expert_list.dart 36 KB

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