d1d32220
liangchengyou
feat:兑换课程+购买记录
|
1
2
|
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
|
d1d32220
liangchengyou
feat:兑换课程+购买记录
|
3
4
5
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:wow_english/common/extension/string_extension.dart';
import 'package:wow_english/common/widgets/textfield_customer_widget.dart';
|
608c05b4
liangchengyou
feat:兑换课程
|
6
|
import 'package:wow_english/pages/shop/exchane/widegts/exchange_result_dialog.dart';
|
d1d32220
liangchengyou
feat:兑换课程+购买记录
|
7
|
import 'package:wow_english/route/route.dart';
|
d1d32220
liangchengyou
feat:兑换课程+购买记录
|
8
|
|
5b87e560
吴启风
feat:导航栏视觉优化
|
9
|
import '../../../common/widgets/we_app_bar.dart';
|
d1d32220
liangchengyou
feat:兑换课程+购买记录
|
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
import 'bloc/exchange_lesson_bloc.dart';
class ExchangeLessonPage extends StatelessWidget {
const ExchangeLessonPage({super.key});
@override
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => ExchangeLessonBloc(),
child: _ExchangeLessonPage(),
);
}
}
class _ExchangeLessonPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
|
c61b3c1a
Key
feat: toast_util....
|
27
28
|
return BlocListener<ExchangeLessonBloc, ExchangeLessonState>(
listener: (context, state) {
|
d1d32220
liangchengyou
feat:兑换课程+购买记录
|
29
|
if (state is CheckCodeResultState) {
|
608c05b4
liangchengyou
feat:兑换课程
|
30
31
32
|
showDialog<ExChangeResultDialog>(
context: context,
barrierDismissible: !state.result,
|
5b87e560
吴启风
feat:导航栏视觉优化
|
33
|
builder: (context) {
|
608c05b4
liangchengyou
feat:兑换课程
|
34
|
return ExChangeResultDialog(
|
5b87e560
吴启风
feat:导航栏视觉优化
|
35
36
|
resultType: state.result,
onTap: () {
|
15987941
liangchengyou
feat:兑换码接口+本地密码加密
|
37
|
popPage();
|
5b87e560
吴启风
feat:导航栏视觉优化
|
38
39
|
});
});
|
d1d32220
liangchengyou
feat:兑换课程+购买记录
|
40
41
42
43
44
45
|
}
},
child: _exchangeLessonPageView(),
);
}
|
5b87e560
吴启风
feat:导航栏视觉优化
|
46
47
48
|
Widget _exchangeLessonPageView() =>
BlocBuilder<ExchangeLessonBloc, ExchangeLessonState>(
builder: (context, state) {
|
d1d32220
liangchengyou
feat:兑换课程+购买记录
|
49
50
|
final bloc = BlocProvider.of<ExchangeLessonBloc>(context);
return Scaffold(
|
5b87e560
吴启风
feat:导航栏视觉优化
|
51
52
|
resizeToAvoidBottomInset: false,
body: Stack(
|
d1d32220
liangchengyou
feat:兑换课程+购买记录
|
53
|
children: [
|
5b87e560
吴启风
feat:导航栏视觉优化
|
54
55
56
57
|
Container(
color: Colors.white,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
|
d1d32220
liangchengyou
feat:兑换课程+购买记录
|
58
|
children: [
|
5b87e560
吴启风
feat:导航栏视觉优化
|
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
106
107
108
109
110
111
|
10.5.verticalSpace,
Padding(
padding: EdgeInsets.symmetric(horizontal: 15.w),
child: Center(
child: Image.asset(
'wow_ex_lesson'.assetPng,
width: 139.w,
height: 81.h,
),
),
),
Expanded(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 135.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TextFieldCustomerWidget(
height: 55.h,
hitText: '请输入兑换码',
bgImageName: 'Input_layer_up',
textInputType: TextInputType.emailAddress,
controller: bloc.codeNumberController,
onChangeValue: (String value) {
bloc.add(CodeNumberChangeEvent());
},
),
21.5.verticalSpace,
GestureDetector(
onTap: () {
if (bloc.checkCode) {
bloc.add(CheckCodeEvent());
}
},
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(bloc.checkCode
? 'ex_sure'.assetPng
: 'ex_dis'.assetPng),
fit: BoxFit.fill),
),
padding: EdgeInsets.symmetric(
horizontal: 27.w, vertical: 14.h),
child: Text(
'兑换',
style: TextStyle(
fontSize: 16.sp, color: Colors.white),
),
),
)
],
),
|
d1d32220
liangchengyou
feat:兑换课程+购买记录
|
112
|
),
|
d1d32220
liangchengyou
feat:兑换课程+购买记录
|
113
114
|
),
Image.asset(
|
5b87e560
吴启风
feat:导航栏视觉优化
|
115
|
'bottom_grass'.assetPng,
|
d1d32220
liangchengyou
feat:兑换课程+购买记录
|
116
|
),
|
d1d32220
liangchengyou
feat:兑换课程+购买记录
|
117
118
119
|
],
),
),
|
5b87e560
吴启风
feat:导航栏视觉优化
|
120
121
122
123
124
125
|
const Positioned(
top: 0,
left: 0,
right: 0,
child: WEAppBar(
backgroundColor: Colors.transparent,
|
d1d32220
liangchengyou
feat:兑换课程+购买记录
|
126
127
|
),
),
|
d1d32220
liangchengyou
feat:兑换课程+购买记录
|
128
|
],
|
5b87e560
吴启风
feat:导航栏视觉优化
|
129
|
));
|
d1d32220
liangchengyou
feat:兑换课程+购买记录
|
130
|
});
|
c61b3c1a
Key
feat: toast_util....
|
131
|
}
|