Skip to content

Commit

Permalink
Merge pull request #27 from JordyHers/dev
Browse files Browse the repository at this point in the history
Merge dev to master
  • Loading branch information
JordyHers authored May 8, 2023
2 parents 2f75fa5 + 57d6578 commit 7ad1a1d
Show file tree
Hide file tree
Showing 14 changed files with 214 additions and 17 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@
* Created user interface for the application



## 1.0.1

* Refactor Readme to meet format

## 1.0.2

* minor fixes

## 1.0.3

* Improve pub dev score
* Implement more comments

15 changes: 7 additions & 8 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Copyright (c) [2023] [Jordy Hershel Igondjo]
MIT License

Copyright (c) 2023 Jordy Hershel IGONDJO

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -7,16 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

All materials and credentials used in this software remain the exclusive property of Jordy Hershel Igondjo, and may not be used, reproduced, or distributed without express permission from Jordy Hershel Igondjo.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.se here.

OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 4 additions & 0 deletions lib/src/components/section_bio_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import 'package:flutter/material.dart';
import 'package:flutter_resume_template/flutter_resume_template.dart';

///[SBContainer] is a section biography container
/// This container helps create responsive spacing between
/// elements in the layout.
///
///
class SBContainer extends StatelessWidget {
final Widget child;
const SBContainer({
Expand Down
3 changes: 3 additions & 0 deletions lib/src/components/section_bottom_buttons.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import 'package:flutter/material.dart';

/// This [AnimateButton] is displayed at the bottom
/// of the page when the [TemplateMode] selected is
/// shake while editing. This is not compulsory
class AnimateButton extends StatefulWidget {
const AnimateButton({
Key? key,
Expand Down
3 changes: 3 additions & 0 deletions lib/src/components/section_horizontal_divider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import 'package:flutter/material.dart';
import 'package:flutter_resume_template/flutter_resume_template.dart';

/// [SHDivider] is a section_horizontal_divider
/// That component separates sections in some
/// layout templates. Used to create uniformity
/// and consistency in design
class SHDivider extends StatelessWidget {
const SHDivider({Key? key}) : super(key: key);

Expand Down
27 changes: 25 additions & 2 deletions lib/src/components/section_responsive_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,27 @@ import 'package:flutter/material.dart';
import 'package:flutter_resume_template/flutter_resume_template.dart';
import 'package:flutter_resume_template/src/components/section_bio_container.dart';

/// A class that represents a display text component used in
/// all resume layouts.
///
/// The [DisplayText] class is a composite widget that includes an
/// `AutoSizeText` widget and a `TextField` widget. The
/// `AutoSizeText` widget is used to display the text in a layout
/// when editing mode is disabled, while the `TextField`
/// widget is used to allow the user to edit the text when editing
/// mode is enabled.
///
/// The `DisplayText` class automatically switches between display
/// modes based on the value of the `editing` parameter.
/// When `editing` is `true`, the `TextField` widget is displayed,
/// allowing the user to edit the text. When `editing`
/// is `false`, the `AutoSizeText` widget is displayed, showing
/// the text using the current theme.
///
/// This class is intended to be used as a major component in all
/// resume layouts. It provides a consistent way of
/// displaying and editing text across all layouts.
class DisplayText extends StatefulWidget {
final EdgeInsetsGeometry? padding;
final String? text;
Expand Down Expand Up @@ -87,8 +108,10 @@ class _DisplayTextState extends State<DisplayText> {
decoration: InputDecoration(
hintText: _textEditingController.text,
border: const OutlineInputBorder(),
contentPadding:
const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
contentPadding: EdgeInsets.symmetric(
horizontal: Config.eightPx * 2,
vertical: Config.eightPx,
),
), // and this
keyboardType: TextInputType.multiline,
textInputAction: TextInputAction.done,
Expand Down
4 changes: 4 additions & 0 deletions lib/src/components/section_shaking.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import 'package:flutter/material.dart';
import 'package:flutter_resume_template/flutter_resume_template.dart';
import 'package:flutter_shake_animated/flutter_shake_animated.dart';

/// This element create a shaking effect when the
/// editing mode is selected. pass the child or autoplay
/// parameter
///
class AnimatedShakingBuilder extends StatelessWidget {
final Widget child;
final bool autoPlay;
Expand Down
14 changes: 14 additions & 0 deletions lib/src/layout/layout_business.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ import 'package:flutter_resume_template/src/components/section_rating_widget.dar
import 'package:flutter_resume_template/src/components/section_shaking.dart';
import 'package:flutter_resume_template/src/utils/typedef_utils.dart';

/// A stateful widget that provides a resume template designed to look like a business curriculum vitae.
///
/// This widget, named LayoutBusiness, can be used to display personal information, work experience, education, and other
/// relevant details in a professional format suitable for job applications and career-oriented websites. The template
/// includes a header section with the user's name and contact information, a summary section highlighting key skills and
/// qualifications, and sections for listing work experience, education, and other achievements.
///
/// The widget is designed to be customizable, with options for adjusting font sizes, colors, and other visual elements to
/// match the user's branding or preferences. It also supports dynamic data binding, allowing users to easily update the
/// content of their resume without needing to modify the underlying widget code.
///
/// To use this widget, simply create an instance of LayoutBusiness and pass in the required parameters. The widget will
/// automatically render the resume template based on the provided data.
class LayoutBusiness extends StatefulWidget {
const LayoutBusiness({
super.key,
Expand Down
13 changes: 13 additions & 0 deletions lib/src/layout/layout_classic.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ import 'package:flutter_resume_template/src/utils/helper.dart';
import 'package:flutter_resume_template/src/utils/strings.dart';
import 'package:flutter_resume_template/src/utils/typedef_utils.dart';

/// A stateful widget that provides a classic-style layout for displaying content.
///
/// This widget, named LayoutClassic, is designed to display text, images, and other content in a simple, elegant format.
/// The template includes a header section with a title and subtitle, a main content area, and a footer section for
/// additional information or navigation links.
///
/// The widget is customizable, with options for adjusting font sizes, colors, and other visual elements to match the
/// user's branding or preferences. It also supports dynamic data binding, allowing users to easily update the content of
/// their layout without needing to modify the underlying widget code.
///
/// To use this widget, simply create an instance of LayoutClassic and pass in the required parameters. The widget will
/// automatically render the classic-style layout based on the provided data.
class LayoutClassic extends StatefulWidget {
const LayoutClassic({
super.key,
Expand Down
13 changes: 13 additions & 0 deletions lib/src/layout/layout_modern.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ import 'package:flutter_resume_template/src/utils/helper.dart';
import 'package:flutter_resume_template/src/utils/strings.dart';
import 'package:flutter_resume_template/src/utils/typedef_utils.dart';

/// A stateful widget that provides a modern-style layout for displaying content.
///
/// This widget, named LayoutModern, is designed to display text, images, and other content in a clean, minimalist format.
/// The template includes a hero section with a large background image or video, a main content area for displaying
/// additional content, and a footer section for additional information or navigation links.
///
/// The widget is customizable, with options for adjusting font sizes, colors, and other visual elements to match the
/// user's branding or preferences. It also supports dynamic data binding, allowing users to easily update the content of
/// their layout without needing to modify the underlying widget code.
///
/// To use this widget, simply create an instance of LayoutModern and pass in the required parameters. The widget will
/// automatically render the modern-style layout based on the provided data.
class LayoutModern extends StatefulWidget {
const LayoutModern({
super.key,
Expand Down
13 changes: 13 additions & 0 deletions lib/src/layout/layout_technical.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ import 'package:flutter_resume_template/src/utils/helper.dart';
import 'package:flutter_resume_template/src/utils/strings.dart';
import 'package:flutter_resume_template/src/utils/typedef_utils.dart';

/// A stateful widget that provides a technical-style layout for displaying content.
///
/// This widget, named LayoutTechnical, is designed to display technical documentation, code snippets, and other content
/// in a modern, streamlined format. The template includes a sidebar section for navigation links, a main content area
/// for displaying documentation or code, and a footer section for additional information or attribution.
///
/// The widget is customizable, with options for adjusting font sizes, colors, and other visual elements to match the
/// user's branding or preferences. It also supports dynamic data binding, allowing users to easily update the content of
/// their layout without needing to modify the underlying widget code.
///
/// To use this widget, simply create an instance of LayoutTechnical and pass in the required parameters. The widget will
/// automatically render the technical-style layout based on the provided data.
class LayoutTechnical extends StatefulWidget {
const LayoutTechnical({
super.key,
Expand Down
52 changes: 51 additions & 1 deletion lib/src/repository/pdf_saver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,69 @@ import 'package:flutter/rendering.dart';
import 'package:path_provider/path_provider.dart';
import 'package:pdf/widgets.dart' as pw;

/// An abstract class that defines a PDFHandler, which
/// is responsible for saving PDF files to disk or to an external
/// service.
///
/// This class provides a common interface for handling PDF
/// files and can be extended to implement different storage
/// strategies such as saving files to local disk, uploading
/// files to a cloud storage service, or emailing PDF files to
/// recipients.
///
/// To implement a specific storage strategy, extend this class
/// and implement the `savePdf` method, which takes in a
/// `PdfDocument` object and saves it to the desired location.
/// The `PdfDocument` class provides an API for generating PDF
/// documents with custom layouts, fonts, and other features.
///
/// The `PDFHandler` class also defines a `getFileName` method
/// that generates a unique filename for the PDF file based on
/// the current timestamp and other parameters. This helps prevent
/// filename collisions and makes it easy to manage
/// multiple PDF files.
///
/// To use a specific implementation of `PDFHandler`, simply create
/// an instance of the subclass and call the `savePdf`
/// method with a `PdfDocument` object. The PDF file will be saved
/// to the specified location based on the implementation
/// details of the subclass.
abstract class PdfHandlerInterface {
/// createResume
Future<void> createResume(GlobalKey key);

/// capturePng
Future<Uint8List> capturePng(GlobalKey key);

/// createPDF
Future<GlobalKey> createPDF(GlobalKey key);

/// findLocalPath
Future<String?> findLocalPath();

/// prepareSaveDir
Future<Directory> prepareSaveDir();
}

/// This part contains the implementation of the pdf handler.
/// The pdf handler only locally saves a pdf version copy of
/// your Resume. To add more specificities you may need to
/// create a more complete functions that allow you to customize
/// more.
///
///
class PdfHandler implements PdfHandlerInterface {
// generate the final resume in pdf.
/// This function should receive the GlobalKey and generate the
/// final resume in pdf.
///
@override
Future<GlobalKey> createResume(GlobalKey key) async => createPDF(key);

/// The [capturePng] will create a png file screenshot of everything
/// that are visually present on the device screen.
///
@override
Future<Uint8List> capturePng(GlobalKey key) async {
RenderRepaintBoundary boundary =
Expand All @@ -33,6 +79,8 @@ class PdfHandler implements PdfHandlerInterface {
return byteData!.buffer.asUint8List();
}

/// This function handles the directory path for the file to be saved.
///
@override
Future<Directory> prepareSaveDir() async {
var localPath = (await findLocalPath())!;
Expand All @@ -44,6 +92,8 @@ class PdfHandler implements PdfHandlerInterface {
return savedDir;
}

/// The [findLocalPath] defines the path based on the platform
///
@override
Future<String?> findLocalPath() async {
if (Platform.isAndroid) {
Expand Down
55 changes: 55 additions & 0 deletions lib/src/styles/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@ import 'package:flutter/material.dart';
import 'package:flutter_resume_template/flutter_resume_template.dart';
import 'package:google_fonts/google_fonts.dart';

/// A class that defines a set of custom colors for use in an application.
///
/// The `CustomColors` class provides a static set of color constants that can
/// be used to provide a consistent color scheme throughout an application. These
/// colors are chosen to match the branding or visual design of the application
/// and can be easily referenced from anywhere in the code.
///
/// The color constants defined in this class are static and immutable, and can be
/// accessed using the class name and the dot notation, for example `CustomColors.primaryColor`.
/// This allows for easy and consistent usage of colors
/// throughout the codebase.
///
/// To add additional colors, simply define a new static `Color` constant in the `
/// CustomColors` class. This can be done using the `Color` constructor with a hex
/// code or an RGB value. For example, to define a new color named `accentColor`,
/// you could add `static const Color accentColor = Color(0xFF00FF00);` to the
/// `CustomColors` class.
///
/// This class is intended to be used as a global color theme for the entire application,
/// and should be used in conjunction with a `Theme` widget or a similar mechanism for
/// setting the theme of an application.
///
///
class CustomColors {
static MaterialColor primaryColorModern =
buildMaterialColor(const Color(0xFF323b4c));
Expand All @@ -28,6 +52,37 @@ class CustomColors {
}
}

/// A class that defines the theme for each resume layout template.
///
/// The `TemplateTheme` class provides a set of constants for the
/// colors, fonts, and other visual elements that are
/// specific to each resume layout template. This class is responsible
/// for handling the theme of each resume layout and
/// ensuring that the correct colors and fonts are used in each template.
///
/// The theme of each resume layout is accessible and handled in this
/// class through a set of static constants. Each
/// constant corresponds to a different theme element, such as
/// `backgroundColor`, `primaryColor`, `secondaryColor`,
/// `headlineFont`, and `bodyFont`. These constants can be used to
/// set the theme of a specific layout by passing them to
/// a `Theme` widget or a similar mechanism for setting the theme
/// of a widget subtree.
///
/// To add a new resume layout template, simply define a new set
/// of constants for the colors, fonts, and other visual
/// elements that are specific to the layout. These constants should
/// be added as static constants to this class and
/// should follow the naming conventions used by the existing constants.
/// Each new layout template should have a unique
/// set of constants to ensure that the correct theme is applied to
/// each layout.
///
/// This class is intended to be used as a global theme for the entire
/// resume generation process, and should be used in
/// conjunction with the layout templates and other widgets that make
/// up the resume generation process.
class TemplateTheme {
/// templateType
final TemplateType type;
Expand Down
8 changes: 3 additions & 5 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ name: flutter_resume_template

#description of the package
description: >-
The flutter_resume_template plugin provides a customizable resume template
This plugin provides a customizable resume template
that can be easily integrated into a Flutter application.
This plugin provides a FlutterResumeTemplate widget that takes the parameters,
TemplateMode, TemplateTheme, onSaveResume, TemplateData and onEmpty(),
to customize the template according to your needs.
#Version to be released
version: 1.0.2
version: 1.0.3

#package homepage:
homepage: https://github.com/JordyHers/flutter_resume_template
Expand Down

0 comments on commit 7ad1a1d

Please sign in to comment.