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. 258
      lib/community/community_view/class_list_view.dart
  3. 70
      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, maxLines: isShowMore ? 10 : 2,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
height: 1.2.h,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
color: Colors.black, color: Colors.black,
), ),

258
lib/community/community_view/class_list_view.dart

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; 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/retrofit/data/course_list.dart';
import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
@ -27,37 +28,62 @@ class _ClassListView extends State<ClassListView> {
text: "当前分类暂无精彩内容", text: "当前分类暂无精彩内容",
fontSize: 16.sp, fontSize: 16.sp,
margin: EdgeInsets.only( left: 60.w, right: 60.w,bottom: 30), margin: EdgeInsets.only( left: 60.w, right: 60.w,bottom: 30),
): GridView.builder( ):
itemCount:widget.classList == null ? 0 : widget.classList.length, // GridView.builder(
padding: EdgeInsets.only( // itemCount:widget.classList == null ? 0 : widget.classList.length,
left: 16.w, // padding: EdgeInsets.only(
right: 16.w, // left: 16.w,
top: 13.h, // right: 16.w,
bottom: 16.h, // 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, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), itemCount: widget.classList.length,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( mainAxisSpacing: 8,
//Widget数量 crossAxisSpacing: 8,
crossAxisCount:2, padding: EdgeInsets.all(16),
//Widget之间间距 physics: BouncingScrollPhysics(),
crossAxisSpacing: 11.w, // scrollDirection: Axis.vertical,
//Widget之间间距 itemBuilder: (context, position) {
mainAxisSpacing: 16.w,
//Widget宽高比例 0.59
childAspectRatio:
225 / (281 / 2 + (281 / 2) * AppUtils.textScale(context)),
),
itemBuilder: (context, index) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: (){
Navigator.of(context).pushNamed('/router/class_details', Navigator.of(context).pushNamed('/router/class_details',
arguments: {"id": widget.classList[index].id}) arguments: {"id": widget.classList[position].id})
.then((value) => {widget.classList[index].viewers = value != null?value:widget.classList[index].viewers+1}); .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, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Stack( 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: [ children: [
Container( Row(
decoration: BoxDecoration( mainAxisAlignment: MainAxisAlignment.spaceAround,
borderRadius: BorderRadius.circular(4), crossAxisAlignment: CrossAxisAlignment.start,
boxShadow: [ children: [
BoxShadow( Image.asset(
color: Colors.black.withAlpha(10), "assets/image/ketang_play.webp",
offset: Offset(0, 3), width: 16.w,
blurRadius: 14, height: 16.h,
spreadRadius: 0, color: Colors.white,
)
],
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),
), ),
), SizedBox(width: 5),
), Text(
Container( classList.viewers.toString(),
padding: EdgeInsets.only(left: 4), style: TextStyle(
child: Row( fontSize: 12.sp,
children: [ fontWeight: MyFontWeight.regular,
Row( color: Colors.white,
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: 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), padding: EdgeInsets.all(5),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
@ -179,24 +205,40 @@ class _ClassListView extends State<ClassListView> {
maxLines: 1, maxLines: 1,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
height: 1.5.h,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Colors.black, color: Colors.black,
), ),
), ),
SizedBox(height: 2), SizedBox(height:5.h),
Text( Text(
"讲师:${classList.author.name}", "简介 : ${classList.introduce}",
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 2, maxLines: 2,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 13.sp,
fontWeight: MyFontWeight.regular, height: 1.2.h,
fontWeight: MyFontWeight.medium,
color: Colors.black, 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),
], ],
), ),
),) ),
], ],
), ),
); );

70
lib/community/headlines/headlines_column_details.dart

@ -36,6 +36,7 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
final ScrollController scrollController = ScrollController(); final ScrollController scrollController = ScrollController();
int pageNum = 1; int pageNum = 1;
var isShowMore = false;
@override @override
void initState() { void initState() {
@ -248,28 +249,73 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
), ),
), ),
margin: EdgeInsets.only(top: 16), margin: EdgeInsets.only(top: 16),
// padding: EdgeInsets.all(16), padding: EdgeInsets.all(16),
child: Column( child: Column(
mainAxisAlignment: children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start, MainAxisAlignment.start,
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Padding( Text(
padding: EdgeInsets.all(16), "简介:",
child: Text(
S.of(context).jianjie(
headlinesListDetails
?.introduce ??
""),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 2, maxLines: 2,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
height: 1.2.h,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Colors.black, 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, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: isRelease ? Color(0xFF32A060) : Color(0xFFD8D8D8), color: isRelease ? Color(0xFF32A060) : Color(0xFFD8D8D8),
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(12),
), ),
child: Text( child: Text(
S.of(context).fabu, S.of(context).fabu,

2
lib/store/store_view/shop_car.dart

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

4
lib/view_widget/selector_store_dialog.dart

@ -131,11 +131,11 @@ class _SelectorStoreWidget extends State<SelectorStoreWidget> {
width: double.infinity, width: double.infinity,
height: 40.h, height: 40.h,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(100),
color:Color(0xFF32A060), color:Color(0xFF32A060),
), ),
alignment: Alignment.center, 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( child: Text(
S.of(context).queding, S.of(context).queding,
style: TextStyle( style: TextStyle(

2
pubspec.yaml

@ -3,7 +3,7 @@ description: 一心回乡.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev 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: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=2.7.0 <3.0.0"

Loading…
Cancel
Save