Commit 6d85073fe58602223a88ac5ecc6cc658af8e569f

Authored by wdn127929
1 parent 713af384

统计列表okok

... ... @@ -6,6 +6,7 @@ import 'package:one_key/utils/dialog_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
typedef ClickCallback = void Function(String value);
enum TimeType { TimeTypeStart, TimeTypeEnd, TimeTypeDefalt }
... ... @@ -29,6 +30,7 @@ class _StatisticsPageState extends State<StatisticsPage> {
int currentIndex = 0;
TextEditingController controller = TextEditingController();
StaticsModel tableHeaderModel;
String sortstr = '排序';
@override
void initState() {
... ... @@ -50,33 +52,6 @@ class _StatisticsPageState extends State<StatisticsPage> {
controller.text = '50';
}
///筛选条件
Widget _menuWidget(DateTime date) {
return Container(
padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(26)),
height: ScreenUtil().setWidth(100),
child: Row(
children: [
GestureDetector(
onTap: () {
DialogUtil.showCalendarDialog(context, date).then((day) {
if (day != null) {}
});
},
child: Container(
child: Text(
dateS,
style: TextStyle(
color: MyColours.color_199095,
fontSize: ScreenUtil().setSp(26)),
),
),
),
],
),
);
}
_buttonChoose(String title, ClickCallback callback,
{TimeType timeType = TimeType.TimeTypeDefalt}) {
return InkWell(
... ... @@ -101,7 +76,11 @@ class _StatisticsPageState extends State<StatisticsPage> {
color: title == '开始日期' || title == '结束日期' || title == '排序'
? MyColours.color_999999
: MyColours.color_199095,
fontSize: ScreenUtil().setWidth(26)),
fontSize: ScreenUtil().setWidth(26),
fontWeight:
title == '开始日期' || title == '结束日期' || title == '排序'
? FontWeight.normal
: FontWeight.bold),
),
timeType != TimeType.TimeTypeDefalt
? SizedBox()
... ... @@ -172,15 +151,113 @@ class _StatisticsPageState extends State<StatisticsPage> {
Navigator.pop(context);
},
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
body: Stack(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
VEmptyView(100),
Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40)),
color: MyColours.color_f5f5f5,
// width: double.infinity,
height: ScreenUtil().setWidth(80),
child: Row(
children: [
Text(
'显示前 ',
style: TextStyle(
fontSize: ScreenUtil().setSp(26),
color: MyColours.color_333333),
),
Container(
alignment: Alignment.center,
margin: EdgeInsets.symmetric(
vertical: ScreenUtil().setWidth(20)),
// alignment: Alignment.centerLeft,
// height: ScreenUtil().setWidth(80),
constraints: BoxConstraints(
maxWidth: ScreenUtil().setWidth(50 * 2)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: ScreenUtil().setWidth(2),
color: MyColours.color_199095))),
child: IntrinsicWidth(
child: TextField(
controller: controller,
maxLines: 1,
// inputFormatters: [
// LengthLimitingTextInputFormatter(9),
// WhitelistingTextInputFormatter.digitsOnly
// ],
// inputFormatters: [
// NumLengthInputFormatter(
// decimalLength: 2, integerLength: 6),
// ],
// focusNode: numberFocusNode,
//光标颜色
cursorColor: MyColours.color_199095,
//输入文本的样式
style: TextStyle(
fontSize: ScreenUtil().setSp(26),
color: MyColours.color_199095),
textAlign: TextAlign.center,
textInputAction: TextInputAction.done,
decoration: InputDecoration(
isDense: true,
hintText: "输入",
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(26),
),
contentPadding: EdgeInsets.zero, //ios 17
border: InputBorder.none,
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //隐藏键盘
// _updateMoney();
},
keyboardType:
TextInputType.numberWithOptions(decimal: true),
)))
],
)),
//表头
_tableItem(
tableHeaderModel, 3, TableItemType.TableItemTypeHeader),
Expanded(
child: ListView.builder(
itemCount: 100,
itemBuilder: (BuildContext context, int index) {
StaticsModel tableHeaderModel1 = StaticsModel();
tableHeaderModel1.select = true;
tableHeaderModel1.numstr = '$index';
tableHeaderModel1.name = '某某';
tableHeaderModel1.phone = '1879097890';
tableHeaderModel1.count = '${index}次';
return _tableItem(tableHeaderModel1, index,
TableItemType.TableItemTypeBody);
}))
],
),
Padding(
padding:
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(40)),
child: Container(
height: ScreenUtil().setWidth(100),
// height: ScreenUtil().setWidth(100),
// color: Colors.red,
// margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(120)),
padding: EdgeInsets.only(top: ScreenUtil().setWidth(26)),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buttonChoose(dateS, (value) {
DialogUtil.showCalendarDialog(context, datetimeS)
... ... @@ -195,12 +272,15 @@ class _StatisticsPageState extends State<StatisticsPage> {
});
}, timeType: TimeType.TimeTypeStart),
HEmptyView(10),
Text(
'至',
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_199095,
fontWeight: FontWeight.bold),
Padding(
padding: EdgeInsets.only(top: ScreenUtil().setWidth(6)),
child: Text(
'至',
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_199095,
fontWeight: FontWeight.bold),
),
),
HEmptyView(10),
_buttonChoose(dateE, (value) {
... ... @@ -216,119 +296,36 @@ class _StatisticsPageState extends State<StatisticsPage> {
});
}, timeType: TimeType.TimeTypeEnd),
HEmptyView(10),
Stack(clipBehavior: Clip.none, children: [
_buttonChoose('排序', (value) {
setState(() {
showWidget = !showWidget;
print('1');
});
}),
Positioned(
left: 0,
top: ScreenUtil().setWidth(58),
child: Material(
color: Colors.transparent,
child: Offstage(
offstage: showWidget,
child: _selectWidget(selectList, (index) {
setState(() {
showWidget = !showWidget;
currentIndex = index;
});
}),
))),
])
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buttonChoose(sortstr, (value) {
setState(() {
showWidget = !showWidget;
print('1');
});
}),
VEmptyView(10),
Container(
// margin: EdgeInsets.only(
// bottom: ScreenUtil().setWidth(58 + 10)),
child: Material(
color: Colors.transparent,
child: Offstage(
offstage: showWidget,
child: _selectWidget(selectList, (index) {
print(selectList[index]);
setState(() {
showWidget = !showWidget;
currentIndex = index;
sortstr = selectList[index];
});
}),
))),
])
],
),
)),
Container(
alignment: Alignment.centerLeft,
padding:
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(40)),
color: MyColours.color_f5f5f5,
// width: double.infinity,
height: ScreenUtil().setWidth(80),
child: Row(
children: [
Text(
'显示前 ',
style: TextStyle(
fontSize: ScreenUtil().setSp(26),
color: MyColours.color_333333),
),
Container(
alignment: Alignment.center,
margin: EdgeInsets.symmetric(
vertical: ScreenUtil().setWidth(20)),
// alignment: Alignment.centerLeft,
// height: ScreenUtil().setWidth(80),
constraints: BoxConstraints(
maxWidth: ScreenUtil().setWidth(50 * 2)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: ScreenUtil().setWidth(2),
color: MyColours.color_199095))),
child: IntrinsicWidth(
child: TextField(
controller: controller,
maxLines: 1,
// inputFormatters: [
// LengthLimitingTextInputFormatter(9),
// WhitelistingTextInputFormatter.digitsOnly
// ],
// inputFormatters: [
// NumLengthInputFormatter(
// decimalLength: 2, integerLength: 6),
// ],
// focusNode: numberFocusNode,
//光标颜色
cursorColor: MyColours.color_199095,
//输入文本的样式
style: TextStyle(
fontSize: ScreenUtil().setSp(26),
color: MyColours.color_199095),
textAlign: TextAlign.center,
textInputAction: TextInputAction.done,
decoration: InputDecoration(
isDense: true,
hintText: "输入",
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(26),
),
contentPadding: EdgeInsets.zero, //ios 17
border: InputBorder.none,
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //隐藏键盘
// _updateMoney();
},
keyboardType:
TextInputType.numberWithOptions(decimal: true),
)))
],
)),
//表头
_tableItem(tableHeaderModel, 3, TableItemType.TableItemTypeHeader),
Expanded(
child: ListView.builder(
itemCount: 100,
itemBuilder: (BuildContext context, int index) {
StaticsModel tableHeaderModel1 = StaticsModel();
tableHeaderModel1.select = true;
tableHeaderModel1.numstr = '$index';
tableHeaderModel1.name = '某某';
tableHeaderModel1.phone = '1879097890';
tableHeaderModel1.count = '${index}次';
return _tableItem(tableHeaderModel1, index,
TableItemType.TableItemTypeBody);
}))
],
),
);
... ...