expert_list.dart 36 KB

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