Browse Source

Merge remote-tracking branch 'origin/new_revision_app' into new_revision_app

zyh
fmk 3 years ago
parent
commit
2e0d0df43d
  1. 1
      lib/community/community_view/class_details.dart
  2. 104
      lib/community/community_view/class_list_view.dart
  3. 64
      lib/community/headlines/headlines_column_details.dart
  4. 2
      lib/community/release_dynamic.dart
  5. 2
      lib/store/store_view/shop_car.dart
  6. 4
      lib/view_widget/selector_store_dialog.dart
  7. 2
      pubspec.yaml

1
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,
),

104
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);
},
);
}
@ -106,7 +132,7 @@ class _ClassListView extends State<ClassListView> {
child:MImage(
classList.coverImg,
width: double.infinity,
height: 120,
height: 220.h,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
@ -167,7 +193,7 @@ class _ClassListView extends State<ClassListView> {
),
],
),
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: 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: Colors.black,
color: Color(0xFF32A060),
),
),
if(classList.author.name != "")
SizedBox(height:5.h),
],
),
),)
),
],
),
);

64
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(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.all(16),
child: Text(
S.of(context).jianjie(
headlinesListDetails
?.introduce ??
""),
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,
),
],
),
),
],
),
),

2
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,

2
lib/store/store_view/shop_car.dart

@ -132,7 +132,7 @@ class _ShopCar extends State<ShopCar> {
),
),
Positioned(
bottom: 0,
bottom: 30.h,
left: 0,
right: 0,
child: Stack(

4
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(

2
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"

Loading…
Cancel
Save