174 lines
6.3 KiB
Dart
174 lines
6.3 KiB
Dart
import 'package:cached_network_image/cached_network_image.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:talk/network/NetworkConfig.dart';
|
|
|
|
class PropPayDialog extends StatefulWidget {
|
|
Function onTap;
|
|
String priceImgUrl;
|
|
String productName;
|
|
String productDesc;
|
|
String price;
|
|
|
|
PropPayDialog(
|
|
{super.key, required this.onTap, required this.priceImgUrl, required this.productName, required this.productDesc, required this.price});
|
|
|
|
@override
|
|
State<PropPayDialog> createState() => _PropPayDialogState();
|
|
}
|
|
|
|
class _PropPayDialogState extends State<PropPayDialog> {
|
|
@override
|
|
void initState() {
|
|
// TODO: implement initState
|
|
super.initState();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final size = MediaQuery.of(context).size;
|
|
return Material(
|
|
type: MaterialType.transparency, //透明类型
|
|
color: Color(0x1A000000),
|
|
child: Container(
|
|
decoration: const BoxDecoration(
|
|
color: Color(0xFF19191A),
|
|
borderRadius: BorderRadius.only(
|
|
topLeft: Radius.circular(7),
|
|
topRight: Radius.circular(7),
|
|
)),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Container(
|
|
width: 25,
|
|
height: 3,
|
|
margin: EdgeInsets.only(top: 14),
|
|
decoration: BoxDecoration(color: Color(0xFF272734)),
|
|
),
|
|
Container(
|
|
alignment: Alignment.centerLeft,
|
|
margin: EdgeInsets.only(top: 16, left: 16),
|
|
child: Text(
|
|
'购买道具',
|
|
style: TextStyle(fontSize: 16, color: Colors.white),
|
|
),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(top: 18, left: 16),
|
|
child: Row(
|
|
children: [
|
|
ClipRRect(
|
|
borderRadius: BorderRadius.all(Radius.circular(7)),
|
|
child: Container(
|
|
color: Color(0xFF2A2A2A),
|
|
child: CachedNetworkImage(
|
|
width: 100,
|
|
height: 65,
|
|
fit: BoxFit.cover,
|
|
imageUrl: widget.priceImgUrl,
|
|
errorWidget: (context, url, error) => const Icon(Icons.error),
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: 180,
|
|
margin: EdgeInsets.only(left: 22),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
widget.productName,
|
|
style: TextStyle(fontSize: 16, color: Colors.white),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(top: 11),
|
|
child: Text(
|
|
widget.productDesc,
|
|
style: TextStyle(fontSize: 12, color: Color(0xFF9E9E9E)),
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Container(
|
|
height: 1,
|
|
margin: EdgeInsets.only(top: 23, left: 16, right: 16),
|
|
color: Color(0xFF484848),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(top: 20, left: 16, right: 16),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Text(
|
|
"账户余额${NetworkConfig.userInfoBean?.currency}语珠",
|
|
style: TextStyle(fontSize: 14, color: Color(0xFF9E9E9E)),
|
|
),
|
|
Text(
|
|
"合计 ${widget.price}语珠",
|
|
style: TextStyle(fontSize: 14, color: Colors.white),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Container(
|
|
height: 1,
|
|
margin: EdgeInsets.only(top: 23, left: 16, right: 16),
|
|
color: Color(0xFF484848),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(left: 16, right: 16, top: 25, bottom: 36),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
GestureDetector(
|
|
behavior: HitTestBehavior.opaque,
|
|
onTap: () {
|
|
Navigator.of(context).pop();
|
|
},
|
|
child: Container(
|
|
width: 159,
|
|
height: 40,
|
|
alignment: Alignment.center,
|
|
decoration: BoxDecoration(
|
|
color: Color(0xFF555555),
|
|
borderRadius: BorderRadius.all(Radius.circular(10)),
|
|
),
|
|
child: Text(
|
|
"取消",
|
|
style: TextStyle(fontSize: 16, color: Colors.white),
|
|
),
|
|
),
|
|
),
|
|
GestureDetector(
|
|
behavior: HitTestBehavior.opaque,
|
|
onTap: () {
|
|
widget.onTap();
|
|
Navigator.of(context).pop();
|
|
},
|
|
child: Container(
|
|
width: 159,
|
|
height: 40,
|
|
alignment: Alignment.center,
|
|
decoration: BoxDecoration(
|
|
color: Color(0xFFFF9000),
|
|
borderRadius: BorderRadius.all(Radius.circular(10)),
|
|
),
|
|
child: Text(
|
|
"购买",
|
|
style: TextStyle(fontSize: 16, color: Colors.black),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
)),
|
|
);
|
|
}
|
|
}
|