-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
573 additions
and
15 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
67 changes: 67 additions & 0 deletions
67
wrestling_scoreboard_client/lib/util/print/pdf/components.dart
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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import 'package:pdf/pdf.dart'; | ||
import 'package:pdf/widgets.dart'; | ||
|
||
Widget buildTextCell( | ||
String title, { | ||
double? height = 60, | ||
double? width, | ||
double? fontSize, | ||
PdfColor borderColor = PdfColors.grey, | ||
PdfColor textColor = PdfColors.black, | ||
PdfColor? color, | ||
EdgeInsets? margin, | ||
Alignment alignment = Alignment.centerLeft, | ||
}) { | ||
return Container( | ||
color: color, | ||
margin: margin, | ||
padding: const EdgeInsets.all(2), | ||
alignment: alignment, | ||
foregroundDecoration: BoxDecoration( | ||
border: Border.all( | ||
color: borderColor, | ||
width: .5, | ||
), | ||
), | ||
height: height, | ||
width: width, | ||
child: Text(title, style: TextStyle(fontSize: fontSize, color: textColor))); | ||
} | ||
|
||
Widget buildFormCell({ | ||
String? title, | ||
String? content, | ||
double height = 60, | ||
double? width, | ||
PdfColor borderColor = PdfColors.grey, | ||
PdfColor? color, | ||
PdfColor pencilColor = PdfColors.blue800, | ||
}) { | ||
return Container( | ||
height: height, | ||
width: width, | ||
foregroundDecoration: BoxDecoration( | ||
border: Border.all( | ||
color: borderColor, | ||
width: .5, | ||
), | ||
), | ||
color: color, | ||
child: Stack( | ||
children: [ | ||
if (title != null) | ||
Container( | ||
alignment: Alignment.topLeft, | ||
padding: const EdgeInsets.all(2), | ||
child: Text(title.toUpperCase(), style: TextStyle(fontSize: 6, fontWeight: FontWeight.bold)), | ||
), | ||
if (content != null) | ||
Expanded( | ||
child: Container( | ||
alignment: Alignment.center, | ||
child: Text(content, style: TextStyle(fontSize: 12, color: pencilColor)), | ||
)), | ||
], | ||
), | ||
); | ||
} |
Oops, something went wrong.