From 9e33172a0c03081f13be90281bf1dca6c52f00f4 Mon Sep 17 00:00:00 2001 From: zhang <494089941@qq.com> Date: Tue, 26 Jan 2021 16:10:12 +0800 Subject: [PATCH] remove smooth star rating pub remove some s**t code --- lib/constants/api.dart | 5 +- .../things_evaluate_page.dart | 50 ++++++++++--------- .../widget/fixed_evaluate_page.dart | 21 ++++++++ pubspec.lock | 7 --- pubspec.yaml | 2 - 5 files changed, 52 insertions(+), 33 deletions(-) create mode 100644 lib/pages/things_page/widget/fixed_evaluate_page.dart diff --git a/lib/constants/api.dart b/lib/constants/api.dart index cb4ebce6..539cb861 100644 --- a/lib/constants/api.dart +++ b/lib/constants/api.dart @@ -110,7 +110,10 @@ class _Manager { String get deleteAdvice => '/user/advice/falseDelete'; ///报事报修:取消订单 - String get reportRepairCancel => 'user/reportRepair/cancel'; + String get reportRepairCancel => '/user/reportRepair/cancel'; + + /// 报事报修:确认完成订单 + String get reportRepairComplete => '/user/reportRepair/completeOrder'; } class _Upload { diff --git a/lib/pages/things_page/things_evaluate_page/things_evaluate_page.dart b/lib/pages/things_page/things_evaluate_page/things_evaluate_page.dart index 2d769bae..c06b91f0 100644 --- a/lib/pages/things_page/things_evaluate_page/things_evaluate_page.dart +++ b/lib/pages/things_page/things_evaluate_page/things_evaluate_page.dart @@ -1,10 +1,11 @@ // Flutter imports: +import 'package:akuCommunity/base/base_style.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; // Package imports: import 'package:flutter_icons/flutter_icons.dart'; -import 'package:smooth_star_rating/smooth_star_rating.dart'; +import 'package:flutter_rating_bar/flutter_rating_bar.dart'; // Project imports: import 'package:akuCommunity/routers/page_routers.dart'; @@ -41,8 +42,7 @@ class _ThingsEvaluatePageState extends State { children: [ Text( '请您对本次服务进行评价', - style: TextStyle( - fontSize: 28.sp, color: Color(0xff999999)), + style: TextStyle(fontSize: 28.sp, color: Color(0xff999999)), ), SizedBox(height: 50.w), Row( @@ -50,23 +50,31 @@ class _ThingsEvaluatePageState extends State { children: [ Text( '综合评价', - style: TextStyle( - fontSize: 28.sp, color: Color(0xff999999)), + style: TextStyle(fontSize: 28.sp, color: Color(0xff999999)), ), SizedBox(width: 47.w), - SmoothStarRating( - rating: rating, - isReadOnly: false, - size: 46.sp, - filledIconData: AntDesign.star, - // halfFilledIconData: Icons.star_half, - defaultIconData: AntDesign.staro, - color: Color(0xffffc40c), - borderColor: Color(0xffffc40c), - starCount: 5, + RatingBar( + ignoreGestures: false, + itemSize: 46.w, + // filledIconData: AntDesign.star, + // // halfFilledIconData: Icons.star_half, + // defaultIconData: AntDesign.staro, + // color: Color(0xffffc40c), + // borderColor: Color(0xffffc40c), + ratingWidget: RatingWidget( + full: Icon( + AntDesign.star, + color: kPrimaryColor, + ), + empty: Icon( + AntDesign.staro, + color: kDarkPrimaryColor, + ), + half: Icon(Icons.star_half)), + itemCount: 5, allowHalfRating: false, - spacing: 20.w, - onRated: (value) { + itemPadding: EdgeInsets.symmetric(horizontal: 10.w), + onRatingUpdate: (value) { print("rating value -> $value"); // print("rating value dd -> ${value.truncate()}"); }, @@ -80,10 +88,7 @@ class _ThingsEvaluatePageState extends State { Container _containerTextField(String hintText) { return Container( - padding: EdgeInsets.only( - top: 32.w, - left: 22.w, - right: 35.w), + padding: EdgeInsets.only(top: 32.w, left: 22.w, right: 35.w), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(8)), border: Border.all(color: Color(0xffd4cfbe), width: 1.0), @@ -171,8 +176,7 @@ class _ThingsEvaluatePageState extends State { Text( '请输入内容', style: TextStyle( - fontSize: 28.sp, - color: Color(0xff333333)), + fontSize: 28.sp, color: Color(0xff333333)), ), SizedBox(height: 24.w), _containerTextField(hintText), diff --git a/lib/pages/things_page/widget/fixed_evaluate_page.dart b/lib/pages/things_page/widget/fixed_evaluate_page.dart new file mode 100644 index 00000000..4b967503 --- /dev/null +++ b/lib/pages/things_page/widget/fixed_evaluate_page.dart @@ -0,0 +1,21 @@ +import 'package:akuCommunity/widget/bee_scaffold.dart'; +import 'package:flutter/material.dart'; +import 'package:velocity_x/velocity_x.dart'; +import 'package:akuCommunity/utils/headers.dart'; + +class FixedEvaluatePage extends StatefulWidget { + FixedEvaluatePage({Key key}) : super(key: key); + + @override + _FixedEvaluatePageState createState() => _FixedEvaluatePageState(); +} + +class _FixedEvaluatePageState extends State { + @override + Widget build(BuildContext context) { + return BeeScaffold(title: '评价',body: ListView( + padding: EdgeInsets.symmetric(horizontal: 42.w,vertical: 52.w), + children: [], + ).expand(),); + } +} \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index 4f59b32e..20a23c59 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -961,13 +961,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.0.2" - smooth_star_rating: - dependency: "direct main" - description: - name: smooth_star_rating - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.1.1" source_span: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index c55bc8be..34d6a3b9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -50,8 +50,6 @@ dependencies: photo_view: ^0.10.2 #图片缓存 cached_network_image: ^2.3.1 - #评价 - smooth_star_rating: ^1.1.1 #头像层叠 image_stack: ^1.1.0 #弹窗