Blame view

lib/common/dialogs/customer_dialog.dart 6.46 KB
99571208   liangchengyou   feat:弹窗
1
2
  import 'package:flutter/material.dart';
  import 'package:flutter_screenutil/flutter_screenutil.dart';
99571208   liangchengyou   feat:弹窗
3
4
5
6
7
8
9
10
11
12
13
14
15
  
  class CustomerTwoActionDialog extends Dialog {
    const CustomerTwoActionDialog(
        this.title,
        this.leftTitle,
        this.rightTitle,
        this.content,
        this.leftTap,
        this.rightTap, {super.key});
    final String title;
    final String leftTitle;
    final String rightTitle;
    final String content;
3840b7fe   liangchengyou   feat:更新设置页面
16
17
    final GestureTapCallback? leftTap;
    final GestureTapCallback? rightTap;
99571208   liangchengyou   feat:弹窗
18
19
20
21
22
  
    @override
    Widget build(BuildContext context) {
      super.build(context);
      return Container(
934e2b47   liangchengyou   feat:权限调整+课程进度接口对接
23
        height: 208.h,
99571208   liangchengyou   feat:弹窗
24
25
26
        alignment: Alignment.center,
        child: ConstrainedBox(
          constraints: BoxConstraints(
934e2b47   liangchengyou   feat:权限调整+课程进度接口对接
27
            maxHeight: 208.h,
68dd7ba8   liangchengyou   feat:首页主题颜色+已知问题修改
28
            maxWidth: 307.w
99571208   liangchengyou   feat:弹窗
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
          ),
          child: Container(
            padding: EdgeInsets.symmetric(horizontal: 24.w,vertical: 15.h),
            decoration: BoxDecoration(
                color: Colors.white,
                border: Border.all(
                    color: const Color(0xFF333333),
                    width: 1.5
                ),
                borderRadius: BorderRadius.circular(10.r)
            ),
            child: Column(
              children: [
                Text(
                  title,
                  textAlign: TextAlign.center,
                  style: TextStyle(
                      fontSize: 21.sp,
                      color: const Color(0xFF333333)
                  ),
                ),
                Expanded(
934e2b47   liangchengyou   feat:权限调整+课程进度接口对接
51
52
53
54
55
56
57
58
59
60
                  child: Container(
                    alignment: Alignment.center,
                    child: Text(
                        content,
                        textAlign: TextAlign.left,
                        style: TextStyle(
                            color: const Color(0xFF333333),
                            fontSize: 13.sp
                        )
                    ),
99571208   liangchengyou   feat:弹窗
61
62
63
64
65
66
67
68
                  ),
                ),
                Row(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    TextButton(
                        onPressed: leftTap,
                        child: Container(
99571208   liangchengyou   feat:弹窗
69
                          padding: EdgeInsets.symmetric(
934e2b47   liangchengyou   feat:权限调整+课程进度接口对接
70
                              horizontal: 6.w,vertical: 2.h
99571208   liangchengyou   feat:弹窗
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
                          ),
                          decoration: BoxDecoration(
                              color: const Color(0xFFFBB661),
                              border: Border.all(
                                  color: const Color(0xFF333333),
                                  width: 1.5
                              ),
                              borderRadius: BorderRadius.circular(10.r)
                          ),
                          child: Text(
                            leftTitle,
                            textAlign: TextAlign.center,
                            style: TextStyle(
                                color: Colors.white,
                                fontSize: 19.sp
                            ),),
                        )),
                    27.horizontalSpace,
                    TextButton(
                        onPressed: rightTap,
                        child: Container(
99571208   liangchengyou   feat:弹窗
92
93
94
95
96
97
98
99
100
                          decoration: BoxDecoration(
                              color: Colors.white,
                              border: Border.all(
                                  color: const Color(0xFF333333),
                                  width: 1.0
                              ),
                              borderRadius: BorderRadius.circular(10.r)
                          ),
                          padding: EdgeInsets.symmetric(
934e2b47   liangchengyou   feat:权限调整+课程进度接口对接
101
                              horizontal: 6.w,vertical: 2.h
99571208   liangchengyou   feat:弹窗
102
                          ),
934e2b47   liangchengyou   feat:权限调整+课程进度接口对接
103
                          alignment: Alignment.center,
99571208   liangchengyou   feat:弹窗
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
                          child: Text(
                            rightTitle,
                            textAlign: TextAlign.center,
                            style: TextStyle(
                                color: const Color(0xFF333333),
                                fontSize: 19.sp
                            ),),
                        ))
                  ],
                )
              ],
            ),
          ),
        ),
      );
    }
  }
  
  class CustomerOneActionDialog extends Dialog {
    const CustomerOneActionDialog(this.title, this.ensureTitle, this.content, this.ensureTap, {super.key});
    final String title;
    final String ensureTitle;
    final String content;
    final GestureTapCallback ensureTap;
  
    @override
    Widget build(BuildContext context) {
      super.build(context);
      return Container(
        alignment: Alignment.center,
        child: ConstrainedBox(
          constraints: BoxConstraints(
934e2b47   liangchengyou   feat:权限调整+课程进度接口对接
136
137
            maxHeight: 208.h,
            maxWidth: 247.w
99571208   liangchengyou   feat:弹窗
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
          ),
          child: Container(
            padding: EdgeInsets.symmetric(horizontal: 24.w,vertical: 15.h),
            decoration: BoxDecoration(
                color: Colors.white,
                border: Border.all(
                    color: const Color(0xFF333333),
                    width: 1.5
                ),
                borderRadius: BorderRadius.circular(10.r)
            ),
            child: Column(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Text(
                  title,
                  textAlign: TextAlign.center,
                  style: TextStyle(
                      fontSize: 21.sp,
                      color: const Color(0xFF333333)
                  ),
                ),
                Text(
                    content,
                    textAlign: TextAlign.left,
                    style: TextStyle(
                        color: const Color(0xFF333333),
                        fontSize: 13.sp
                    )
                ),
                TextButton(
                    onPressed: ensureTap,
                    child: Container(
                      height: 31.h,
                      decoration: BoxDecoration(
                          color: Colors.white,
                          border: Border.all(
                              color: const Color(0xFF333333),
                              width: 1.0
                          ),
                          borderRadius: BorderRadius.circular(10.r)
                      ),
                      padding: EdgeInsets.symmetric(
                          horizontal: 6.w
                      ),
                      child: Text(
                        ensureTitle,
                        textAlign: TextAlign.center,
                        style: TextStyle(
                            color: const Color(0xFF333333),
                            fontSize: 19.sp
                        ),),
                    ))
              ],
            ),
          ),
        ),
      );
    }
  }