Browse Source

修改公告

chenzubin 3 months ago
parent
commit
07d65ed84c
1 changed files with 18 additions and 9 deletions
  1. 18 9
      lib/agreement.dart

+ 18 - 9
lib/agreement.dart

@@ -28,6 +28,9 @@ class AgreementState extends State<Agreement> {
28
   String strHtml = "";
28
   String strHtml = "";
29
   String strHtml1 = "";
29
   String strHtml1 = "";
30
   String strHtml2 = "";
30
   String strHtml2 = "";
31
+  String strHtml3 = "";
32
+  String strHtml4 = "";
33
+  String strHtml5 = "";
31
 
34
 
32
   @override
35
   @override
33
   void initState() {
36
   void initState() {
@@ -52,13 +55,23 @@ class AgreementState extends State<Agreement> {
52
         int i = 0;
55
         int i = 0;
53
         parser.parse(mNormalResponse3?.data).body?.children.forEach((element) {
56
         parser.parse(mNormalResponse3?.data).body?.children.forEach((element) {
54
           if (i == 0) {
57
           if (i == 0) {
55
-            strHtml = element.text + "\n";
58
+            strHtml = element.text;
56
             i++;
59
             i++;
57
           } else if (i == 1) {
60
           } else if (i == 1) {
58
             strHtml1 = element.text;
61
             strHtml1 = element.text;
59
             i++;
62
             i++;
60
           } else if (i == 2) {
63
           } else if (i == 2) {
61
             strHtml2 = element.text;
64
             strHtml2 = element.text;
65
+            i++;
66
+          } else if (i == 3) {
67
+            strHtml3 = element.text;
68
+            i++;
69
+          } else if (i == 4) {
70
+            strHtml4 = element.text;
71
+            i++;
72
+          } else if (i == 5) {
73
+            strHtml5 = element.text;
74
+            i++;
62
           }
75
           }
63
         });
76
         });
64
         setState(() {});
77
         setState(() {});
@@ -97,7 +110,8 @@ class AgreementState extends State<Agreement> {
97
             },
110
             },
98
           ),
111
           ),
99
         ),
112
         ),
100
-        body: Center(
113
+        body: SingleChildScrollView(
114
+    child: Center(
101
             child: Padding(
115
             child: Padding(
102
                 padding: const EdgeInsets.all(20),
116
                 padding: const EdgeInsets.all(20),
103
                 child: Column(
117
                 child: Column(
@@ -110,16 +124,11 @@ class AgreementState extends State<Agreement> {
110
                         ),
124
                         ),
111
                       ),
125
                       ),
112
                       Text(
126
                       Text(
113
-                        strHtml1,
114
-                        style:
115
-                        const TextStyle(fontSize: 13, color: Colors.grey,),
116
-                      ),
117
-                      Text(
118
-                        strHtml2,
127
+                        strHtml1 + strHtml2 + strHtml3 + strHtml4 + strHtml5,
119
                         style:
128
                         style:
120
                         const TextStyle(fontSize: 13, color: Colors.grey,),
129
                         const TextStyle(fontSize: 13, color: Colors.grey,),
121
                       ),
130
                       ),
122
-                    ]))),
131
+                    ]))),),
123
       ),
132
       ),
124
     );
133
     );
125
   }
134
   }