From 53253302ee2d5462dd6c19624d4bc26fb2e1e7cb Mon Sep 17 00:00:00 2001
From: w-R <953969641@qq.com>
Date: Mon, 11 Jul 2022 16:30:29 +0800
Subject: [PATCH] =?UTF-8?q?=E5=B8=83=E5=B1=80=E6=96=87=E7=AB=A0,=E8=A7=86?=
 =?UTF-8?q?=E9=A2=91,=E9=83=A8=E5=88=86=E6=8C=89=E9=92=AE=E4=BC=98?=
 =?UTF-8?q?=E5=8C=96=E6=9B=B4=E6=94=B9;?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../community_view/class_details.dart         |   1 +
 .../community_view/class_list_view.dart       | 258 ++++++++++--------
 .../headlines/headlines_column_details.dart   |  70 ++++-
 lib/community/release_dynamic.dart            |   2 +-
 lib/view_widget/selector_store_dialog.dart    |   4 +-
 pubspec.yaml                                  |   2 +-
 6 files changed, 213 insertions(+), 124 deletions(-)

diff --git a/lib/community/community_view/class_details.dart b/lib/community/community_view/class_details.dart
index d8822527..47ef0969 100644
--- a/lib/community/community_view/class_details.dart
+++ b/lib/community/community_view/class_details.dart
@@ -304,6 +304,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
                                 maxLines: isShowMore ? 10 : 2,
                                 style: TextStyle(
                                   fontSize: 12.sp,
+                                  height: 1.2.h,
                                   fontWeight: MyFontWeight.regular,
                                   color: Colors.black,
                                 ),
diff --git a/lib/community/community_view/class_list_view.dart b/lib/community/community_view/class_list_view.dart
index 0b88a1c7..3bf6d6a3 100644
--- a/lib/community/community_view/class_list_view.dart
+++ b/lib/community/community_view/class_list_view.dart
@@ -1,4 +1,5 @@
 import 'package:flutter/material.dart';
+import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
 import 'package:huixiang/retrofit/data/course_list.dart';
 import 'package:huixiang/utils/flutter_utils.dart';
 import 'package:huixiang/utils/font_weight.dart';
@@ -27,37 +28,62 @@ class _ClassListView extends State<ClassListView> {
       text: "当前分类暂无精彩内容",
       fontSize: 16.sp,
       margin: EdgeInsets.only( left: 60.w, right: 60.w,bottom: 30),
-    ): GridView.builder(
-      itemCount:widget.classList == null ? 0 : widget.classList.length,
-      padding: EdgeInsets.only(
-        left: 16.w,
-        right: 16.w,
-        top: 13.h,
-        bottom: 16.h,
-      ),
+    ):
+    // GridView.builder(
+    //   itemCount:widget.classList == null ? 0 : widget.classList.length,
+    //   padding: EdgeInsets.only(
+    //     left: 16.w,
+    //     right: 16.w,
+    //     top: 13.h,
+    //     bottom: 16.h,
+    //   ),
+    //   shrinkWrap: true,
+    //   physics: NeverScrollableScrollPhysics(),
+    //   gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
+    //     //一行的Widget数量
+    //     crossAxisCount:2,
+    //     //水平子Widget之间间距
+    //     crossAxisSpacing: 11.w,
+    //     //垂直子Widget之间间距
+    //     mainAxisSpacing: 16.w,
+    //     //子Widget宽高比例  0.59
+    //     childAspectRatio:
+    //         225 / (281 / 2 + (281 / 2) * AppUtils.textScale(context)),
+    //   ),
+    //   itemBuilder: (context, index) {
+    //     return GestureDetector(
+    //       onTap: () {
+    //         Navigator.of(context).pushNamed('/router/class_details',
+    //             arguments: {"id": widget.classList[index].id})
+    //             .then((value) => {widget.classList[index].viewers = value != null?value:widget.classList[index].viewers+1});
+    //       },
+    //       child: classListItem(widget.classList[index]),
+    //     );
+    //   },
+    // );
+    StaggeredGridView.countBuilder(
+      crossAxisCount: 2,
       shrinkWrap: true,
-      physics: NeverScrollableScrollPhysics(),
-      gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
-        //一行的Widget数量
-        crossAxisCount:2,
-        //水平子Widget之间间距
-        crossAxisSpacing: 11.w,
-        //垂直子Widget之间间距
-        mainAxisSpacing: 16.w,
-        //子Widget宽高比例  0.59
-        childAspectRatio:
-            225 / (281 / 2 + (281 / 2) * AppUtils.textScale(context)),
-      ),
-      itemBuilder: (context, index) {
+      itemCount: widget.classList.length,
+      mainAxisSpacing: 8,
+      crossAxisSpacing: 8,
+      padding: EdgeInsets.all(16),
+      physics: BouncingScrollPhysics(),
+      // scrollDirection: Axis.vertical,
+      itemBuilder: (context, position) {
         return GestureDetector(
-          onTap: () {
+          onTap: (){
             Navigator.of(context).pushNamed('/router/class_details',
-                arguments: {"id": widget.classList[index].id})
-                .then((value) => {widget.classList[index].viewers = value != null?value:widget.classList[index].viewers+1});
+                            arguments: {"id": widget.classList[position].id})
+                            .then((value) => {widget.classList[position].viewers = value != null?value:widget.classList[position].viewers+1});
           },
-          child: classListItem(widget.classList[index]),
+          child: classListItem(widget.classList[position]),
         );
       },
+      staggeredTileBuilder: (position) {
+        // return StaggeredTile.count(1,position==0?1:1.2);
+       return StaggeredTile.fit(1);
+      },
     );
   }
 
