David PHAM-VAN

Add more asserts

@@ -227,7 +227,9 @@ class PdfAnnotText extends PdfAnnotBase { @@ -227,7 +227,9 @@ class PdfAnnotText extends PdfAnnotBase {
227 Set<PdfAnnotFlags> flags, 227 Set<PdfAnnotFlags> flags,
228 DateTime date, 228 DateTime date,
229 PdfColor color, 229 PdfColor color,
230 - }) : super( 230 + }) : assert(rect != null),
  231 + assert(content != null),
  232 + super(
231 subtype: '/Text', 233 subtype: '/Text',
232 rect: rect, 234 rect: rect,
233 border: border, 235 border: border,
@@ -280,7 +282,9 @@ class PdfAnnotUrlLink extends PdfAnnotBase { @@ -280,7 +282,9 @@ class PdfAnnotUrlLink extends PdfAnnotBase {
280 Set<PdfAnnotFlags> flags, 282 Set<PdfAnnotFlags> flags,
281 DateTime date, 283 DateTime date,
282 PdfColor color, 284 PdfColor color,
283 - }) : super( 285 + }) : assert(rect != null),
  286 + assert(url != null),
  287 + super(
284 subtype: '/Link', 288 subtype: '/Link',
285 rect: rect, 289 rect: rect,
286 border: border, 290 border: border,
@@ -317,7 +321,9 @@ abstract class PdfAnnotWidget extends PdfAnnotBase { @@ -317,7 +321,9 @@ abstract class PdfAnnotWidget extends PdfAnnotBase {
317 PdfColor color, 321 PdfColor color,
318 this.backgroundColor, 322 this.backgroundColor,
319 this.highlighting, 323 this.highlighting,
320 - }) : super( 324 + }) : assert(rect != null),
  325 + assert(fieldType != null),
  326 + super(
321 subtype: '/Widget', 327 subtype: '/Widget',
322 rect: rect, 328 rect: rect,
323 border: border, 329 border: border,
@@ -388,7 +394,8 @@ class PdfAnnotSign extends PdfAnnotWidget { @@ -388,7 +394,8 @@ class PdfAnnotSign extends PdfAnnotWidget {
388 DateTime date, 394 DateTime date,
389 PdfColor color, 395 PdfColor color,
390 PdfAnnotHighlighting highlighting, 396 PdfAnnotHighlighting highlighting,
391 - }) : super( 397 + }) : assert(rect != null),
  398 + super(
392 rect: rect, 399 rect: rect,
393 fieldType: '/Sig', 400 fieldType: '/Sig',
394 fieldName: fieldName, 401 fieldName: fieldName,
@@ -519,7 +526,9 @@ class PdfFormField extends PdfAnnotWidget { @@ -519,7 +526,9 @@ class PdfFormField extends PdfAnnotWidget {
519 PdfColor backgroundColor, 526 PdfColor backgroundColor,
520 PdfAnnotHighlighting highlighting, 527 PdfAnnotHighlighting highlighting,
521 this.fieldFlags, 528 this.fieldFlags,
522 - }) : super( 529 + }) : assert(rect != null),
  530 + assert(fieldType != null),
  531 + super(
523 rect: rect, 532 rect: rect,
524 fieldType: fieldType, 533 fieldType: fieldType,
525 fieldName: fieldName, 534 fieldName: fieldName,
@@ -583,7 +592,8 @@ class PdfTextField extends PdfFormField { @@ -583,7 +592,8 @@ class PdfTextField extends PdfFormField {
583 @required this.fontSize, 592 @required this.fontSize,
584 @required this.textColor, 593 @required this.textColor,
585 this.textAlign, 594 this.textAlign,
586 - }) : assert(fontSize != null), 595 + }) : assert(rect != null),
  596 + assert(fontSize != null),
587 assert(textColor != null), 597 assert(textColor != null),
588 assert(font != null), 598 assert(font != null),
589 super( 599 super(
@@ -655,7 +665,8 @@ class PdfButtonField extends PdfFormField { @@ -655,7 +665,8 @@ class PdfButtonField extends PdfFormField {
655 Set<PdfFieldFlags> fieldFlags, 665 Set<PdfFieldFlags> fieldFlags,
656 this.value, 666 this.value,
657 this.defaultValue, 667 this.defaultValue,
658 - }) : super( 668 + }) : assert(rect != null),
  669 + super(
659 rect: rect, 670 rect: rect,
660 fieldType: '/Btn', 671 fieldType: '/Btn',
661 fieldName: fieldName, 672 fieldName: fieldName,
@@ -250,8 +250,11 @@ class Link extends Annotation { @@ -250,8 +250,11 @@ class Link extends Annotation {
250 } 250 }
251 251
252 class UrlLink extends Annotation { 252 class UrlLink extends Annotation {
253 - UrlLink({@required Widget child, String destination})  
254 - : assert(child != null), 253 + UrlLink({
  254 + @required Widget child,
  255 + @required String destination,
  256 + }) : assert(child != null),
  257 + assert(destination != null),
255 super(child: child, builder: AnnotationUrl(destination)); 258 super(child: child, builder: AnnotationUrl(destination));
256 } 259 }
257 260
@@ -268,6 +271,7 @@ class Signature extends Annotation { @@ -268,6 +271,7 @@ class Signature extends Annotation {
268 PdfAnnotHighlighting highlighting, 271 PdfAnnotHighlighting highlighting,
269 }) : assert(child != null), 272 }) : assert(child != null),
270 assert(crypto != null), 273 assert(crypto != null),
  274 + assert(name != null),
271 super( 275 super(
272 child: child, 276 child: child,
273 builder: AnnotationSignature( 277 builder: AnnotationSignature(