Skip to content

Commit

Permalink
Merge branch 'dev' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
PLGuerraDesigns committed Oct 26, 2023
2 parents e7f93be + f1bbe23 commit b9cdb23
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 36 deletions.
62 changes: 29 additions & 33 deletions lib/services/pdf_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ class PDFGenerator {
padding: const EdgeInsets.symmetric(horizontal: 2, vertical: 2),
child: Text(
genericSection.descriptionController.text,
textAlign: TextAlign.justify,
style: const TextStyle(
fontSize: 12,
color: PdfColor(0.15, 0.15, 0.15),
Expand Down Expand Up @@ -244,6 +245,7 @@ class PDFGenerator {
experience.descriptionController.text.isEmpty
? Container()
: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
Expand Down Expand Up @@ -277,22 +279,18 @@ class PDFGenerator {
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Padding(
padding:
const EdgeInsets.symmetric(horizontal: 2, vertical: 2),
child: Text(
experience.descriptionController.text,
style: const TextStyle(
fontSize: 12,
color: PdfColor(0.15, 0.15, 0.15),
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 2, vertical: 2),
child: Text(
experience.descriptionController.text,
textAlign: TextAlign.justify,
style: const TextStyle(
fontSize: 12,
color: PdfColor(0.15, 0.15, 0.15),
),
],
),
),
SizedBox(height: 4),
],
);
}
Expand Down Expand Up @@ -365,13 +363,13 @@ class PDFGenerator {
}

/// The resume footer.
Widget _footer() {
Widget _footer({required int currentPage, required int totalPages}) {
return Stack(
children: <Widget>[
Align(
alignment: Alignment.bottomCenter,
child: Text(
'${resume.nameController.text} - Page 1 / 1',
'${resume.nameController.text} - Page $currentPage / $totalPages',
style:
const TextStyle(color: PdfColor(0.5, 0.5, 0.5), fontSize: 10),
),
Expand Down Expand Up @@ -416,30 +414,28 @@ class PDFGenerator {
final Document pdf = Document();

pdf.addPage(
Page(
MultiPage(
theme: ThemeData.withFont(
base: await PdfGoogleFonts.robotoRegular(),
bold: await PdfGoogleFonts.robotoBold(),
icons: await PdfGoogleFonts.cupertinoIcons(),
),
pageFormat: PdfPageFormat.letter,
margin: const EdgeInsets.only(top: 50, left: 50, right: 50, bottom: 25),
build: (Context context) {
return Stack(
alignment: Alignment.bottomCenter,
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
_header(),
..._getOrderedSections(),
],
),
_footer(),
],
);
margin: const EdgeInsets.only(top: 30, left: 50, right: 50, bottom: 25),
header: (Context context) {
if (context.pageNumber == 1) {
return _header();
}
return Container();
},
clip: true,
build: (Context context) => _getOrderedSections(),
footer: (Context context) => Align(
alignment: Alignment.bottomCenter,
child: _footer(
currentPage: context.pageNumber,
totalPages: context.pagesCount,
),
),
),
);
return pdf.save();
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: flutter_resume_builder
description: A resume builder app made with flutter.
description: A resume builder app powered by flutter.

publish_to: "none"

version: 0.4.6+13
version: 0.4.7+14

environment:
sdk: ">=3.0.6 <4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta name="description" content="A new Flutter project.">
<meta name="description" content="A resume builder app powered by flutter.">

<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
Expand Down

0 comments on commit b9cdb23

Please sign in to comment.