Commit 159b689f9fad82504dad2cc0ad5e15507c157e60

Authored by weixin_45529955
1 parent 3092868f

余额明细页面

import 'package:flutter/material.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/screen_util.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/round_button.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
/**
* 余额明细页面
... ... @@ -12,8 +18,169 @@ class BalanceDetailsPage extends StatefulWidget {
}
class _BalanceDetailsPageState extends State<BalanceDetailsPage> {
ScrollController controller = ScrollController();
Widget _item() {
return Container(
padding: EdgeInsets.only(left: w(20), right: w(20), top: w(10)),
decoration: BoxDecoration(
border: Border(
bottom:
BorderSide(width: w(0.5), color: MyColours.color_CBCBCB))),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
Text(
'充值',
style: TextStyle(
color: MyColours.color_000000,
fontSize: font(14),
),
),
Text(
'+¥300.00',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: font(14),
fontWeight: FontWeight.bold),
)
]),
VEmptyView(28),
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
Text(
'2025-08-31 15:43:23',
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(14),
),
),
Text(
'变动后余额 ¥220.00',
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(14),
),
)
]),
VEmptyView(16),
Text(
'备注:顾客已付现金',
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(14),
),
),
VEmptyView(8),
],
),
);
}
@override
Widget build(BuildContext context) {
return const Placeholder();
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar('余额明细'),
body: Column(children: [
Expanded(
child: SingleChildScrollView(
controller: controller,
child: Stack(
children: <Widget>[
ListView.builder(
padding: EdgeInsets.only(top: w(50)),
controller: controller,
shrinkWrap: true,
itemCount: 20,
itemBuilder: (BuildContext context, int index) {
return _item();
},
),
Positioned(
top: 0, // 你可以根据需要调整位置
left: 0, // 你可以根据需要调整位置
right: 0, // 你可以根据需要调整位置
child: Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: w(0.5),
color: MyColours.color_CBCBCB))),
margin: EdgeInsets.only(bottom: w(10)),
padding: EdgeInsets.symmetric(
horizontal: w(20),
vertical: w(10)), // 根据需要调整内边距
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'余额',
style: TextStyle(
color: MyColours.color_000000,
fontSize: font(16),
fontWeight: FontWeight.bold),
),
Text(
'¥520',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: font(20),
fontWeight: FontWeight.bold),
)
],
)),
),
],
))),
Container(
padding: EdgeInsets.symmetric(horizontal: w(20), vertical: w(19)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RoundButton(
text: '充值',
width: w(105),
height: w(43),
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
radius: r(5),
onPressed: () {
//
},
),
HEmptyView(20),
RoundButton(
text: '扣除',
width: w(105),
height: w(43),
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
textColor: MyColours.color_438E93,
radius: r(5),
onPressed: () {
//
},
),
HEmptyView(20),
Expanded(
child: RoundButton(
text: '退款',
height: w(43),
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
textColor: MyColours.color_438E93,
radius: r(5),
onPressed: () {
//
},
))
],
),
)
]));
}
}
... ...
import 'package:flutter/material.dart';
class MyColours {
static const Color color_CBCBCB = Color(0xFFCBCBCB);
static const Color color_C80010 = Color(0xFFC80010);
static const Color color_EFEFF0 = Color(0xFFEFEFF0);
static const Color color_FFEFC5 = Color(0xFFFFEFC5);
... ...