123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- import 'package:flutter/material.dart';
- import 'package:liftmanager/res/colors.dart';
- import 'package:liftmanager/widgets/app_bar.dart';
- import 'package:liftmanager/utils/time_format.dart';
- import 'package:liftmanager/internal/wode/model/wallet_model.dart';
- class WalletDetailPage extends StatefulWidget {
- WalletDetailPage(this.model, this.typeTitle);
- Records model;
- String typeTitle;
- // int id;
- @override
- State<StatefulWidget> createState() {
- return WalletDetailPageState();
- }
- }
- class WalletDetailPageState extends State<WalletDetailPage>
- with AutomaticKeepAliveClientMixin {
- @override
- void initState() {
- super.initState();
- }
- // getDetail() {
- // NewApiService().getMoneyDetail(widget.id, onSuccess: (res) {
- // detail = MoneyDetailModel.fromJson(res);
- // // getUserInfo();
- // setState(() {});
- // }, onError: (code, msg) {
- // toasts(msg);
- // });
- // }
- @override
- void dispose() {
- // provider.dispose();
- super.dispose();
- }
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- resizeToAvoidBottomPadding: false,
- appBar: MyAppBar(
- centerTitle: "零钱明细",
- ),
- body: Container(
- // color: Colors.red,
- child: Column(
- children: [
- Column(
- children: [
- SizedBox(
- height: 35,
- ),
- Text(
- '${widget.typeTitle}',
- style: TextStyle(fontSize: 18),
- ),
- Text(
- '${widget.model.descr ?? ''}',
- style: TextStyle(fontSize: 13, color: Colours.text_gray),
- ),
- SizedBox(
- height: 35,
- ),
- Text(
- '¥${widget.model.amount ?? ''}',
- style: TextStyle(fontSize: 24, color: Colors.red),
- ),
- SizedBox(
- height: 35,
- ),
- ],
- ),
- Column(
- children: [
- cell('类型', '${widget.model.type == 1 ? '支出' : '收入'}'),
- cell('时间',
- '${DateUtils.instance.getFormartData(timeSamp: widget.model.createTime, format: "yyyy-MM-dd HH:mm")}'),
- cell('交易单号', '${widget.model.flowNum ?? ''}'),
- cell('余额', '${widget.model.balance ?? ''}'),
- cell('备注', '${widget.model.descr ?? ''}'),
- ],
- ),
- SizedBox(
- height: 30,
- ),
- Expanded(
- child: Container(
- color: Colours.bg_gray,
- ))
- ],
- )));
- }
- cell(title, value) {
- return Container(
- padding: EdgeInsets.fromLTRB(10, 5, 10, 5),
- child: Row(
- children: [
- Container(
- width: 70,
- child: Text(
- title,
- style: TextStyle(color: Colours.text_gray, fontSize: 13),
- ),
- ),
- SizedBox(
- width: 20,
- ),
- Text(
- value,
- style: TextStyle(color: Colours.text, fontSize: 13),
- )
- ],
- ),
- );
- }
- @override
- bool get wantKeepAlive => true;
- }
|