@@ -84,90 +110,90 @@ class _ClassListView extends State<ClassListView> {
         crossAxisAlignment: CrossAxisAlignment.start,
         children: [
           Stack(
-            alignment: Alignment(0.9, 0.9),
+          alignment: Alignment(0.9, 0.9),
+      children: [
+        Container(
+          decoration: BoxDecoration(
+            borderRadius: BorderRadius.circular(4),
+            boxShadow: [
+              BoxShadow(
+                color: Colors.black.withAlpha(10),
+                offset: Offset(0, 3),
+                blurRadius: 14,
+                spreadRadius: 0,
+              )
+            ],
+            color: Color.fromARGB(90, 0, 0, 0),
+          ),
+          child: ClipRRect(
+            child:
+            Opacity(
+              opacity: 0.7,
+              child:MImage(
+                classList.coverImg,
+                width: double.infinity,
+                height: 220.h,
+                fit: BoxFit.cover,
+                errorSrc: "assets/image/default_1.webp",
+                fadeSrc: "assets/image/default_1.webp",
+              ),
+            ),
+            borderRadius: BorderRadius.vertical(
+              top: Radius.circular(4),
+            ),
+          ),
+        ),
+        Container(
+          padding: EdgeInsets.only(left: 4),
+          child: Row(
             children: [
-              Container(
-                decoration: BoxDecoration(
-                  borderRadius: BorderRadius.circular(4),
-                  boxShadow: [
-                    BoxShadow(
-                      color: Colors.black.withAlpha(10),
-                      offset: Offset(0, 3),
-                      blurRadius: 14,
-                      spreadRadius: 0,
-                    )
-                  ],
-                  color: Color.fromARGB(90, 0, 0, 0),
-                ),
-                child: ClipRRect(
-                  child:
-                  Opacity(
-                    opacity: 0.7,
-                    child:MImage(
-                      classList.coverImg,
-                      width: double.infinity,
-                      height: 120,
-                      fit: BoxFit.cover,
-                      errorSrc: "assets/image/default_1.webp",
-                      fadeSrc: "assets/image/default_1.webp",
-                    ),
-                  ),
-                  borderRadius: BorderRadius.vertical(
-                    top: Radius.circular(4),
+              Row(
+                mainAxisAlignment: MainAxisAlignment.spaceAround,
+                crossAxisAlignment: CrossAxisAlignment.start,
+                children: [
+                  Image.asset(
+                    "assets/image/ketang_play.webp",
+                    width: 16.w,
+                    height: 16.h,
+                    color: Colors.white,
                   ),
-                ),
-              ),
-              Container(
-                padding: EdgeInsets.only(left: 4),
-                child: Row(
-                  children: [
-                    Row(
-                      mainAxisAlignment: MainAxisAlignment.spaceAround,
-                      crossAxisAlignment: CrossAxisAlignment.start,
-                      children: [
-                        Image.asset(
-                          "assets/image/ketang_play.webp",
-                          width: 16.w,
-                          height: 16.h,
-                          color: Colors.white,
-                        ),
-                        SizedBox(width: 5),
-                        Text(
-                         classList.viewers.toString(),
-                          style: TextStyle(
-                            fontSize: 12.sp,
-                            fontWeight: MyFontWeight.regular,
-                            color: Colors.white,
-                          ),
-                        ),
-                      ],
+                  SizedBox(width: 5),
+                  Text(
+                    classList.viewers.toString(),
+                    style: TextStyle(
+                      fontSize: 12.sp,
+                      fontWeight: MyFontWeight.regular,
+                      color: Colors.white,
                     ),
-                    SizedBox(width: 8),
-                    // Row(
-                    //   children: [
-                    //     Image.asset(
-                    //       "assets/image/ketang_message.webp",
-                    //       width: 16.w,
-                    //       height: 16.h,
-                    //       color: Colors.white,
-                    //     ),
-                    //     SizedBox(width: 5),
-                    //     Text(
-                    //       classList.viewers.toString(),
-                    //       style: TextStyle(
-                    //         fontSize: 12.sp,
-                    //         fontWeight: MyFontWeight.regular,
-                    //         color: Colors.white,
-                    //       ),
-                    //     ),
-                    //   ],
-                    // ),
-                  ],
-                ),
+                  ),
+                ],
               ),
+              SizedBox(width: 8),
+              // Row(
+              //   children: [
+              //     Image.asset(
+              //       "assets/image/ketang_message.webp",
+              //       width: 16.w,
+              //       height: 16.h,
+              //       color: Colors.white,
+              //     ),
+              //     SizedBox(width: 5),
+              //     Text(
+              //       classList.viewers.toString(),
+              //       style: TextStyle(
+              //         fontSize: 12.sp,
+              //         fontWeight: MyFontWeight.regular,
+              //         color: Colors.white,
+              //       ),
+              //     ),
+              //   ],
+              // ),
             ],
           ),
-          Expanded(child:Container(
+        ),
+      ],
+    ),
+          Container(
             padding: EdgeInsets.all(5),
             child: Column(
               mainAxisAlignment: MainAxisAlignment.spaceAround,
@@ -179,24 +205,40 @@ class _ClassListView extends State<ClassListView> {
                   maxLines: 1,
                   style: TextStyle(
                     fontSize: 14.sp,
+                    height: 1.5.h,
                     fontWeight: MyFontWeight.semi_bold,
                     color: Colors.black,
                   ),
                 ),
-                SizedBox(height: 2),
+                SizedBox(height:5.h),
                 Text(
-                  "讲师:${classList.author.name}",
+                  "简介 : ${classList.introduce}",
                   overflow: TextOverflow.ellipsis,
                   maxLines: 2,
                   style: TextStyle(
-                    fontSize: 12.sp,
-                    fontWeight: MyFontWeight.regular,
+                    fontSize: 13.sp,
+                    height: 1.2.h,
+                    fontWeight: MyFontWeight.medium,
                     color: Colors.black,
                   ),
                 ),
+                SizedBox(height:7.h),
+                if(classList.author.name != "")
+                  Text(
+                    "讲师:${classList.author.name}",
+                    // overflow: TextOverflow.ellipsis,
+                    // maxLines: 2,
+                    style: TextStyle(
+                      fontSize: 12.sp,
+                      fontWeight: MyFontWeight.regular,
+                      color: Color(0xFF32A060),
+                    ),
+                  ),
+                if(classList.author.name != "")
+                SizedBox(height:5.h),
               ],
             ),
-          ),)
+          ),
         ],
       ),
     );
diff --git a/lib/community/headlines/headlines_column_details.dart b/lib/community/headlines/headlines_column_details.dart
index cd54017c..cdac9bd5 100644
--- a/lib/community/headlines/headlines_column_details.dart
+++ b/lib/community/headlines/headlines_column_details.dart
@@ -36,6 +36,7 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
   final RefreshController refreshController = RefreshController();
   final ScrollController scrollController = ScrollController();
   int pageNum = 1;
+  var isShowMore = false;
 
   @override
   void initState() {
@@ -248,28 +249,73 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
                                       ),
                                     ),
                                     margin: EdgeInsets.only(top: 16),
