Showing
1 changed file
with
248 additions
and
132 deletions
@@ -51,9 +51,13 @@ void main() { | @@ -51,9 +51,13 @@ void main() { | ||
51 | Page( | 51 | Page( |
52 | textDirection: TextDirection.rtl, | 52 | textDirection: TextDirection.rtl, |
53 | pageFormat: const PdfPageFormat(150, 50), | 53 | pageFormat: const PdfPageFormat(150, 50), |
54 | - build: (Context context) => Row( | ||
55 | - children: [_blueBox, _redBox], | ||
56 | - ), | 54 | + build: (Context context) => |
55 | + TestAnnotation( | ||
56 | + anno: 'RTL Row', | ||
57 | + child: Row( | ||
58 | + children: [_blueBox, _redBox], | ||
59 | + ), | ||
60 | + ), | ||
57 | ), | 61 | ), |
58 | ); | 62 | ); |
59 | }); | 63 | }); |
@@ -63,10 +67,14 @@ void main() { | @@ -63,10 +67,14 @@ void main() { | ||
63 | Page( | 67 | Page( |
64 | textDirection: TextDirection.rtl, | 68 | textDirection: TextDirection.rtl, |
65 | pageFormat: const PdfPageFormat(150, 50), | 69 | pageFormat: const PdfPageFormat(150, 50), |
66 | - build: (Context context) => Row( | ||
67 | - mainAxisAlignment: MainAxisAlignment.center, | ||
68 | - children: [_blueBox, _redBox], | ||
69 | - ), | 70 | + build: (Context context) => |
71 | + TestAnnotation( | ||
72 | + anno: 'RTL Row MainAlignment.center', | ||
73 | + child: Row( | ||
74 | + mainAxisAlignment: MainAxisAlignment.center, | ||
75 | + children: [_blueBox, _redBox], | ||
76 | + ), | ||
77 | + ), | ||
70 | ), | 78 | ), |
71 | ); | 79 | ); |
72 | }); | 80 | }); |
@@ -76,14 +84,18 @@ void main() { | @@ -76,14 +84,18 @@ void main() { | ||
76 | Page( | 84 | Page( |
77 | pageFormat: const PdfPageFormat(150, 100), | 85 | pageFormat: const PdfPageFormat(150, 100), |
78 | textDirection: TextDirection.rtl, | 86 | textDirection: TextDirection.rtl, |
79 | - build: (Context context) => SizedBox( | ||
80 | - width: 150, | ||
81 | - height: 100, | ||
82 | - child: Row( | ||
83 | - crossAxisAlignment: CrossAxisAlignment.end, | ||
84 | - children: [_blueBox, _redBox], | ||
85 | - ), | ||
86 | - ), | 87 | + build: (Context context) => |
88 | + TestAnnotation( | ||
89 | + anno: 'RTL Row CrossAlignment.end', | ||
90 | + child: SizedBox( | ||
91 | + width: 150, | ||
92 | + height: 100, | ||
93 | + child: Row( | ||
94 | + crossAxisAlignment: CrossAxisAlignment.end, | ||
95 | + children: [_blueBox, _redBox], | ||
96 | + ), | ||
97 | + ), | ||
98 | + ), | ||
87 | ), | 99 | ), |
88 | ); | 100 | ); |
89 | }); | 101 | }); |
@@ -91,9 +103,13 @@ void main() { | @@ -91,9 +103,13 @@ void main() { | ||
91 | pdf.addPage( | 103 | pdf.addPage( |
92 | Page( | 104 | Page( |
93 | pageFormat: const PdfPageFormat(150, 50), | 105 | pageFormat: const PdfPageFormat(150, 50), |
94 | - build: (Context context) => Row( | ||
95 | - children: [_blueBox, _redBox], | ||
96 | - ), | 106 | + build: (Context context) => |
107 | + TestAnnotation( | ||
108 | + anno: 'LTR Row', | ||
109 | + child: Row( | ||
110 | + children: [_blueBox, _redBox], | ||
111 | + ), | ||
112 | + ), | ||
97 | ), | 113 | ), |
98 | ); | 114 | ); |
99 | }); | 115 | }); |
@@ -102,14 +118,18 @@ void main() { | @@ -102,14 +118,18 @@ void main() { | ||
102 | Page( | 118 | Page( |
103 | textDirection: TextDirection.rtl, | 119 | textDirection: TextDirection.rtl, |
104 | pageFormat: const PdfPageFormat(150, 150), | 120 | pageFormat: const PdfPageFormat(150, 150), |
105 | - build: (Context context) => SizedBox( | ||
106 | - width: 150, | ||
107 | - height: 150, | ||
108 | - child: Column( | ||
109 | - crossAxisAlignment: CrossAxisAlignment.start, | ||
110 | - children: [_blueBox, _redBox], | ||
111 | - ), | ||
112 | - ), | 121 | + build: (Context context) => |
122 | + TestAnnotation( | ||
123 | + anno: 'RTL Column crossAlignment.start', | ||
124 | + child: SizedBox( | ||
125 | + width: 150, | ||
126 | + height: 150, | ||
127 | + child: Column( | ||
128 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
129 | + children: [_blueBox, _redBox], | ||
130 | + ), | ||
131 | + ), | ||
132 | + ), | ||
113 | ), | 133 | ), |
114 | ); | 134 | ); |
115 | }); | 135 | }); |
@@ -118,14 +138,18 @@ void main() { | @@ -118,14 +138,18 @@ void main() { | ||
118 | Page( | 138 | Page( |
119 | textDirection: TextDirection.ltr, | 139 | textDirection: TextDirection.ltr, |
120 | pageFormat: const PdfPageFormat(150, 150), | 140 | pageFormat: const PdfPageFormat(150, 150), |
121 | - build: (Context context) => SizedBox( | ||
122 | - width: 150, | ||
123 | - height: 150, | ||
124 | - child: Column( | ||
125 | - crossAxisAlignment: CrossAxisAlignment.start, | ||
126 | - children: [_blueBox, _redBox], | ||
127 | - ), | ||
128 | - ), | 141 | + build: (Context context) => |
142 | + TestAnnotation( | ||
143 | + anno: 'LTR Column crossAlignment.start', | ||
144 | + child: SizedBox( | ||
145 | + width: 150, | ||
146 | + height: 150, | ||
147 | + child: Column( | ||
148 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
149 | + children: [_blueBox, _redBox], | ||
150 | + ), | ||
151 | + ), | ||
152 | + ), | ||
129 | ), | 153 | ), |
130 | ); | 154 | ); |
131 | }); | 155 | }); |
@@ -135,12 +159,17 @@ void main() { | @@ -135,12 +159,17 @@ void main() { | ||
135 | Page( | 159 | Page( |
136 | textDirection: TextDirection.rtl, | 160 | textDirection: TextDirection.rtl, |
137 | pageFormat: const PdfPageFormat(150, 150), | 161 | pageFormat: const PdfPageFormat(150, 150), |
138 | - build: (Context context) => SizedBox( | ||
139 | - width: 150, | ||
140 | - height: 150, | ||
141 | - child: Wrap( | ||
142 | - children: [_blueBox, _redBox, _yellowBox], | ||
143 | - )), | 162 | + build: (Context context) => |
163 | + TestAnnotation( | ||
164 | + anno: 'RTL Wrap', | ||
165 | + child: SizedBox( | ||
166 | + width: 150, | ||
167 | + height: 150, | ||
168 | + child: Wrap( | ||
169 | + children: [_blueBox, _redBox, _yellowBox], | ||
170 | + ), | ||
171 | + ), | ||
172 | + ), | ||
144 | ), | 173 | ), |
145 | ); | 174 | ); |
146 | }); | 175 | }); |
@@ -150,12 +179,17 @@ void main() { | @@ -150,12 +179,17 @@ void main() { | ||
150 | Page( | 179 | Page( |
151 | textDirection: TextDirection.ltr, | 180 | textDirection: TextDirection.ltr, |
152 | pageFormat: const PdfPageFormat(150, 150), | 181 | pageFormat: const PdfPageFormat(150, 150), |
153 | - build: (Context context) => SizedBox( | ||
154 | - width: 150, | ||
155 | - height: 150, | ||
156 | - child: Wrap( | ||
157 | - children: [_blueBox, _redBox, _yellowBox], | ||
158 | - )), | 182 | + build: (Context context) => |
183 | + TestAnnotation( | ||
184 | + anno: 'LTR Wrap', | ||
185 | + child: SizedBox( | ||
186 | + width: 150, | ||
187 | + height: 150, | ||
188 | + child: Wrap( | ||
189 | + children: [_blueBox, _redBox, _yellowBox], | ||
190 | + ), | ||
191 | + ), | ||
192 | + ), | ||
159 | ), | 193 | ), |
160 | ); | 194 | ); |
161 | }); | 195 | }); |
@@ -164,15 +198,20 @@ void main() { | @@ -164,15 +198,20 @@ void main() { | ||
164 | Page( | 198 | Page( |
165 | textDirection: TextDirection.rtl, | 199 | textDirection: TextDirection.rtl, |
166 | pageFormat: const PdfPageFormat(150, 150), | 200 | pageFormat: const PdfPageFormat(150, 150), |
167 | - build: (Context context) => SizedBox( | ||
168 | - width: 150, | ||
169 | - height: 150, | ||
170 | - child: Wrap( | ||
171 | - spacing: 10, | ||
172 | - runSpacing: 10, | ||
173 | - runAlignment: WrapAlignment.center, | ||
174 | - children: [_blueBox, _redBox, _yellowBox], | ||
175 | - )), | 201 | + build: (Context context) => |
202 | + TestAnnotation( | ||
203 | + anno: 'RTL Wrap WrapAlignment.center', | ||
204 | + child: SizedBox( | ||
205 | + width: 150, | ||
206 | + height: 150, | ||
207 | + child: Wrap( | ||
208 | + spacing: 10, | ||
209 | + runSpacing: 10, | ||
210 | + runAlignment: WrapAlignment.center, | ||
211 | + children: [_blueBox, _redBox, _yellowBox], | ||
212 | + ), | ||
213 | + ), | ||
214 | + ), | ||
176 | ), | 215 | ), |
177 | ); | 216 | ); |
178 | }); | 217 | }); |
@@ -182,15 +221,19 @@ void main() { | @@ -182,15 +221,19 @@ void main() { | ||
182 | Page( | 221 | Page( |
183 | textDirection: TextDirection.rtl, | 222 | textDirection: TextDirection.rtl, |
184 | pageFormat: const PdfPageFormat(150, 150), | 223 | pageFormat: const PdfPageFormat(150, 150), |
185 | - build: (Context context) => SizedBox( | ||
186 | - width: 150, | ||
187 | - height: 150, | ||
188 | - child: Wrap( | ||
189 | - spacing: 10, | ||
190 | - runSpacing: 10, | ||
191 | - runAlignment: WrapAlignment.end, | ||
192 | - children: [_blueBox, _redBox, _yellowBox], | ||
193 | - )), | 224 | + build: (Context context) => |
225 | + TestAnnotation( | ||
226 | + anno: 'RTL Wrap WrapAlignment.end', | ||
227 | + child: SizedBox( | ||
228 | + width: 150, | ||
229 | + height: 150, | ||
230 | + child: Wrap( | ||
231 | + spacing: 10, | ||
232 | + runSpacing: 10, | ||
233 | + runAlignment: WrapAlignment.end, | ||
234 | + children: [_blueBox, _redBox, _yellowBox], | ||
235 | + )), | ||
236 | + ), | ||
194 | ), | 237 | ), |
195 | ); | 238 | ); |
196 | }); | 239 | }); |
@@ -201,7 +244,10 @@ void main() { | @@ -201,7 +244,10 @@ void main() { | ||
201 | textDirection: TextDirection.rtl, | 244 | textDirection: TextDirection.rtl, |
202 | pageFormat: const PdfPageFormat(150, 150), | 245 | pageFormat: const PdfPageFormat(150, 150), |
203 | build: (Context context) { | 246 | build: (Context context) { |
204 | - return _blueBox; | 247 | + return TestAnnotation( |
248 | + anno: 'RTL Page', | ||
249 | + child: _blueBox, | ||
250 | + ); | ||
205 | }, | 251 | }, |
206 | ), | 252 | ), |
207 | ); | 253 | ); |
@@ -213,7 +259,10 @@ void main() { | @@ -213,7 +259,10 @@ void main() { | ||
213 | textDirection: TextDirection.ltr, | 259 | textDirection: TextDirection.ltr, |
214 | pageFormat: const PdfPageFormat(150, 150), | 260 | pageFormat: const PdfPageFormat(150, 150), |
215 | build: (Context context) { | 261 | build: (Context context) { |
216 | - return _blueBox; | 262 | + return TestAnnotation( |
263 | + anno: 'LTR Page', | ||
264 | + child: _blueBox, | ||
265 | + ); | ||
217 | }, | 266 | }, |
218 | ), | 267 | ), |
219 | ); | 268 | ); |
@@ -226,7 +275,10 @@ void main() { | @@ -226,7 +275,10 @@ void main() { | ||
226 | pageFormat: const PdfPageFormat(150, 150), | 275 | pageFormat: const PdfPageFormat(150, 150), |
227 | build: (Context context) { | 276 | build: (Context context) { |
228 | return [ | 277 | return [ |
229 | - ListView(children: [for (int i = 0; i < 30; i++) Text('Hello World')]), | 278 | + ListView(children: [ |
279 | + Text('RTL MultiPage'), | ||
280 | + for (int i = 0; i < 15; i++) Text('List item'), | ||
281 | + ]), | ||
230 | ]; | 282 | ]; |
231 | }, | 283 | }, |
232 | ), | 284 | ), |
@@ -240,7 +292,10 @@ void main() { | @@ -240,7 +292,10 @@ void main() { | ||
240 | pageFormat: const PdfPageFormat(150, 150), | 292 | pageFormat: const PdfPageFormat(150, 150), |
241 | build: (Context context) { | 293 | build: (Context context) { |
242 | return [ | 294 | return [ |
243 | - ListView(children: [for (int i = 0; i < 30; i++) Text('Hello World')]), | 295 | + Text('LTR MultiPage'), |
296 | + ListView(children: [ | ||
297 | + for (int i = 0; i < 15; i++) Text('List item'), | ||
298 | + ]), | ||
244 | ]; | 299 | ]; |
245 | }, | 300 | }, |
246 | ), | 301 | ), |
@@ -253,9 +308,12 @@ void main() { | @@ -253,9 +308,12 @@ void main() { | ||
253 | textDirection: TextDirection.rtl, | 308 | textDirection: TextDirection.rtl, |
254 | pageFormat: const PdfPageFormat(150, 150), | 309 | pageFormat: const PdfPageFormat(150, 150), |
255 | build: (Context context) { | 310 | build: (Context context) { |
256 | - return Padding( | ||
257 | - padding: const EdgeInsetsDirectional.only(start: 20), | ||
258 | - child: _blueBox, | 311 | + return TestAnnotation( |
312 | + anno: 'RTL Padded start', | ||
313 | + child: Padding( | ||
314 | + padding: const EdgeInsetsDirectional.only(start: 20), | ||
315 | + child: _blueBox, | ||
316 | + ), | ||
259 | ); | 317 | ); |
260 | }, | 318 | }, |
261 | ), | 319 | ), |
@@ -268,9 +326,12 @@ void main() { | @@ -268,9 +326,12 @@ void main() { | ||
268 | textDirection: TextDirection.ltr, | 326 | textDirection: TextDirection.ltr, |
269 | pageFormat: const PdfPageFormat(150, 150), | 327 | pageFormat: const PdfPageFormat(150, 150), |
270 | build: (Context context) { | 328 | build: (Context context) { |
271 | - return Padding( | ||
272 | - padding: const EdgeInsetsDirectional.only(start: 20), | ||
273 | - child: _blueBox, | 329 | + return TestAnnotation( |
330 | + anno: 'LTR Padded start', | ||
331 | + child: Padding( | ||
332 | + padding: const EdgeInsetsDirectional.only(start: 20), | ||
333 | + child: _blueBox, | ||
334 | + ), | ||
274 | ); | 335 | ); |
275 | }, | 336 | }, |
276 | ), | 337 | ), |
@@ -283,9 +344,12 @@ void main() { | @@ -283,9 +344,12 @@ void main() { | ||
283 | textDirection: TextDirection.rtl, | 344 | textDirection: TextDirection.rtl, |
284 | pageFormat: const PdfPageFormat(150, 150), | 345 | pageFormat: const PdfPageFormat(150, 150), |
285 | build: (Context context) { | 346 | build: (Context context) { |
286 | - return Align( | ||
287 | - alignment: AlignmentDirectional.centerStart, | ||
288 | - child: _blueBox, | 347 | + return TestAnnotation( |
348 | + anno: 'RTL Align directional.centerStart', | ||
349 | + child: Align( | ||
350 | + alignment: AlignmentDirectional.centerStart, | ||
351 | + child: _blueBox, | ||
352 | + ), | ||
289 | ); | 353 | ); |
290 | }, | 354 | }, |
291 | ), | 355 | ), |
@@ -298,9 +362,12 @@ void main() { | @@ -298,9 +362,12 @@ void main() { | ||
298 | textDirection: TextDirection.ltr, | 362 | textDirection: TextDirection.ltr, |
299 | pageFormat: const PdfPageFormat(150, 150), | 363 | pageFormat: const PdfPageFormat(150, 150), |
300 | build: (Context context) { | 364 | build: (Context context) { |
301 | - return Align( | ||
302 | - alignment: AlignmentDirectional.centerStart, | ||
303 | - child: _blueBox, | 365 | + return TestAnnotation( |
366 | + anno: 'LTR Align directional.centerStart', | ||
367 | + child: Align( | ||
368 | + alignment: AlignmentDirectional.centerStart, | ||
369 | + child: _blueBox, | ||
370 | + ), | ||
304 | ); | 371 | ); |
305 | }, | 372 | }, |
306 | ), | 373 | ), |
@@ -313,15 +380,19 @@ void main() { | @@ -313,15 +380,19 @@ void main() { | ||
313 | textDirection: TextDirection.rtl, | 380 | textDirection: TextDirection.rtl, |
314 | pageFormat: const PdfPageFormat(150, 150), | 381 | pageFormat: const PdfPageFormat(150, 150), |
315 | build: (Context context) { | 382 | build: (Context context) { |
316 | - return Container( | ||
317 | - decoration: const BoxDecoration( | ||
318 | - color: PdfColors.blue, | ||
319 | - borderRadius: BorderRadiusDirectional.only( | ||
320 | - topStart: Radius.circular(20), | 383 | + return TestAnnotation( |
384 | + anno: 'RTL RadiusDirectional.only topStart', | ||
385 | + child: Container( | ||
386 | + margin: const EdgeInsets.only(top: 11), | ||
387 | + decoration: const BoxDecoration( | ||
388 | + color: PdfColors.blue, | ||
389 | + borderRadius: BorderRadiusDirectional.only( | ||
390 | + topStart: Radius.circular(20), | ||
391 | + ), | ||
321 | ), | 392 | ), |
393 | + width: 150, | ||
394 | + height: 150, | ||
322 | ), | 395 | ), |
323 | - width: 150, | ||
324 | - height: 150, | ||
325 | ); | 396 | ); |
326 | }, | 397 | }, |
327 | ), | 398 | ), |
@@ -334,15 +405,19 @@ void main() { | @@ -334,15 +405,19 @@ void main() { | ||
334 | textDirection: TextDirection.rtl, | 405 | textDirection: TextDirection.rtl, |
335 | pageFormat: const PdfPageFormat(150, 150), | 406 | pageFormat: const PdfPageFormat(150, 150), |
336 | build: (Context context) { | 407 | build: (Context context) { |
337 | - return Container( | ||
338 | - decoration: const BoxDecoration( | ||
339 | - color: PdfColors.blue, | ||
340 | - borderRadius: BorderRadiusDirectional.horizontal( | ||
341 | - start: Radius.circular(20), | 408 | + return TestAnnotation( |
409 | + anno: 'RTL RadiusDirectional.horizontal start', | ||
410 | + child: Container( | ||
411 | + margin: const EdgeInsets.only(top: 11), | ||
412 | + decoration: const BoxDecoration( | ||
413 | + color: PdfColors.blue, | ||
414 | + borderRadius: BorderRadiusDirectional.horizontal( | ||
415 | + start: Radius.circular(20), | ||
416 | + ), | ||
342 | ), | 417 | ), |
418 | + width: 150, | ||
419 | + height: 150, | ||
343 | ), | 420 | ), |
344 | - width: 150, | ||
345 | - height: 150, | ||
346 | ); | 421 | ); |
347 | }, | 422 | }, |
348 | ), | 423 | ), |
@@ -355,15 +430,19 @@ void main() { | @@ -355,15 +430,19 @@ void main() { | ||
355 | textDirection: TextDirection.ltr, | 430 | textDirection: TextDirection.ltr, |
356 | pageFormat: const PdfPageFormat(150, 150), | 431 | pageFormat: const PdfPageFormat(150, 150), |
357 | build: (Context context) { | 432 | build: (Context context) { |
358 | - return Container( | ||
359 | - decoration: const BoxDecoration( | ||
360 | - color: PdfColors.blue, | ||
361 | - borderRadius: BorderRadiusDirectional.horizontal( | ||
362 | - start: Radius.circular(20), | 433 | + return TestAnnotation( |
434 | + anno: 'LTR RadiusDirectional.horizontal end', | ||
435 | + child: Container( | ||
436 | + margin: const EdgeInsets.only(top: 22), | ||
437 | + decoration: const BoxDecoration( | ||
438 | + color: PdfColors.blue, | ||
439 | + borderRadius: BorderRadiusDirectional.horizontal( | ||
440 | + end: Radius.circular(20), | ||
441 | + ), | ||
363 | ), | 442 | ), |
443 | + width: 150, | ||
444 | + height: 150, | ||
364 | ), | 445 | ), |
365 | - width: 150, | ||
366 | - height: 150, | ||
367 | ); | 446 | ); |
368 | }, | 447 | }, |
369 | ), | 448 | ), |
@@ -376,15 +455,19 @@ void main() { | @@ -376,15 +455,19 @@ void main() { | ||
376 | textDirection: TextDirection.ltr, | 455 | textDirection: TextDirection.ltr, |
377 | pageFormat: const PdfPageFormat(150, 150), | 456 | pageFormat: const PdfPageFormat(150, 150), |
378 | build: (Context context) { | 457 | build: (Context context) { |
379 | - return Container( | ||
380 | - decoration: const BoxDecoration( | ||
381 | - color: PdfColors.blue, | ||
382 | - borderRadius: BorderRadiusDirectional.only( | ||
383 | - topStart: Radius.circular(20), | 458 | + return TestAnnotation( |
459 | + anno: 'LTR RadiusDirectional.only topEnd', | ||
460 | + child: Container( | ||
461 | + margin: const EdgeInsets.only(top: 11), | ||
462 | + decoration: const BoxDecoration( | ||
463 | + color: PdfColors.blue, | ||
464 | + borderRadius: BorderRadiusDirectional.only( | ||
465 | + topEnd: Radius.circular(20), | ||
466 | + ), | ||
384 | ), | 467 | ), |
468 | + width: 150, | ||
469 | + height: 150, | ||
385 | ), | 470 | ), |
386 | - width: 150, | ||
387 | - height: 150, | ||
388 | ); | 471 | ); |
389 | }, | 472 | }, |
390 | ), | 473 | ), |
@@ -397,16 +480,19 @@ void main() { | @@ -397,16 +480,19 @@ void main() { | ||
397 | textDirection: TextDirection.rtl, | 480 | textDirection: TextDirection.rtl, |
398 | pageFormat: const PdfPageFormat(150, 150), | 481 | pageFormat: const PdfPageFormat(150, 150), |
399 | build: (Context context) { | 482 | build: (Context context) { |
400 | - return GridView( | ||
401 | - crossAxisCount: 3, | ||
402 | - childAspectRatio: 1, | ||
403 | - direction: Axis.vertical, | ||
404 | - children: [ | ||
405 | - for (int i = 0; i < 8; i++) | ||
406 | - Container( | ||
407 | - color: [PdfColors.blue, PdfColors.red, PdfColors.yellow][i % 3], | ||
408 | - ), | ||
409 | - ], | 483 | + return TestAnnotation( |
484 | + anno: 'RTL GridView Axis.vertical', | ||
485 | + child: GridView( | ||
486 | + crossAxisCount: 3, | ||
487 | + childAspectRatio: 1, | ||
488 | + direction: Axis.vertical, | ||
489 | + children: [ | ||
490 | + for (int i = 0; i < 7; i++) | ||
491 | + Container( | ||
492 | + color: [PdfColors.blue, PdfColors.red, PdfColors.yellow][i % 3], | ||
493 | + ), | ||
494 | + ], | ||
495 | + ), | ||
410 | ); | 496 | ); |
411 | }, | 497 | }, |
412 | ), | 498 | ), |
@@ -419,16 +505,19 @@ void main() { | @@ -419,16 +505,19 @@ void main() { | ||
419 | textDirection: TextDirection.ltr, | 505 | textDirection: TextDirection.ltr, |
420 | pageFormat: const PdfPageFormat(150, 150), | 506 | pageFormat: const PdfPageFormat(150, 150), |
421 | build: (Context context) { | 507 | build: (Context context) { |
422 | - return GridView( | ||
423 | - crossAxisCount: 3, | ||
424 | - childAspectRatio: 1, | ||
425 | - direction: Axis.vertical, | ||
426 | - children: [ | ||
427 | - for (int i = 0; i < 7; i++) | ||
428 | - Container( | ||
429 | - color: [PdfColors.blue, PdfColors.red, PdfColors.yellow][i % 3], | ||
430 | - ), | ||
431 | - ], | 508 | + return TestAnnotation( |
509 | + anno: 'LTR GridView Axis.vertical', | ||
510 | + child: GridView( | ||
511 | + crossAxisCount: 3, | ||
512 | + childAspectRatio: 1, | ||
513 | + direction: Axis.vertical, | ||
514 | + children: [ | ||
515 | + for (int i = 0; i < 7; i++) | ||
516 | + Container( | ||
517 | + color: [PdfColors.blue, PdfColors.red, PdfColors.yellow][i % 3], | ||
518 | + ), | ||
519 | + ], | ||
520 | + ), | ||
432 | ); | 521 | ); |
433 | }, | 522 | }, |
434 | ), | 523 | ), |
@@ -440,7 +529,7 @@ void main() { | @@ -440,7 +529,7 @@ void main() { | ||
440 | textDirection: TextDirection.rtl, | 529 | textDirection: TextDirection.rtl, |
441 | pageFormat: const PdfPageFormat(150, 150), | 530 | pageFormat: const PdfPageFormat(150, 150), |
442 | build: (Context context) { | 531 | build: (Context context) { |
443 | - return GridView( | 532 | + return TestAnnotation(anno: 'RTL GridView Axis.horizontal', child: GridView( |
444 | crossAxisCount: 3, | 533 | crossAxisCount: 3, |
445 | childAspectRatio: 1, | 534 | childAspectRatio: 1, |
446 | direction: Axis.horizontal, | 535 | direction: Axis.horizontal, |
@@ -450,7 +539,7 @@ void main() { | @@ -450,7 +539,7 @@ void main() { | ||
450 | color: [PdfColors.blue, PdfColors.red, PdfColors.yellow][i % 3], | 539 | color: [PdfColors.blue, PdfColors.red, PdfColors.yellow][i % 3], |
451 | ), | 540 | ), |
452 | ], | 541 | ], |
453 | - ); | 542 | + ),); |
454 | }, | 543 | }, |
455 | ), | 544 | ), |
456 | ); | 545 | ); |
@@ -462,7 +551,7 @@ void main() { | @@ -462,7 +551,7 @@ void main() { | ||
462 | textDirection: TextDirection.ltr, | 551 | textDirection: TextDirection.ltr, |
463 | pageFormat: const PdfPageFormat(150, 150), | 552 | pageFormat: const PdfPageFormat(150, 150), |
464 | build: (Context context) { | 553 | build: (Context context) { |
465 | - return GridView( | 554 | + return TestAnnotation(anno: 'LTR GridView Axis.horizontal', child: GridView( |
466 | crossAxisCount: 3, | 555 | crossAxisCount: 3, |
467 | childAspectRatio: 1, | 556 | childAspectRatio: 1, |
468 | direction: Axis.horizontal, | 557 | direction: Axis.horizontal, |
@@ -472,7 +561,7 @@ void main() { | @@ -472,7 +561,7 @@ void main() { | ||
472 | color: [PdfColors.blue, PdfColors.red, PdfColors.yellow][i % 3], | 561 | color: [PdfColors.blue, PdfColors.red, PdfColors.yellow][i % 3], |
473 | ), | 562 | ), |
474 | ], | 563 | ], |
475 | - ); | 564 | + ),); |
476 | }, | 565 | }, |
477 | ), | 566 | ), |
478 | ); | 567 | ); |
@@ -483,3 +572,30 @@ void main() { | @@ -483,3 +572,30 @@ void main() { | ||
483 | await file.writeAsBytes(await pdf.save()); | 572 | await file.writeAsBytes(await pdf.save()); |
484 | }); | 573 | }); |
485 | } | 574 | } |
575 | + | ||
576 | +class TestAnnotation extends StatelessWidget { | ||
577 | + TestAnnotation({required this.anno, required this.child}); | ||
578 | + | ||
579 | + final String anno; | ||
580 | + final Widget child; | ||
581 | + | ||
582 | + @override | ||
583 | + Widget build(Context context) { | ||
584 | + return Stack(children: [ | ||
585 | + child, | ||
586 | + Positioned( | ||
587 | + top: 0, | ||
588 | + right: 0, | ||
589 | + left: 0, | ||
590 | + child: Container( | ||
591 | + color: PdfColors.white, | ||
592 | + child: Text( | ||
593 | + anno, | ||
594 | + style: const TextStyle(color: PdfColors.black, fontSize: 9), | ||
595 | + textAlign: TextAlign.center, | ||
596 | + ), | ||
597 | + ), | ||
598 | + ), | ||
599 | + ]); | ||
600 | + } | ||
601 | +} |
-
Please register or login to post a comment