123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026 |
- import 'package:flutter/material.dart';
- import 'package:liftmanager/res/gaps.dart';
- import 'package:liftmanager/net/api_service.dart';
- import 'package:liftmanager/utils/toast.dart';
- import 'package:liftmanager/widgets/app_bar.dart';
- import 'package:liftmanager/internal/search/search_router.dart';
- import 'package:liftmanager/widgets/app_search_bar.dart';
- import 'package:liftmanager/res/resources.dart';
- import 'package:liftmanager/routers/fluro_navigator.dart';
- import 'package:liftmanager/widgets/load_image.dart';
- import 'package:liftmanager/internal/bbs/bbs_router.dart';
- import 'dart:math' as math;
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'dart:convert';
- import 'package:liftmanager/internal/bbs/model/expert_model.dart';
- import 'package:liftmanager/utils/url.dart';
- import 'package:liftmanager/mvp/base_page_state.dart';
- import 'package:liftmanager/internal/bbs/model/expert_comment_model.dart' as comment;
- import 'package:liftmanager/internal/bbs/presenter/expert_comment_list_presenter.dart';
- import 'package:liftmanager/utils/time_format.dart';
- import 'package:liftmanager/internal/search/presenter/base_list_provider.dart';
- import 'package:liftmanager/widgets/state_layout.dart';
- import 'package:provider/provider.dart';
- import 'package:liftmanager/widgets/my_refresh_list.dart';
- import 'package:liftmanager/utils/url.dart';
- import 'package:shared_preferences/shared_preferences.dart';
- import 'package:liftmanager/utils/theme_utils.dart';
- import 'package:liftmanager/widgets/star_item.dart';
- class ExpertDetail extends StatefulWidget {
- ExpertDetail(this.id);
- final String id;
-
- @override
- ExpertDetailState createState() => ExpertDetailState();
- }
- class ExpertDetailState extends BasePageState<ExpertDetail,ExpertCommentListPresenter> {
- BaseListProvider<comment.Records> provider = BaseListProvider<comment.Records>();
- // ExpertListState({Key key}) : super(key: key);
- ScrollController _scrollController;
- int listLength = 0;
- List<String> labelList = ["特邀专家","回复及时"];
- @override
- void initState() {
- super.initState();
- getExpertDetail();
- _onRefresh();
- }
- bool _hasData = false;
- bool kaiType = false;
- int _page = 1;
- Records detailObj;
- Future getExpertDetail() async {
- await NewApiService().getExpertDetail(widget.id,onSuccess: (res) {
-
- if (res != null) {
- _hasData = true;
- detailObj = res;
- print(123456);
- print(jsonEncode(res));
- setState(() {});
- }
- }, onError: (code, msg) {
- toasts(msg);
- });
- }
- @override
- Widget build(BuildContext context) {
- double width = MediaQuery.of(context).size.width;
- double height = MediaQuery.of(context).size.height;
- return ChangeNotifierProvider<BaseListProvider<comment.Records>>(
- create: (_) => provider,
- child:Scaffold(
- appBar: MyAppBar(
- actions:<Widget>[
- // FlatButton(
- // child: Icon(
- // IconData(
- // 0xe6f4,
- // fontFamily:"myfont"
- // ),
- // size: 26.0,
- // color:Color.fromRGBO(255, 255, 255, 1),
- // ),
- // textColor: Colours.dark_text,
- // highlightColor: Colors.transparent,
- // onPressed: () {
-
-
- // },
- // )
- ],
- ),
- body:Container(
- child:_hasData? Stack(
- children: <Widget>[
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- // provider.list.length<1?expertDetailWisget():Container(child: null,),
- expertDetailWisget(),
- listLength==0?
- Expanded(
- child: ListView(
- children: <Widget>[
- Column(
- children:<Widget>[
- Container(
- padding: EdgeInsets.only(left:ScreenUtil().setWidth(20),right:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10),bottom:ScreenUtil().setWidth(10)),
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(width: 0.5, color: Colours.line),
- ),
- ),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.start,
- children:<Widget>[
- Container(
- padding: EdgeInsets.only(right:5),
- child: LoadAssetImage(
- // image: AssetImage(i['img']),
- "expert_three",
- width: ScreenUtil().setWidth(20),
- height: ScreenUtil().setWidth(20),
- // alignment: Alignment.centerLeft,
- ),
- ),
- Text(
- "专家简介",
- style: TextStyle(
- fontSize:ScreenUtil().setSp(17)
- ),
- textAlign:TextAlign.start,
- ),
- // Text(
- // "奥的斯",
- // style: TextStyle(
- // color:Color(0xff999999),
- // fontSize:18
- // ),
- // textAlign:TextAlign.start,
- // ),
- ]
- ),
- ),
- !kaiType?Container(
- width:width,
- padding: EdgeInsets.only(left:ScreenUtil().setWidth(20),right:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10)),
-
- child: Text(
- detailObj.introduction??'暂无',
- style: TextStyle(
- color:Color(0xff999999),
- fontSize:ScreenUtil().setSp(14)
- ),
- textAlign:TextAlign.start,
- maxLines: 2,
- overflow:TextOverflow.ellipsis,
- ),
- ):Container(
- width:width,
- padding: EdgeInsets.only(left:ScreenUtil().setWidth(20),right:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10)),
-
- child: Text(
- detailObj.introduction??'暂无',
- style: TextStyle(
- color:Color(0xff999999),
- fontSize:ScreenUtil().setSp(14)
- ),
- textAlign:TextAlign.start,
- ),
- ),
- // !kaiType?
- InkWell(
- onTap: (){
- setState(() {
- kaiType = !kaiType;
- });
- },
- child: Container(
- padding: EdgeInsets.only(right:20,bottom:10),
- width: width,
- child: Text(
- !kaiType?"[展开]":"[收起]",
- style: TextStyle(
- color:Color(0xFF0287FF),
- fontSize:ScreenUtil().setSp(14)
- ),
- textAlign:TextAlign.end,
- ),
- ),
- )
- // :Container(child: null,)
- ,
- Container(
- height:5,
- color: ThemeUtils.getDialogTextFieldColor(context),
- child: null,
- ),
- Container(
- padding: EdgeInsets.only(left:ScreenUtil().setWidth(20),right:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10),bottom:ScreenUtil().setWidth(10)),
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(width: 0.5, color: Colours.line),
- ),
- ),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.start,
- children:<Widget>[
- Container(
- padding: EdgeInsets.only(right:5),
- child: LoadAssetImage(
- // image: AssetImage(i['img']),
- "expert_two",
- width: ScreenUtil().setWidth(20),
- height: ScreenUtil().setWidth(20),
- // alignment: Alignment.centerLeft,
- ),
- ),
- Text(
- "执业经历",
- style: TextStyle(
- fontSize:ScreenUtil().setSp(17)
- ),
- textAlign:TextAlign.start,
- ),
- // Text(
- // "奥的斯",
- // style: TextStyle(
- // color:Color(0xff999999),
- // fontSize:18
- // ),
- // textAlign:TextAlign.start,
- // ),
- ]
- ),
- ),
- Container(
- width:width,
- padding: EdgeInsets.only(left:ScreenUtil().setWidth(20),right:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10),bottom:ScreenUtil().setWidth(10)),
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(width: 5, color: ThemeUtils.getDialogTextFieldColor(context)),
- ),
- ),
- child: Text(
- detailObj.experience??'暂无',
- style: TextStyle(
- color:Color(0xff999999),
- fontSize:ScreenUtil().setSp(14)
- ),
- textAlign:TextAlign.start,
- ),
- ),
- Container(
- padding: EdgeInsets.only(left:ScreenUtil().setWidth(20),right:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10),bottom:ScreenUtil().setWidth(10)),
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(width: 0.5, color: Colours.line),
- ),
- ),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.start,
- children:<Widget>[
- Container(
- padding: EdgeInsets.only(right:5),
- child: LoadAssetImage(
- // image: AssetImage(i['img']),
- "expert_one",
- width: ScreenUtil().setWidth(20),
- height: ScreenUtil().setWidth(20),
- // alignment: Alignment.centerLeft,
- ),
- ),
- Text(
- "用户评价",
- style: TextStyle(
- fontSize:ScreenUtil().setSp(17)
- ),
- textAlign:TextAlign.start,
- ),
- ]
- ),
- ),
- Center(
-
- child: Container(
- padding: EdgeInsets.only(top:10),
- child: Text(
- '无数据',
- style: TextStyle(
- color:Color(0xff999999),
- fontSize:ScreenUtil().setSp(14)
- ),
- textAlign:TextAlign.start,
- ),
- )
- ),
- ]
- )
- ],
- ),
- )
- :Container(child: null,),
- listLength!=0?Expanded(
- flex: 1,
- child: Consumer<BaseListProvider<comment.Records>>(
- builder: (_, provider, __) {
- return MyListView(
- key: Key('expert_comment_list'),
- pageSize:4,
- normal:false,
- itemCount: provider.list.length,
- stateType: provider.stateType,
- onRefresh: _onRefresh,
- loadMore: _loadMore,
- hasMore: provider.hasMore,
- itemBuilder: (_, index) {
- return Container(
- child: Column(
- children: <Widget>[
- index==0?
- Column(
- children:<Widget>[
- Container(
- padding: EdgeInsets.only(left:ScreenUtil().setWidth(20),right:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10),bottom:ScreenUtil().setWidth(10)),
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(width: 0.5, color: Colours.line),
- ),
- ),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.start,
- children:<Widget>[
- Container(
- padding: EdgeInsets.only(right:5),
- child: LoadAssetImage(
- // image: AssetImage(i['img']),
- "expert_three",
- width: ScreenUtil().setWidth(20),
- height: ScreenUtil().setWidth(20),
- // alignment: Alignment.centerLeft,
- ),
- ),
- Text(
- "专家简介",
- style: TextStyle(
- fontSize:ScreenUtil().setSp(17)
- ),
- textAlign:TextAlign.start,
- ),
- // Text(
- // "奥的斯",
- // style: TextStyle(
- // color:Color(0xff999999),
- // fontSize:18
- // ),
- // textAlign:TextAlign.start,
- // ),
- ]
- ),
- ),
- !kaiType?Container(
- width:width,
- padding: EdgeInsets.only(left:ScreenUtil().setWidth(20),right:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10)),
-
- child: Text(
- detailObj.introduction??'暂无',
- style: TextStyle(
- color:Color(0xff999999),
- fontSize:ScreenUtil().setSp(14)
- ),
- textAlign:TextAlign.start,
- maxLines: 2,
- overflow:TextOverflow.ellipsis,
- ),
- ):Container(
- width:width,
- padding: EdgeInsets.only(left:ScreenUtil().setWidth(20),right:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10)),
-
- child: Text(
- detailObj.introduction??'暂无',
- style: TextStyle(
- color:Color(0xff999999),
- fontSize:ScreenUtil().setSp(14)
- ),
- textAlign:TextAlign.start,
- ),
- ),
- !kaiType?
- InkWell(
- onTap: (){
- setState(() {
- kaiType = true;
- });
- },
- child: Container(
- padding: EdgeInsets.only(right:20,bottom:10),
- width: width,
- child: Text(
- "[展开]",
- style: TextStyle(
- color:Color(0xFF0287FF),
- fontSize:ScreenUtil().setSp(14)
- ),
- textAlign:TextAlign.end,
- ),
- ),
- )
- :Container(child: null,),
- Container(
- padding: EdgeInsets.only(left:ScreenUtil().setWidth(20),right:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10),bottom:ScreenUtil().setWidth(10)),
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(width: 0.5, color: Colours.line),
- ),
- ),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.start,
- children:<Widget>[
- Container(
- padding: EdgeInsets.only(right:5),
- child: LoadAssetImage(
- // image: AssetImage(i['img']),
- "expert_two",
- width: ScreenUtil().setWidth(20),
- height: ScreenUtil().setWidth(20),
- // alignment: Alignment.centerLeft,
- ),
- ),
- Text(
- "执业经历",
- style: TextStyle(
- fontSize:ScreenUtil().setSp(17)
- ),
- textAlign:TextAlign.start,
- ),
- // Text(
- // "奥的斯",
- // style: TextStyle(
- // color:Color(0xff999999),
- // fontSize:18
- // ),
- // textAlign:TextAlign.start,
- // ),
- ]
- ),
- ),
- Container(
- width:width,
- padding: EdgeInsets.only(left:ScreenUtil().setWidth(20),right:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10),bottom:ScreenUtil().setWidth(10)),
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(width: 5, color: ThemeUtils.getDialogTextFieldColor(context)),
- ),
- ),
- child: Text(
- detailObj.proficiency??'',
- style: TextStyle(
- color:Color(0xff999999),
- fontSize:ScreenUtil().setSp(14)
- ),
- textAlign:TextAlign.start,
- ),
- ),
- Container(
- padding: EdgeInsets.only(left:ScreenUtil().setWidth(20),right:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10),bottom:ScreenUtil().setWidth(10)),
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(width: 0.5, color: Colours.line),
- ),
- ),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.start,
- children:<Widget>[
- Container(
- padding: EdgeInsets.only(right:5),
- child: LoadAssetImage(
- // image: AssetImage(i['img']),
- "expert_one",
- width: ScreenUtil().setWidth(20),
- height: ScreenUtil().setWidth(20),
- // alignment: Alignment.centerLeft,
- ),
- ),
- Text(
- "用户评价",
- style: TextStyle(
- fontSize:ScreenUtil().setSp(17)
- ),
- textAlign:TextAlign.start,
- ),
- ]
- ),
- ),
-
- ]
- )
- :Container(child:null),
- Container(
- child:Container(
- padding: EdgeInsets.only(top:ScreenUtil().setWidth(10),left:ScreenUtil().setWidth(20),right:ScreenUtil().setWidth(20),bottom:ScreenUtil().setWidth(10)),
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(width: 0.5, color: Colours.line),
- ),
- ),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children:<Widget>[
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children:<Widget>[
- Row(
-
- children:<Widget>[
- Text(
- provider.list[index].mobile!=null?(provider.list[index].mobile).replaceRange(3,7,"****"):"",
- style: TextStyle(
- color:Color(0xff666666),
- fontSize:ScreenUtil().setSp(16)
- ),
- textAlign:TextAlign.start,
- ),
- Container(
- width:6,
- child: null,
- ),
- // provider.list[index].comment!=""?
- // Text(
- // "采纳",
- // style: TextStyle(
- // color:Colors.red,
- // fontSize:ScreenUtil().setSp(14)
- // ),
- // textAlign:TextAlign.start,
- // )
- // :
- // Text(""),
- ]
- ),
- Text(
- provider
- .list[index]
- .createTime!=null?DateUtils.instance
- .getFormartData(
- timeSamp: provider
- .list[index]
- .createTime,
- format: "yyyy-MM-dd"):'',
- style: TextStyle(
- color:Color(0xff999999),
- fontSize:ScreenUtil().setSp(14)
- ),
- textAlign:TextAlign.start,
- ),
-
- ]
- ),
- Container(
- child:Text(
- provider.list[index].comment??'',
- style: TextStyle(
- color:Color(0xff333333),
- fontSize:ScreenUtil().setSp(14)
- ),
- textAlign:TextAlign.start,
- ),
- ),
- Container(
- height:ScreenUtil().setWidth(10),
- decoration: BoxDecoration(
- color: Colors.red,
- ),
-
- child:Transform.rotate(
- origin: Offset(ScreenUtil().setWidth(25), ScreenUtil().setWidth(20)),
- angle: math.pi/2,
- child:CustomPaint(
- painter:ChatBoxPainter(
- color:Color(0xffF8F8F8),
- width:ScreenUtil().setWidth(10),
- height:ScreenUtil().setWidth(20)
- )
- )
- )
- ),
- Container(
- padding: EdgeInsets.only(top:ScreenUtil().setWidth(10),bottom:ScreenUtil().setWidth(10),left:ScreenUtil().setWidth(5),right:ScreenUtil().setWidth(5)),
- color: Color(0xffF8F8F8),
- child:Text(
- "问题描述:"+(provider.list[index].expression!=null?provider.list[index].expression:""),
- style: TextStyle(
- color:Color(0xff999999),
- fontSize:ScreenUtil().setSp(14)
- ),
- textAlign:TextAlign.start,
- ),
- ),
- ]
- ),
- )
- )
- ],
- ),
- );
-
- },
- );
- })):Container(child: null,),
-
- Container(
- height:ScreenUtil().setWidth(80),
- ),
-
- ],
- ),
- Positioned(
- bottom:0,
- left:0,
- child:Container(
- width: width,
- padding: EdgeInsets.only(top:ScreenUtil().setWidth(15),bottom:ScreenUtil().setWidth(15),left:ScreenUtil().setWidth(25),right:ScreenUtil().setWidth(25)),
- color:ThemeUtils.getDialogTextFieldColor(context),
- child: Container(
- height:ScreenUtil().setWidth(44),
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(ScreenUtil().setWidth(22)),
- gradient: const LinearGradient(
- colors: [Color(0xFF00D9FF), Color(0xFF0287FF)]),
- ),
- child: FlatButton(
- // padding: EdgeInsets.all(15.0),
- child: detailObj.serviceFee!=null?Text("线上咨询(¥${detailObj.serviceFee}元/次)"):Text("线上咨询(¥0元/次)"),
- textColor: Colors.white,
- onPressed: () {
- setExpertName(detailObj.name??"");
- setExpertFee(detailObj.serviceFee??0.0);
- NavigatorUtils.push(context, "${BbsRouter.buyService}?id=${widget.id}");
- },
- ),
- ),
- )
- )
- ],
- )
- :Center(
- child: Text("正在加载..."),
- )
- )
- ),
- );
- }
- getLevel(level){
- String img;
- if(level == 1){
- img = "L1@2x";
- }else if (level == 2){
- img = "L2@2x";
- }else if (level == 3){
- img = "L3@2x";
- }else if (level == 4){
- img = "L4@2x";
- }else if (level == 5){
- img = "L5@2x";
- }
- return img;
- }
- Widget expertDetailWisget (){
- double width = MediaQuery.of(context).size.width;
- double height = MediaQuery.of(context).size.height;
- return Column(
- children: <Widget>[
- Container(
- // height: ScreenUtil().setWidth(150),
- padding: EdgeInsets.only(bottom:10),
- decoration: BoxDecoration(
- gradient: const LinearGradient(
- colors: [Color(0xFF00D9FF), Color(0xFF0287FF)]),
- ),
- child:Column(
- children: <Widget>[
- Container(
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children:<Widget>[
- Container(
- margin: EdgeInsets.only(left:ScreenUtil().setWidth(10),right:ScreenUtil().setWidth(10),top:ScreenUtil().setWidth(5)),
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(ScreenUtil().setWidth(25)),
- ),
- child: Container(
- width: ScreenUtil().setWidth(50),
- height: ScreenUtil().setWidth(70),
- child: Stack(
- children: <Widget>[
- Container(
- padding: EdgeInsets.only(left:ScreenUtil().setWidth(3)),
- child: ClipRRect(
- borderRadius: BorderRadius.all(
- Radius.circular(50)),
- child: LoadNetworkImage(
- // image: AssetImage(i['img']),
- detailObj.avatarUrl,
- width: ScreenUtil().setWidth(44),
- height: ScreenUtil().setWidth(44),
- // alignment: Alignment.centerLeft,
- ),
- ),
- ),
- Positioned(
- top:ScreenUtil().setWidth(34),
- left: 0,
- child: LoadAssetImage(
- // image: AssetImage(i['img']),
- getLevel(detailObj.expertLevel),
- width: ScreenUtil().setWidth(50),
- height: ScreenUtil().setWidth(13),
- // alignment: Alignment.centerLeft,
- ),
- )
- ],
- ),
- )
-
- ),
- Expanded(
- child: Container(
- padding: EdgeInsets.only(right:ScreenUtil().setWidth(15)),
- child:Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- Row(mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: <Widget>[
- Text(
- detailObj.name??"",
- style: TextStyle(
- color:Colors.white,
- fontSize:ScreenUtil().setSp(18)
- ),
- ),
- StarItemShow(
- starRating: detailObj.averageScore!=null? double.parse(detailObj.averageScore.toString()):0.0,
- ),
- ],
- ),
-
- Text(
- "擅长品牌:" + detailObj.proficiencyBrandName??'',
- style: TextStyle(
- color:Colors.white,
- fontSize:ScreenUtil().setSp(14)
- ),
- // textAlign:TextAlign.start,
- ),
- detailObj.platformInvitedFlag==0?Container(
- padding:EdgeInsets.only(left:5,right:5),
- margin: EdgeInsets.only(right:5,top:5),
- // color:Colors.red,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(1.0),
- border: Border.all(
- width:0.5,
- color:Color(0xffB0E2FF),
- ),
- ),
- child:Text(
- "特邀专家",
- style: TextStyle(
- color:Colors.white,
- fontSize:ScreenUtil().setSp(12)
- ),
- textAlign:TextAlign.center,
- ),
- ):Container(child: null,),
- Row(
- children: <Widget>[
- Expanded(
- child: Container(
- padding:EdgeInsets.all(5),
- margin: EdgeInsets.only(right:5,top:5),
- // color:Colors.red,
- // decoration: BoxDecoration(
- // borderRadius: BorderRadius.circular(2.0),
- // border: Border.all(
- // width:0.5,
- // color:Color(0xffB0E2FF),
- // ),
- // color:Colors.white30,
- // ),
- child:Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- Icon(
- IconData(0xe7a6,
- fontFamily: "myfont"),
- size: 14.0,
- color: Color(0xffffffff),
- ),
- SizedBox(
- width: 5,
- ),
- Expanded(
- child: Container(
- // padding:EdgeInsets.all(5),
- // margin: EdgeInsets.only(right:5,top:5),
- // // color:Colors.red,
- // decoration: BoxDecoration(
- // borderRadius: BorderRadius.circular(2.0),
- // border: Border.all(
- // width:0.5,
- // color:Color(0xffB0E2FF),
- // ),
- // color:Colors.white30,
- // ),
- child: Text(
- // "detailObj",
- detailObj.address!=null?detailObj.address.split(",")[0]:"",
- style: TextStyle(
- color:Colors.white,
- fontSize:ScreenUtil().setSp(12)
- ),
- textAlign:TextAlign.left,
- // overflow:TextOverflow.ellipsis,
- ),
- )
- )
- ],
- )
- ),
- )
- ],
- ),
-
- ],
- )
- )
- )
- ]
- ),
- ),
- Container(
- padding:EdgeInsets.only(top:ScreenUtil().setWidth(10)),
- child:Row(
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.spaceAround,
- children:<Widget>[
- Container(
- child:Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- children:<Widget>[
- Text(
- detailObj.workDate!=null?detailObj.workDate.toString():"0",
- style: TextStyle(
- color:Colors.white,
- fontSize:ScreenUtil().setSp(16)
- ),
- textAlign:TextAlign.start,
- ),
- Text(
- "从业年数",
- style: TextStyle(
- color:Colors.white,
- fontSize:ScreenUtil().setSp(14)
- ),
- textAlign:TextAlign.start,
- ),
- ]
- )
- ),
- Container(
- child:Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- children:<Widget>[
- Text(
- detailObj.serviceCounts!=null?detailObj.serviceCounts.toString():"0",
- style: TextStyle(
- color:Colors.white,
- fontSize:ScreenUtil().setSp(16)
- ),
- textAlign:TextAlign.start,
- ),
- Text(
- "服务次数",
- style: TextStyle(
- color:Colors.white,
- fontSize:ScreenUtil().setSp(14)
- ),
- textAlign:TextAlign.start,
- ),
- ]
- )
- ),
- // Container(
- // child:Column(
- // crossAxisAlignment: CrossAxisAlignment.center,
- // children:<Widget>[
- // Text(
- // "99.9",
- // style: TextStyle(
- // color:Colors.white,
- // fontSize:ScreenUtil().setSp(16)
- // ),
- // textAlign:TextAlign.start,
- // ),
- // Text(
- // "好评率(%)",
- // style: TextStyle(
- // color:Colors.white,
- // fontSize:ScreenUtil().setSp(14)
- // ),
- // textAlign:TextAlign.start,
- // ),
- // ]
- // )
- // ),
- Container(
- child:Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- children:<Widget>[
- Text(
- detailObj.adoptCounts!=null?detailObj.adoptCounts.toString():"0",
- style: TextStyle(
- color:Colors.white,
- fontSize:ScreenUtil().setSp(16)
- ),
- textAlign:TextAlign.start,
- ),
- Text(
- "采纳次数",
- style: TextStyle(
- color:Colors.white,
- fontSize:ScreenUtil().setSp(14)
- ),
- textAlign:TextAlign.start,
- ),
- ]
- )
- ),
- ]
- )
- ),
-
- ],
- )
- ),
-
- ],
- );
- }
- @override
- void dispose() {
- super.dispose();
- }
- void setExpertName (String expertName)async{
- SharedPreferences prefs = await SharedPreferences.getInstance();
- prefs.setString("expertName", expertName);
-
- }
- void setExpertFee (double expertFee)async{
- SharedPreferences prefs = await SharedPreferences.getInstance();
- prefs.setDouble("expertFee", expertFee);
-
- }
- Future _onRefresh() async {
- _page = 1;
- await presenter.getExpertCommentList(_page,int.parse(widget.id),getLength: (length){
- setState(() {
- listLength = length;
- });
- });
- }
- Future _loadMore() async {
- _page++;
- await presenter.getExpertCommentList(_page,int.parse(widget.id),getLength: (length){
-
- });
- }
- @override
- ExpertCommentListPresenter createPresenter() {
- return ExpertCommentListPresenter();
- }
- }
- class ChatBoxPainter extends CustomPainter {
- ChatBoxPainter({@required this.width,@required this.height,@required this.color});
- final double width;
- final double height;
- final Color color;
- @override
- void paint(Canvas canvas, Size size) {
- Path path = Path()
- ..moveTo(0, height/2)
- ..lineTo(width, height)
- ..lineTo(width, 0)
- ..lineTo(0, height/2);
- Paint paint = Paint()
- ..style = PaintingStyle.fill
- ..color = color;
- canvas.drawPath(path,paint);
- }
- @override
- bool shouldRepaint(ChatBoxPainter oldDelegate) => false;
- @override
- bool shouldRebuildSemantics(ChatBoxPainter oldDelegate) => false;
- }
|