Showing
6 changed files
with
121 additions
and
129 deletions
| @@ -31,41 +31,41 @@ void main() { | @@ -31,41 +31,41 @@ void main() { | ||
| 31 | test('Clip Widgets ClipRect', () { | 31 | test('Clip Widgets ClipRect', () { |
| 32 | pdf.addPage(Page( | 32 | pdf.addPage(Page( |
| 33 | build: (Context context) => ClipRect( | 33 | build: (Context context) => ClipRect( |
| 34 | - child: Transform.rotate( | ||
| 35 | - angle: 0.1, | ||
| 36 | - child: Container( | ||
| 37 | - decoration: const BoxDecoration( | ||
| 38 | - color: PdfColors.blue, | ||
| 39 | - ), | ||
| 40 | - ), | 34 | + child: Transform.rotate( |
| 35 | + angle: 0.1, | ||
| 36 | + child: Container( | ||
| 37 | + decoration: const BoxDecoration( | ||
| 38 | + color: PdfColors.blue, | ||
| 41 | ), | 39 | ), |
| 42 | ), | 40 | ), |
| 41 | + ), | ||
| 42 | + ), | ||
| 43 | )); | 43 | )); |
| 44 | }); | 44 | }); |
| 45 | 45 | ||
| 46 | test('Clip Widgets ClipRRect', () { | 46 | test('Clip Widgets ClipRRect', () { |
| 47 | pdf.addPage(Page( | 47 | pdf.addPage(Page( |
| 48 | build: (Context context) => ClipRRect( | 48 | build: (Context context) => ClipRRect( |
| 49 | - horizontalRadius: 30, | ||
| 50 | - verticalRadius: 30, | ||
| 51 | - child: Container( | ||
| 52 | - decoration: const BoxDecoration( | ||
| 53 | - color: PdfColors.blue, | ||
| 54 | - ), | ||
| 55 | - ), | 49 | + horizontalRadius: 30, |
| 50 | + verticalRadius: 30, | ||
| 51 | + child: Container( | ||
| 52 | + decoration: const BoxDecoration( | ||
| 53 | + color: PdfColors.blue, | ||
| 56 | ), | 54 | ), |
| 55 | + ), | ||
| 56 | + ), | ||
| 57 | )); | 57 | )); |
| 58 | }); | 58 | }); |
| 59 | 59 | ||
| 60 | test('Clip Widgets ClipOval', () { | 60 | test('Clip Widgets ClipOval', () { |
| 61 | pdf.addPage(Page( | 61 | pdf.addPage(Page( |
| 62 | build: (Context context) => ClipOval( | 62 | build: (Context context) => ClipOval( |
| 63 | - child: Container( | ||
| 64 | - decoration: const BoxDecoration( | ||
| 65 | - color: PdfColors.blue, | ||
| 66 | - ), | ||
| 67 | - ), | 63 | + child: Container( |
| 64 | + decoration: const BoxDecoration( | ||
| 65 | + color: PdfColors.blue, | ||
| 68 | ), | 66 | ), |
| 67 | + ), | ||
| 68 | + ), | ||
| 69 | )); | 69 | )); |
| 70 | }); | 70 | }); |
| 71 | 71 |
| @@ -49,24 +49,24 @@ void main() { | @@ -49,24 +49,24 @@ void main() { | ||
| 49 | test('Container Widgets Flat', () { | 49 | test('Container Widgets Flat', () { |
| 50 | pdf.addPage(Page( | 50 | pdf.addPage(Page( |
| 51 | build: (Context context) => Container( | 51 | build: (Context context) => Container( |
| 52 | - alignment: Alignment.center, | ||
| 53 | - margin: const EdgeInsets.all(30), | ||
| 54 | - padding: const EdgeInsets.all(20), | ||
| 55 | - decoration: const BoxDecoration( | ||
| 56 | - color: PdfColors.blue, | ||
| 57 | - borderRadius: 20, | ||
| 58 | - border: BoxBorder( | ||
| 59 | - color: PdfColors.blue800, | ||
| 60 | - top: true, | ||
| 61 | - left: true, | ||
| 62 | - right: true, | ||
| 63 | - bottom: true, | ||
| 64 | - width: 2, | ||
| 65 | - )), | ||
| 66 | - width: 200, | ||
| 67 | - height: 400, | ||
| 68 | - // child: Placeholder(), | ||
| 69 | - ), | 52 | + alignment: Alignment.center, |
| 53 | + margin: const EdgeInsets.all(30), | ||
| 54 | + padding: const EdgeInsets.all(20), | ||
| 55 | + decoration: const BoxDecoration( | ||
| 56 | + color: PdfColors.blue, | ||
| 57 | + borderRadius: 20, | ||
| 58 | + border: BoxBorder( | ||
| 59 | + color: PdfColors.blue800, | ||
| 60 | + top: true, | ||
| 61 | + left: true, | ||
| 62 | + right: true, | ||
| 63 | + bottom: true, | ||
| 64 | + width: 2, | ||
| 65 | + )), | ||
| 66 | + width: 200, | ||
| 67 | + height: 400, | ||
| 68 | + // child: Placeholder(), | ||
| 69 | + ), | ||
| 70 | )); | 70 | )); |
| 71 | }); | 71 | }); |
| 72 | 72 | ||
| @@ -77,16 +77,16 @@ void main() { | @@ -77,16 +77,16 @@ void main() { | ||
| 77 | 77 | ||
| 78 | pdf.addPage(Page( | 78 | pdf.addPage(Page( |
| 79 | build: (Context context) => Container( | 79 | build: (Context context) => Container( |
| 80 | - alignment: Alignment.center, | ||
| 81 | - margin: const EdgeInsets.all(30), | ||
| 82 | - padding: const EdgeInsets.all(20), | ||
| 83 | - decoration: BoxDecoration( | ||
| 84 | - image: DecorationImage(image: image, fit: BoxFit.cover), | ||
| 85 | - ), | ||
| 86 | - width: 200, | ||
| 87 | - height: 400, | ||
| 88 | - // child: Placeholder(), | ||
| 89 | - ), | 80 | + alignment: Alignment.center, |
| 81 | + margin: const EdgeInsets.all(30), | ||
| 82 | + padding: const EdgeInsets.all(20), | ||
| 83 | + decoration: BoxDecoration( | ||
| 84 | + image: DecorationImage(image: image, fit: BoxFit.cover), | ||
| 85 | + ), | ||
| 86 | + width: 200, | ||
| 87 | + height: 400, | ||
| 88 | + // child: Placeholder(), | ||
| 89 | + ), | ||
| 90 | )); | 90 | )); |
| 91 | }); | 91 | }); |
| 92 | 92 |
| @@ -74,10 +74,10 @@ void main() { | @@ -74,10 +74,10 @@ void main() { | ||
| 74 | test('Table Widget filled', () { | 74 | test('Table Widget filled', () { |
| 75 | pdf.addPage(Page( | 75 | pdf.addPage(Page( |
| 76 | build: (Context context) => Table( | 76 | build: (Context context) => Table( |
| 77 | - children: buildTable(context: context, count: 20), | ||
| 78 | - border: const TableBorder(), | ||
| 79 | - tableWidth: TableWidth.max, | ||
| 80 | - ), | 77 | + children: buildTable(context: context, count: 20), |
| 78 | + border: const TableBorder(), | ||
| 79 | + tableWidth: TableWidth.max, | ||
| 80 | + ), | ||
| 81 | )); | 81 | )); |
| 82 | }); | 82 | }); |
| 83 | 83 |
| @@ -60,13 +60,13 @@ void main() { | @@ -60,13 +60,13 @@ void main() { | ||
| 60 | 60 | ||
| 61 | pdf.addPage(Page( | 61 | pdf.addPage(Page( |
| 62 | build: (Context context) => ListView( | 62 | build: (Context context) => ListView( |
| 63 | - children: <Widget>[ | ||
| 64 | - Text( | ||
| 65 | - style.font.fontName, | ||
| 66 | - style: style, | ||
| 67 | - ), | ||
| 68 | - ], | 63 | + children: <Widget>[ |
| 64 | + Text( | ||
| 65 | + style.font.fontName, | ||
| 66 | + style: style, | ||
| 69 | ), | 67 | ), |
| 68 | + ], | ||
| 69 | + ), | ||
| 70 | )); | 70 | )); |
| 71 | }); | 71 | }); |
| 72 | 72 |
| @@ -124,79 +124,71 @@ Future<Document> generateDocument(PdfPageFormat format) async { | @@ -124,79 +124,71 @@ Future<Document> generateDocument(PdfPageFormat format) async { | ||
| 124 | right: 2.0 * PdfPageFormat.cm, | 124 | right: 2.0 * PdfPageFormat.cm, |
| 125 | bottom: 2.0 * PdfPageFormat.cm), | 125 | bottom: 2.0 * PdfPageFormat.cm), |
| 126 | build: (Context context) => Row(children: <Widget>[ | 126 | build: (Context context) => Row(children: <Widget>[ |
| 127 | - Expanded( | ||
| 128 | - child: Column( | ||
| 129 | - crossAxisAlignment: CrossAxisAlignment.start, | ||
| 130 | - children: <Widget>[ | ||
| 131 | - Container( | ||
| 132 | - padding: const EdgeInsets.only(left: 30, bottom: 20), | ||
| 133 | - child: Column( | ||
| 134 | - crossAxisAlignment: CrossAxisAlignment.start, | ||
| 135 | - children: <Widget>[ | ||
| 136 | - Text('Parnella Charlesbois', | ||
| 137 | - textScaleFactor: 2, | ||
| 138 | - style: Theme.of(context) | ||
| 139 | - .defaultTextStyle | ||
| 140 | - .copyWith(fontWeight: FontWeight.bold)), | ||
| 141 | - Padding(padding: const EdgeInsets.only(top: 10)), | ||
| 142 | - Text('Electrotyper', | ||
| 143 | - textScaleFactor: 1.2, | ||
| 144 | - style: Theme.of(context) | ||
| 145 | - .defaultTextStyle | ||
| 146 | - .copyWith( | ||
| 147 | - fontWeight: FontWeight.bold, | ||
| 148 | - color: green)), | ||
| 149 | - Padding(padding: const EdgeInsets.only(top: 20)), | ||
| 150 | - Row( | ||
| 151 | - crossAxisAlignment: CrossAxisAlignment.start, | ||
| 152 | - mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 153 | - children: <Widget>[ | ||
| 154 | - Column( | ||
| 155 | - crossAxisAlignment: | ||
| 156 | - CrossAxisAlignment.start, | ||
| 157 | - children: <Widget>[ | ||
| 158 | - Text('568 Port Washington Road'), | ||
| 159 | - Text('Nordegg, AB T0M 2H0'), | ||
| 160 | - Text('Canada, ON'), | ||
| 161 | - ]), | ||
| 162 | - Column( | ||
| 163 | - crossAxisAlignment: | ||
| 164 | - CrossAxisAlignment.start, | ||
| 165 | - children: <Widget>[ | ||
| 166 | - Text('+1 403-721-6898'), | ||
| 167 | - Text('p.charlesbois@yahoo.com'), | ||
| 168 | - Text('wholeprices.ca') | ||
| 169 | - ]), | ||
| 170 | - Padding(padding: EdgeInsets.zero) | ||
| 171 | - ]), | ||
| 172 | - ])), | ||
| 173 | - Category(title: 'Work Experience'), | ||
| 174 | - Block(title: 'Tour bus driver'), | ||
| 175 | - Block(title: 'Logging equipment operator'), | ||
| 176 | - Block(title: 'Foot doctor'), | ||
| 177 | - Category(title: 'Education'), | ||
| 178 | - Block(title: 'Bachelor Of Commerce'), | ||
| 179 | - Block(title: 'Bachelor Interior Design'), | ||
| 180 | - ])), | ||
| 181 | - Container( | ||
| 182 | - height: double.infinity, | ||
| 183 | - width: 10, | ||
| 184 | - decoration: const BoxDecoration( | ||
| 185 | - border: BoxBorder(left: true, color: green, width: 2)), | ||
| 186 | - ), | ||
| 187 | - Column( | 127 | + Expanded( |
| 128 | + child: Column( | ||
| 188 | crossAxisAlignment: CrossAxisAlignment.start, | 129 | crossAxisAlignment: CrossAxisAlignment.start, |
| 189 | children: <Widget>[ | 130 | children: <Widget>[ |
| 190 | - ClipOval( | ||
| 191 | - child: Container( | ||
| 192 | - width: 100, | ||
| 193 | - height: 100, | ||
| 194 | - color: lightGreen, | ||
| 195 | - child: profileImage == null | ||
| 196 | - ? Container() | ||
| 197 | - : Image(profileImage))) | ||
| 198 | - ]) | ||
| 199 | - ]), | 131 | + Container( |
| 132 | + padding: const EdgeInsets.only(left: 30, bottom: 20), | ||
| 133 | + child: Column( | ||
| 134 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 135 | + children: <Widget>[ | ||
| 136 | + Text('Parnella Charlesbois', | ||
| 137 | + textScaleFactor: 2, | ||
| 138 | + style: Theme.of(context) | ||
| 139 | + .defaultTextStyle | ||
| 140 | + .copyWith(fontWeight: FontWeight.bold)), | ||
| 141 | + Padding(padding: const EdgeInsets.only(top: 10)), | ||
| 142 | + Text('Electrotyper', | ||
| 143 | + textScaleFactor: 1.2, | ||
| 144 | + style: Theme.of(context).defaultTextStyle.copyWith( | ||
| 145 | + fontWeight: FontWeight.bold, color: green)), | ||
| 146 | + Padding(padding: const EdgeInsets.only(top: 20)), | ||
| 147 | + Row( | ||
| 148 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 149 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 150 | + children: <Widget>[ | ||
| 151 | + Column( | ||
| 152 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 153 | + children: <Widget>[ | ||
| 154 | + Text('568 Port Washington Road'), | ||
| 155 | + Text('Nordegg, AB T0M 2H0'), | ||
| 156 | + Text('Canada, ON'), | ||
| 157 | + ]), | ||
| 158 | + Column( | ||
| 159 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 160 | + children: <Widget>[ | ||
| 161 | + Text('+1 403-721-6898'), | ||
| 162 | + Text('p.charlesbois@yahoo.com'), | ||
| 163 | + Text('wholeprices.ca') | ||
| 164 | + ]), | ||
| 165 | + Padding(padding: EdgeInsets.zero) | ||
| 166 | + ]), | ||
| 167 | + ])), | ||
| 168 | + Category(title: 'Work Experience'), | ||
| 169 | + Block(title: 'Tour bus driver'), | ||
| 170 | + Block(title: 'Logging equipment operator'), | ||
| 171 | + Block(title: 'Foot doctor'), | ||
| 172 | + Category(title: 'Education'), | ||
| 173 | + Block(title: 'Bachelor Of Commerce'), | ||
| 174 | + Block(title: 'Bachelor Interior Design'), | ||
| 175 | + ])), | ||
| 176 | + Container( | ||
| 177 | + height: double.infinity, | ||
| 178 | + width: 10, | ||
| 179 | + decoration: const BoxDecoration( | ||
| 180 | + border: BoxBorder(left: true, color: green, width: 2)), | ||
| 181 | + ), | ||
| 182 | + Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ | ||
| 183 | + ClipOval( | ||
| 184 | + child: Container( | ||
| 185 | + width: 100, | ||
| 186 | + height: 100, | ||
| 187 | + color: lightGreen, | ||
| 188 | + child: | ||
| 189 | + profileImage == null ? Container() : Image(profileImage))) | ||
| 190 | + ]) | ||
| 191 | + ]), | ||
| 200 | )); | 192 | )); |
| 201 | return pdf; | 193 | return pdf; |
| 202 | } | 194 | } |
-
Please register or login to post a comment