You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
1.8 KiB
72 lines
1.8 KiB
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
class LiveRoomGiftItem extends StatefulWidget {
|
|
final Map item;
|
|
final int active;
|
|
final int index;
|
|
final void Function(int) changeActive;
|
|
const LiveRoomGiftItem({
|
|
super.key,
|
|
required this.item,
|
|
required this.active,
|
|
required this.index,
|
|
required this.changeActive,
|
|
});
|
|
|
|
@override
|
|
State<LiveRoomGiftItem> createState() => _LiveRoomGiftItemState();
|
|
}
|
|
|
|
class _LiveRoomGiftItemState extends State<LiveRoomGiftItem> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return InkWell(
|
|
onTap: () {
|
|
widget.changeActive(widget.index);
|
|
},
|
|
child: Container(
|
|
width: 83.w,
|
|
height: 94.w,
|
|
padding: EdgeInsets.only(top: 10.w),
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.all(Radius.circular(9.w)),
|
|
color: Color.fromRGBO(
|
|
117,
|
|
98,
|
|
249,
|
|
widget.active == widget.index ? .2 : 0,
|
|
),
|
|
border: Border.all(
|
|
width: 1,
|
|
color: Color.fromRGBO(
|
|
117,
|
|
98,
|
|
249,
|
|
widget.active == widget.index ? 1 : 0,
|
|
),
|
|
),
|
|
),
|
|
child: Column(
|
|
children: [
|
|
Image.asset(widget.item["icon"], width: 41.w, height: 41.w),
|
|
SizedBox(height: 7.w),
|
|
Text(
|
|
widget.item["title"],
|
|
style: TextStyle(fontSize: 11.w, color: Colors.white),
|
|
),
|
|
SizedBox(height: 1.w),
|
|
Text(
|
|
"${widget.item["price"]}支",
|
|
style: TextStyle(
|
|
fontSize: 7.w,
|
|
color: const Color.fromRGBO(144, 144, 144, 1),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|