-                                    // padding: EdgeInsets.all(16),
+                                    padding: EdgeInsets.all(16),
                                     child: Column(
-                                      mainAxisAlignment:
+                                      children: [
+                                        Row(
+                                          mainAxisAlignment:
                                           MainAxisAlignment.start,
-                                      crossAxisAlignment:
+                                          crossAxisAlignment:
                                           CrossAxisAlignment.start,
-                                      children: [
-                                        Padding(
-                                            padding: EdgeInsets.all(16),
-                                            child: Text(
-                                              S.of(context).jianjie(
-                                                  headlinesListDetails
-                                                          ?.introduce ??
-                                                      ""),
+                                          children: [
+                                            Text(
+                                              "简介:",
                                               overflow: TextOverflow.ellipsis,
                                               maxLines: 2,
                                               style: TextStyle(
                                                 fontSize: 14.sp,
+                                                height: 1.2.h,
                                                 fontWeight: MyFontWeight.medium,
                                                 color: Colors.black,
                                               ),
-                                            )),
+                                            ),
+                                            Expanded(child:Text(
+                                              headlinesListDetails
+                                                  ?.introduce ??
+                                                  "",
+                                              overflow: isShowMore
+                                                  ? TextOverflow.visible
+                                                  : TextOverflow.ellipsis,
+                                              maxLines: isShowMore ? 10 : 2,
+                                              style: TextStyle(
+                                                fontSize: 14.sp,
+                                                height: 1.2.h,
+                                                fontWeight: MyFontWeight.medium,
+                                                color: Colors.black,
+                                              ),
+                                            ),)
+                                          ],
+                                        ),
+                                        SizedBox(height: 3.h),
+                                        GestureDetector(
+                                          onTap: () {
+                                            setState(() {
+                                              isShowMore = !isShowMore;
+                                            });
+                                          },
+                                          child: Row(
+                                            mainAxisAlignment: MainAxisAlignment.end,
+                                            crossAxisAlignment: CrossAxisAlignment.center,
+                                            mainAxisSize: MainAxisSize.max,
+                                            children: [
+                                              Text(
+                                                S.of(context).gengduo,
+                                                style: TextStyle(
+                                                  fontSize: 12.sp,
+                                                  fontWeight: MyFontWeight.regular,
+                                                  color: Colors.black,
+                                                ),
+                                              ),
+                                              Icon(
+                                                (isShowMore != null && !isShowMore)
+                                                    ? Icons.chevron_right
+                                                    : Icons.keyboard_arrow_up,
+                                                color: Colors.black,
+                                                size: 18,
+                                              ),
+                                            ],
+                                          ),
+                                        ),
                                       ],
                                     ),
                                   ),
