This commit is contained in:
myf 2022-07-12 13:59:34 +08:00
parent 963a083c9f
commit dd610eee1f
6 changed files with 296 additions and 51 deletions

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

View File

Before

Width:  |  Height:  |  Size: 428 B

After

Width:  |  Height:  |  Size: 428 B

View File

@ -352,8 +352,8 @@ class _RoomComponentState extends State<RoomComponent> {
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color.fromRGBO(255, 255, 255, 1),
Color.fromRGBO(254, 249, 252, 1),
Color.fromRGBO(255, 255, 255, 1),
],
),
),
@ -370,6 +370,7 @@ class _RoomComponentState extends State<RoomComponent> {
),
ClassifyComponent(),
GameComponent(),
PlayWithFriendsComponent(),
],
),
);
@ -524,7 +525,249 @@ class _GameComponentState extends State<GameComponent> {
width: double.infinity,
height: 76,
),
SizedBox(
height: 23,
),
],
),
);
}
}
//
class PlayWithFriendsComponent extends StatefulWidget {
PlayWithFriendsComponent({Key? key}) : super(key: key);
@override
State<PlayWithFriendsComponent> createState() =>
_PlayWithFriendsComponentState();
}
class _PlayWithFriendsComponentState extends State<PlayWithFriendsComponent> {
final List _list = [
{
"photo": "images/home/room.png",
"name": "小寡妇",
"distance": "8.9",
"constellation": "双鱼座",
"type": "1",
"sex": "0",
},
{
"photo": "images/home/room.png",
"name": "单身狗",
"distance": "2.55",
"constellation": "双鱼座",
"type": "1",
"sex": "1",
},
{
"photo": "images/home/room.png",
"name": "黑寡妇",
"distance": "4.0",
"constellation": "双鱼座",
"type": "1",
"sex": "0",
},
{
"photo": "images/home/photo.png",
"name": "钻石王老五",
"distance": "3.9",
"constellation": "双鱼座",
"type": "2",
"sex": "1",
},
{
"photo": "images/home/ranking.png",
"name": "钻石王老五",
"distance": "4.55",
"constellation": "射手座",
"type": "1",
"sex": "1",
}
];
List<Widget> _getData() {
List<Widget> arr = [];
for (var i = 0; i < _list.length; i++) {
arr.add(Column(
children: [
Container(
height: 84,
padding: EdgeInsets.fromLTRB(10, 6, 10, 6),
width: double.infinity,
decoration: BoxDecoration(
color: Color.fromRGBO(255, 255, 255, 1),
borderRadius: BorderRadius.all(Radius.circular(15)),
boxShadow: [
BoxShadow(
// color: Color.fromRGBO(51, 51, 51, 1),
color: Color.fromRGBO(0, 0, 0, 0.1),
offset: Offset(0.0, 4.0), //xy轴偏移量
blurRadius: 24.0, //
spreadRadius: 1.0 //
)
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
ClipOval(
child: Image.asset(
_list[i]['photo'],
width: 73,
height: 73,
),
),
SizedBox(
width: 8,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 9,
),
Row(
children: [
Text(
_list[i]['name'],
style: TextStyle(
fontSize: 14,
color: Color.fromRGBO(51, 51, 51, 1),
fontWeight: FontWeight.bold),
),
SizedBox(
width: 5,
),
// "images/home/man.png",//
_list[i]["sex"] == "0"
? Image.asset(
"images/home/girl.png",
width: 15,
height: 15,
)
: Image.asset(
"images/home/man.png",
width: 15,
height: 15,
),
],
),
Text(
"${_list[i]['distance']}km",
style: TextStyle(
fontSize: 10,
color: Color.fromRGBO(153, 153, 153, 1),
),
),
SizedBox(
height: 6,
),
Container(
padding: EdgeInsets.fromLTRB(8, 2, 8, 2),
decoration: BoxDecoration(
color: Color.fromRGBO(239, 239, 241, 1),
borderRadius: BorderRadius.all(Radius.circular(8)),
),
child: Text(
_list[i]['constellation'],
style: TextStyle(
fontSize: 10,
color: Color.fromRGBO(51, 51, 51, 1),
),
),
),
],
)
],
),
Container(
padding: EdgeInsets.fromLTRB(10, 6, 10, 6),
decoration: BoxDecoration(
color: Color.fromRGBO(234, 249, 251, 1),
borderRadius: BorderRadius.all(Radius.circular(13))),
child: Row(
children: [
Text(
'在玩${_list[i]['type'] == "1" ? "交友派对" : _list[i]['type'] == "2" ? "相亲房" : ""}',
style: TextStyle(
color: Color.fromRGBO(21, 185, 208, 1),
fontSize: 12,
fontWeight: FontWeight.w400,
),
),
SizedBox(
width: 8,
),
Image.asset(
"images/home/right_arrow_green.png",
width: 5,
height: 8,
),
],
),
),
],
),
),
SizedBox(
height: 10,
),
],
));
}
return arr;
}
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.fromLTRB(15, 0, 15, 0),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"玩友",
style: TextStyle(
color: Color.fromRGBO(51, 51, 51, 1),
fontSize: 16,
fontWeight: FontWeight.w800,
),
),
Row(
children: [
Text(
"开启位置权限,获得附近玩友",
style: TextStyle(
color: Color.fromRGBO(153, 153, 153, 1),
fontSize: 14,
),
),
SizedBox(
width: 6,
),
Image.asset(
"images/home/right_arrow.png",
width: 6,
height: 12,
)
],
)
],
),
SizedBox(
height: 16,
),
Column(
children: _getData(),
),
],
),
);
}
}

View File

@ -83,7 +83,9 @@ flutter:
- images/home/game-1.png
- images/home/game-2.png
- images/home/game-3.png
- images/home/girl.png
- images/home/man.png
- images/home/right_arrow_green.png
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware