123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262 |
- import 'package:flutter/material.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'package:liftmanager/utils/toast.dart';
- import 'package:liftmanager/widgets/app_bar.dart';
- import 'package:liftmanager/widgets/load_image.dart';
- class VideoPay extends StatefulWidget {
- VideoPay(this.pay);
- final String pay;
- @override
- State<StatefulWidget> createState() {
- return VideoPayState();
- }
- }
- class VideoPayState extends State<VideoPay> {
- // ExpertListState({Key key}) : super(key: key);
- static const payType = [
- {
- "icon": "tab_first/pay_yue",
- "title": "账户余额",
- "price": "",
- },
- {
- "icon": "tab_first/pay_zhifubao",
- "title": "支付宝",
- },
- {
- "icon": "tab_first/pay_winxin",
- "title": "微信",
- },
- ];
- int indexNow = 999;
- String checkFalse = "tab_first/check_false";
- String checkTrue = "tab_first/check_true";
- @override
- Widget build(BuildContext context) {
- double width = MediaQuery.of(context).size.width;
- return Container(
- child: Scaffold(
- appBar: MyAppBar(
- centerTitle: "打赏",
- ),
- body: Container(
- child: Stack(
- children: <Widget>[
- Container(
- // padding: EdgeInsets.only(top:70),
- child: ListView(children: <Widget>[
- Container(
- padding: EdgeInsets.only(
- left: ScreenUtil().setWidth(15),
- right: ScreenUtil().setWidth(15),
- top: ScreenUtil().setWidth(15),
- bottom: ScreenUtil().setWidth(15)),
- decoration: BoxDecoration(
- border: Border(
- bottom:
- BorderSide(width: 5, color: Color(0xfff5f5f5)),
- ),
- ),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: <Widget>[
- Row(
- crossAxisAlignment: CrossAxisAlignment.center,
- children: <Widget>[
- Text(
- "学堂打赏",
- style: TextStyle(
- color: Color(0xff333333),
- fontSize: ScreenUtil().setSp(16)),
- textAlign: TextAlign.start,
- ),
- Container(
- padding: EdgeInsets.only(
- left: ScreenUtil().setWidth(10)),
- child: Text(
- "小小维修工",
- style: TextStyle(
- color: Color(0xff666666),
- fontSize: ScreenUtil().setSp(16)),
- textAlign: TextAlign.start,
- ),
- )
- ]),
- Container(
- child: Text(
- "¥${widget.pay}",
- style: TextStyle(
- color: Colors.red,
- fontSize: ScreenUtil().setSp(16)),
- textAlign: TextAlign.end,
- ),
- )
- ])),
- Container(
- padding: EdgeInsets.only(
- left: ScreenUtil().setWidth(15),
- right: ScreenUtil().setWidth(15),
- top: ScreenUtil().setWidth(15),
- bottom: ScreenUtil().setWidth(15)),
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(width: 5, color: Color(0xfff5f5f5)),
- ),
- ),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: <Widget>[
- Text(
- "共需支付",
- style: TextStyle(
- color: Color(0xff222222),
- fontSize: ScreenUtil().setSp(16)),
- textAlign: TextAlign.start,
- ),
- Text(
- "¥${widget.pay}",
- style: TextStyle(
- color: Colors.red,
- fontSize: ScreenUtil().setSp(16)),
- textAlign: TextAlign.start,
- ),
- ]),
- ),
- Container(
- padding: EdgeInsets.only(
- left: ScreenUtil().setWidth(15),
- right: ScreenUtil().setWidth(15),
- top: ScreenUtil().setWidth(100),
- bottom: ScreenUtil().setWidth(10)),
- decoration: BoxDecoration(
- border: Border(
- bottom:
- BorderSide(width: 0.5, color: Color(0xfff5f5f5)),
- ),
- ),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: <Widget>[
- Text(
- "选择支付方式",
- style: TextStyle(
- color: Color(0xff000000),
- fontSize: ScreenUtil().setSp(16)),
- textAlign: TextAlign.start,
- ),
- ]),
- ),
- Container(
- padding: EdgeInsets.only(
- left: ScreenUtil().setWidth(15),
- right: ScreenUtil().setWidth(15)),
- child: Column(
- children: payType.asMap().keys.map((i) {
- return Container(
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(
- width: 0.5, color: Color(0xfff5f5f5)),
- ),
- ),
- height: 60,
- child: Row(
- mainAxisAlignment:
- MainAxisAlignment.spaceBetween,
- children: <Widget>[
- Row(
- children: <Widget>[
- LoadAssetImage(
- // image: AssetImage(i['img']),
- payType[i]["icon"],
- width: ScreenUtil().setWidth(26),
- height: ScreenUtil().setWidth(26),
- // alignment: Alignment.centerLeft,
- ),
- Container(width: 5, child: null),
- Text(
- payType[i]["title"],
- style: TextStyle(
- color: Color(0xff000000),
- fontSize: ScreenUtil().setSp(16)),
- textAlign: TextAlign.start,
- ),
- Container(width: 5, child: null),
- Text(
- payType[i]["price"] != null
- ? "¥${payType[i]["price"]}"
- : "",
- style: TextStyle(
- color: Color(0xff999999),
- fontSize: ScreenUtil().setSp(16)),
- textAlign: TextAlign.start,
- ),
- ],
- ),
- InkWell(
- child: Container(
- // padding: EdgeInsets.only(top:10,left:5,right:5,bottom:10),
- child: LoadAssetImage(
- // image: AssetImage(i['img']),
- indexNow == i
- ? checkTrue
- : checkFalse,
- width: ScreenUtil().setWidth(20),
- height: ScreenUtil().setWidth(20),
- // alignment: Alignment.centerLeft,
- ),
- ),
- onTap: () {
- setState(() {
- indexNow = i;
- });
- print(indexNow);
- },
- ),
- ]));
- }).toList(),
- ))
- ]),
- ),
- Positioned(
- bottom: 0,
- left: 0,
- child: Container(
- width: width,
- padding: EdgeInsets.only(
- top: ScreenUtil().setWidth(15),
- bottom: ScreenUtil().setWidth(15),
- left: ScreenUtil().setWidth(25),
- right: ScreenUtil().setWidth(25)),
- color: Colors.white,
- child: Container(
- height: ScreenUtil().setWidth(44),
- decoration: BoxDecoration(
- borderRadius:
- BorderRadius.circular(ScreenUtil().setWidth(22)),
- gradient: const LinearGradient(
- colors: [Color(0xFF00D9FF), Color(0xFF0287FF)]),
- ),
- child: FlatButton(
- // padding: EdgeInsets.all(15.0),
- child: Text("立即支付"),
- textColor: Colors.white,
- onPressed: () {
- toasts("支付成功");
- Navigator.pop(context);
- },
- ),
- ),
- ))
- ],
- ))),
- );
- }
- }
|