-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Widget args cast types error (#77)
* π feat: exportUnbuiltWidget * π fix: throw errors in Align convert * π fix: new extensions and convertions * π fix: alignDirectional * π fix: container edge cast errors * π¨ code: improve structure and debug prints * β»οΈ refactor: better import impl Co-authored-by: Joseph Grabinger <[email protected]> * β»οΈ refactor: more reusable impl of .toPdfAligment Co-authored-by: Joseph Grabinger <[email protected]> * π feat: new impl of aligmentGeometryConverter * π₯ remove: edge_insets_directional.dart * π feat: better impl to edge_insets.dart --------- Co-authored-by: sousa-p <[email protected]> Co-authored-by: Joseph Grabinger <[email protected]>
- Loading branch information
1 parent
cb11d2f
commit a8817eb
Showing
6 changed files
with
58 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import 'package:flutter/widgets.dart' show EdgeInsets, Padding; | ||
import 'package:flutter/widgets.dart' show Padding; | ||
|
||
import 'package:pdf/widgets.dart' as pw show Padding, Widget; | ||
import 'package:pdf/widgets.dart' as pw show Padding, Widget, EdgeInsets; | ||
|
||
import '/args/edge_insets.dart'; | ||
|
||
/// Extension on [Padding] to convert it to the pdf equivalent [pw.Padding]. | ||
extension PaddingConverter on Padding { | ||
/// Converts the [Padding] to a [pw.Padding]. | ||
pw.Padding toPdfWidget(pw.Widget? child) => pw.Padding( | ||
padding: (padding as EdgeInsets).toPdfEdgeInsets(), | ||
padding: padding.toPdfEdgeInsets() ?? const pw.EdgeInsets.all(0), | ||
child: child, | ||
); | ||
} |