|
|
@ -76,7 +76,8 @@ class _HomeClass extends State<HomeClass> { |
|
|
|
return GestureDetector( |
|
|
|
return GestureDetector( |
|
|
|
onTap: () { |
|
|
|
onTap: () { |
|
|
|
Navigator.of(context).pushNamed('/router/class_details', |
|
|
|
Navigator.of(context).pushNamed('/router/class_details', |
|
|
|
arguments: {"id":widget.collect[position].id}); |
|
|
|
arguments: {"id":widget.collect[position].id}) |
|
|
|
|
|
|
|
.then((value) => {widget.collect[position].viewers = value != null?value:widget.collect[position].viewers+1}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
child: classItem(widget.collect[position]), |
|
|
|
child: classItem(widget.collect[position]), |
|
|
|
); |
|
|
|
); |
|
|
@ -92,138 +93,170 @@ class _HomeClass extends State<HomeClass> { |
|
|
|
return Container( |
|
|
|
return Container( |
|
|
|
width: 168, |
|
|
|
width: 168, |
|
|
|
height: 189, |
|
|
|
height: 189, |
|
|
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
|
|
borderRadius: BorderRadius.vertical( |
|
|
|
|
|
|
|
bottom: Radius.circular(4), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
boxShadow: [ |
|
|
|
|
|
|
|
BoxShadow( |
|
|
|
|
|
|
|
color: Colors.black.withAlpha(10), |
|
|
|
|
|
|
|
offset: Offset(0, 3), |
|
|
|
|
|
|
|
blurRadius: 14, |
|
|
|
|
|
|
|
spreadRadius: 0, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
color: Colors.white, |
|
|
|
|
|
|
|
), |
|
|
|
margin: EdgeInsets.symmetric( |
|
|
|
margin: EdgeInsets.symmetric( |
|
|
|
horizontal: 6.w, |
|
|
|
horizontal:6, |
|
|
|
vertical: 3, |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
color: Colors.white, |
|
|
|
|
|
|
|
child: Column( |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Stack( |
|
|
|
Stack( |
|
|
|
alignment: Alignment(0.9,0.9), |
|
|
|
alignment: Alignment.topRight, |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Container( |
|
|
|
Stack( |
|
|
|
color: Color.fromARGB(80, 0, 0, 0), |
|
|
|
alignment: Alignment(0.9,0.9), |
|
|
|
child: ClipRRect( |
|
|
|
children: [ |
|
|
|
child: MImage( |
|
|
|
Container( |
|
|
|
collect.coverImg, |
|
|
|
decoration: BoxDecoration( |
|
|
|
width: double.infinity, |
|
|
|
borderRadius: BorderRadius.circular(4), |
|
|
|
height: 120, |
|
|
|
boxShadow: [ |
|
|
|
fit: BoxFit.cover, |
|
|
|
BoxShadow( |
|
|
|
errorSrc: "assets/image/default_1.png", |
|
|
|
color: Colors.black.withAlpha(10), |
|
|
|
fadeSrc: "assets/image/default_1.png", |
|
|
|
offset: Offset(0, 3), |
|
|
|
|
|
|
|
blurRadius: 14, |
|
|
|
|
|
|
|
spreadRadius: 0, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
color: Color.fromARGB(90, 0, 0, 0), |
|
|
|
), |
|
|
|
), |
|
|
|
borderRadius: BorderRadius.vertical( |
|
|
|
child: ClipRRect( |
|
|
|
top: Radius.circular(4), |
|
|
|
child: Opacity( |
|
|
|
|
|
|
|
opacity: 0.6, |
|
|
|
|
|
|
|
child: MImage( |
|
|
|
|
|
|
|
collect.coverImg, |
|
|
|
|
|
|
|
width: double.infinity, |
|
|
|
|
|
|
|
height: 120, |
|
|
|
|
|
|
|
fit: BoxFit.cover, |
|
|
|
|
|
|
|
errorSrc: "assets/image/default_1.png", |
|
|
|
|
|
|
|
fadeSrc: "assets/image/default_1.png", |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
borderRadius: BorderRadius.vertical( |
|
|
|
|
|
|
|
top: Radius.circular(4), |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
Container( |
|
|
|
Container( |
|
|
|
padding: EdgeInsets.only(left: 4), |
|
|
|
padding: EdgeInsets.only(left: 4), |
|
|
|
child:Row( |
|
|
|
child:Row( |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Row( |
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround, |
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Image.asset( |
|
|
|
Row( |
|
|
|
"assets/image/ketang_like.png", |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround, |
|
|
|
width: 16.w, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
height: 16.h, |
|
|
|
children: [ |
|
|
|
color: Colors.white, |
|
|
|
Image.asset( |
|
|
|
), |
|
|
|
"assets/image/ketang_play.png", |
|
|
|
SizedBox(width:5), |
|
|
|
width: 16.w, |
|
|
|
Text( |
|
|
|
height: 16.h, |
|
|
|
collect.likes.toString(), |
|
|
|
color: Colors.white, |
|
|
|
style: TextStyle( |
|
|
|
), |
|
|
|
fontSize: 12.sp, |
|
|
|
SizedBox(width:5), |
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
Text( |
|
|
|
color: Colors.white, |
|
|
|
collect.viewers.toString(), |
|
|
|
), |
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
|
|
|
color: Colors.white, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
SizedBox(width:8), |
|
|
|
|
|
|
|
// Row( |
|
|
|
|
|
|
|
// children: [ |
|
|
|
|
|
|
|
// Image.asset( |
|
|
|
|
|
|
|
// "assets/image/ketang_message.png", |
|
|
|
|
|
|
|
// width: 16.w, |
|
|
|
|
|
|
|
// height: 16.h, |
|
|
|
|
|
|
|
// color: Colors.white, |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// SizedBox(width:5), |
|
|
|
|
|
|
|
// Text( |
|
|
|
|
|
|
|
// collect.viewers.toString(), |
|
|
|
|
|
|
|
// style: TextStyle( |
|
|
|
|
|
|
|
// fontSize: 12.sp, |
|
|
|
|
|
|
|
// fontWeight: MyFontWeight.regular, |
|
|
|
|
|
|
|
// color: Colors.white, |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// ], |
|
|
|
|
|
|
|
// ), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox(width:8), |
|
|
|
|
|
|
|
// Row( |
|
|
|
), |
|
|
|
// children: [ |
|
|
|
], |
|
|
|
// Image.asset( |
|
|
|
), |
|
|
|
// "assets/image/ketang_message.png", |
|
|
|
Container( |
|
|
|
// width: 16.w, |
|
|
|
margin: EdgeInsets.only(top: 8,right: 8), |
|
|
|
// height: 16.h, |
|
|
|
height: 16.h, |
|
|
|
// color: Colors.white, |
|
|
|
width: 30.w, |
|
|
|
// ), |
|
|
|
alignment: Alignment.center, |
|
|
|
// SizedBox(width:5), |
|
|
|
decoration: BoxDecoration( |
|
|
|
// Text( |
|
|
|
borderRadius: |
|
|
|
// collect.viewers.toString(), |
|
|
|
BorderRadius.circular(2), |
|
|
|
// style: TextStyle( |
|
|
|
color: Color(0xFFFFCD00), |
|
|
|
// fontSize: 12.sp, |
|
|
|
|
|
|
|
// fontWeight: MyFontWeight.regular, |
|
|
|
|
|
|
|
// color: Colors.white, |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// ], |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
child: Text( |
|
|
|
|
|
|
|
( collect?.tags != null && collect.tags.length > 0 )?collect.tags[0] : "", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
|
|
|
color: Color(0xFF634815), |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
Container( |
|
|
|
), |
|
|
|
padding: EdgeInsets.only(left:4,top: 2), |
|
|
|
Expanded(child: |
|
|
|
child: Column( |
|
|
|
Container( |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround, |
|
|
|
padding: EdgeInsets.all(10), |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
SizedBox(height:2), |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
Row( |
|
|
|
children: [ |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
Row( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
children: [ |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
Container( |
|
|
|
children: [ |
|
|
|
height: 16.h, |
|
|
|
Expanded(child: Text( |
|
|
|
width: 30.w, |
|
|
|
collect.subject, |
|
|
|
alignment: Alignment.center, |
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
decoration: BoxDecoration( |
|
|
|
maxLines: 2, |
|
|
|
borderRadius: |
|
|
|
style: TextStyle( |
|
|
|
BorderRadius.circular(2), |
|
|
|
fontSize: 14.sp, |
|
|
|
border: Border.all( |
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
width: 1, |
|
|
|
color: Colors.black, |
|
|
|
color: Color(0xFFFF7A1A), |
|
|
|
|
|
|
|
style: BorderStyle.solid, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
child: Text( |
|
|
|
|
|
|
|
( collect?.tags != null && collect.tags.length > 0 )?collect.tags[0] : "", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
|
|
|
color: Color(0xFFFF7A1A), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox(width:5), |
|
|
|
),), |
|
|
|
Expanded(child: Text( |
|
|
|
], |
|
|
|
collect.subject, |
|
|
|
), |
|
|
|
style: TextStyle( |
|
|
|
SizedBox(height:5), |
|
|
|
fontSize: 14.sp, |
|
|
|
Text( |
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
"讲师:${collect.author.name}", |
|
|
|
color: Colors.black, |
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
), |
|
|
|
maxLines: 2, |
|
|
|
),), |
|
|
|
style: TextStyle( |
|
|
|
], |
|
|
|
fontSize: 12.sp, |
|
|
|
), |
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
SizedBox(height:3), |
|
|
|
color: Colors.black, |
|
|
|
Text( |
|
|
|
|
|
|
|
"讲师:${collect.author.name}", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
|
|
|
color: Colors.black, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
),), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
); |
|
|
|
); |
|
|
|