diff --git a/lib/community/release_dynamic.dart b/lib/community/release_dynamic.dart
index dc203f76..2f5c1bea 100644
--- a/lib/community/release_dynamic.dart
+++ b/lib/community/release_dynamic.dart
@@ -67,7 +67,7 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
             alignment: Alignment.center,
             decoration: BoxDecoration(
               color: isRelease ? Color(0xFF32A060) : Color(0xFFD8D8D8),
-              borderRadius: BorderRadius.circular(4),
+              borderRadius: BorderRadius.circular(12),
             ),
             child: Text(
               S.of(context).fabu,
diff --git a/lib/view_widget/selector_store_dialog.dart b/lib/view_widget/selector_store_dialog.dart
index dbd2b159..061e20cd 100644
--- a/lib/view_widget/selector_store_dialog.dart
+++ b/lib/view_widget/selector_store_dialog.dart
@@ -131,11 +131,11 @@ class _SelectorStoreWidget extends State<SelectorStoreWidget> {
               width: double.infinity,
               height: 40.h,
               decoration: BoxDecoration(
-                borderRadius: BorderRadius.circular(6),
+                borderRadius: BorderRadius.circular(100),
                 color:Color(0xFF32A060),
               ),
               alignment: Alignment.center,
-              margin: EdgeInsets.only(top: 14.h),
+              margin: EdgeInsets.only(top: 14.h,bottom: 30.h,left: 16.w,right: 16.w),
               child: Text(
                 S.of(context).queding,
                 style: TextStyle(
diff --git a/pubspec.yaml b/pubspec.yaml
index a5d598fd..6f924c1f 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -3,7 +3,7 @@ description: 一心回乡.
 
 publish_to: 'none' # Remove this line if you wish to publish to pub.dev
 
-version: 2.0.30+18
+version: 2.0.31+19
 
 environment:
   sdk: ">=2.7.0 <3.0.0"