import 'package:Flutter/material.dart';
import 'package:Flutterapp/find/Article.dart';
//样式为无状态的
class ArticleItem extends StatelessWidget {
final Article model;
ArticleItem(this.model);
@override
Widget build(BuildContext context) {
return Container(
height: 100,
padding: EdgeInsets.all(5),
child: Card(
elevation: 5,
child: Padding(
padding: EdgeInsets.all(5),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children:<Widget> [
new Row(
children:<Widget> [
new Column(
children:<Widget> [
SizedBox(width: 20),
],
),
new Column(
children:<Widget> [
Container(
width: 50, height: 50,
decoration: Boxdecoration(
borderRadius: BorderRadius.circular(10),
image: decorationImage(
image: NetworkImage(model.logo),
fit: BoxFit.cover
)
),
)
]
),
new Column(
children:<Widget> [
Text(
" "+model.location.substring(0,6),
style: TextStyle(fontSize: 12, color: Colors.grey),
),
]
),
new Column(
crossAxisAlignment: CrossAxisAlignment.start,
children:<Widget> [
new Row(
children:<Widget> [
Text(
" | "+model.type,
style: TextStyle(fontSize: 12, color: Colors.grey),
),
]
),
new Row(
children:<Widget> [
Text(
" | "+model.size,
style: TextStyle(fontSize: 12, color: Colors.grey),
),
]
),
new Row(
children:<Widget> [
Text(
" | "+model.employee,
style: TextStyle(fontSize: 12, color: Colors.grey),
),
]
),
]
),
],
),
new Row(
children:<Widget> [
Text(
'热招 : '+model.hot+" 等",
style: TextStyle(fontSize: 12, color: Colors.grey),
),
Text(
model.count+"个职位",
style: TextStyle(fontSize: 12, color: Colors.grey),
),
],
)
],
),
),
),
);
}
}
原文地址:https://www.cnblogs.com/caoxueyang/p/13883484.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。