redeem_query_view.dart
3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import 'dart:math';
import 'package:cp_offline_manage/common/colors.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'redeem_query_logic.dart';
class Redeem_queryPage extends GetView<Redeem_queryLogic> {
const Redeem_queryPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: GetBuilder<Redeem_queryLogic>(builder: (logic) {
return Text('${controller.queryStr}兑奖金额汇总');
}),
centerTitle: true,
backgroundColor: ColorConfig.themeColor,
actions: [
Container(
alignment: Alignment.center,
margin: const EdgeInsets.only(right: 20),
child: InkWell(
child: Image(
image: AssetImage("assets/images/home_icon/icon_filter_dwm.png"),
width: 24,
height: 24,
),
onTap: () {
showDialog(context: context, builder: _showFilterView);
},
),
)
],
),
body: Container(
child: ListView.builder(
itemBuilder: (item, index) {
return InkWell(
onTap: () {
controller.jumpToDetail('体育路${index + 1}门店');
},
child: Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.symmetric(horizontal: 16),
height: 64,
child: Row(
children: [
Expanded(
child: Row(
children: [
Text('体育路${index + 1}门店'),
Expanded(child: Container()),
GetBuilder<Redeem_queryLogic>(builder: (logic) {
return Text(
'${500 * Random().nextInt(101)}元',
style: TextStyle(color: Colors.green),
);
}),
],
)),
SizedBox(
width: 20,
),
Icon(
Icons.chevron_right,
size: 24,
color: ColorConfig.color99,
)
],
),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: .5, color: ColorConfig.colorCcc))),
),
);
},
itemCount: 20,
)));
}
// 过滤选项弹框
Widget _showFilterView(BuildContext context) {
return GetBuilder<Redeem_queryLogic>(builder: (logic) {
return AlertDialog(
content: SingleChildScrollView(
child: ListBody(
children: List.generate(controller.queryOptions.length, (index) {
var item = controller.queryOptions[index];
return CheckboxListTile(
title: Text("${item["queryName"]}"),
value: item["value"],
onChanged: (newValue) {
controller.updateQueryStr(index);
Navigator.of(context).pop();
},
);
})),
),
);
});
}
}