diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cc1a52..dc56aaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,6 @@ * Created user interface for the application - ## 1.0.1 * Refactor Readme to meet format @@ -14,3 +13,9 @@ ## 1.0.2 * minor fixes + +## 1.0.3 + +* Improve pub dev score +* Implement more comments + diff --git a/LICENSE b/LICENSE index 995d1ca..b8d3ba8 100644 --- a/LICENSE +++ b/LICENSE @@ -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 @@ -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. diff --git a/lib/src/components/section_bio_container.dart b/lib/src/components/section_bio_container.dart index ac7f688..eacf207 100644 --- a/lib/src/components/section_bio_container.dart +++ b/lib/src/components/section_bio_container.dart @@ -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({ diff --git a/lib/src/components/section_bottom_buttons.dart b/lib/src/components/section_bottom_buttons.dart index 4550b65..038b06b 100644 --- a/lib/src/components/section_bottom_buttons.dart +++ b/lib/src/components/section_bottom_buttons.dart @@ -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, diff --git a/lib/src/components/section_horizontal_divider.dart b/lib/src/components/section_horizontal_divider.dart index 51458c0..f00b8a9 100644 --- a/lib/src/components/section_horizontal_divider.dart +++ b/lib/src/components/section_horizontal_divider.dart @@ -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); diff --git a/lib/src/components/section_responsive_text.dart b/lib/src/components/section_responsive_text.dart index a7450dd..77d2ad0 100644 --- a/lib/src/components/section_responsive_text.dart +++ b/lib/src/components/section_responsive_text.dart @@ -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; @@ -87,8 +108,10 @@ class _DisplayTextState extends State { 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, diff --git a/lib/src/components/section_shaking.dart b/lib/src/components/section_shaking.dart index da64874..cf4ce26 100644 --- a/lib/src/components/section_shaking.dart +++ b/lib/src/components/section_shaking.dart @@ -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; diff --git a/lib/src/layout/layout_business.dart b/lib/src/layout/layout_business.dart index 7c09a65..984da0d 100644 --- a/lib/src/layout/layout_business.dart +++ b/lib/src/layout/layout_business.dart @@ -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, diff --git a/lib/src/layout/layout_classic.dart b/lib/src/layout/layout_classic.dart index 087ca5a..342223f 100644 --- a/lib/src/layout/layout_classic.dart +++ b/lib/src/layout/layout_classic.dart @@ -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, diff --git a/lib/src/layout/layout_modern.dart b/lib/src/layout/layout_modern.dart index f9cf13c..687fbf6 100644 --- a/lib/src/layout/layout_modern.dart +++ b/lib/src/layout/layout_modern.dart @@ -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, diff --git a/lib/src/layout/layout_technical.dart b/lib/src/layout/layout_technical.dart index 802565a..99d9d59 100644 --- a/lib/src/layout/layout_technical.dart +++ b/lib/src/layout/layout_technical.dart @@ -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, diff --git a/lib/src/repository/pdf_saver.dart b/lib/src/repository/pdf_saver.dart index c0d4093..86dac07 100644 --- a/lib/src/repository/pdf_saver.dart +++ b/lib/src/repository/pdf_saver.dart @@ -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 createResume(GlobalKey key); + /// capturePng Future capturePng(GlobalKey key); + /// createPDF Future createPDF(GlobalKey key); + /// findLocalPath Future findLocalPath(); + /// prepareSaveDir Future 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 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 capturePng(GlobalKey key) async { RenderRepaintBoundary boundary = @@ -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 prepareSaveDir() async { var localPath = (await findLocalPath())!; @@ -44,6 +92,8 @@ class PdfHandler implements PdfHandlerInterface { return savedDir; } + /// The [findLocalPath] defines the path based on the platform + /// @override Future findLocalPath() async { if (Platform.isAndroid) { diff --git a/lib/src/styles/theme.dart b/lib/src/styles/theme.dart index 526eab5..4067ba1 100644 --- a/lib/src/styles/theme.dart +++ b/lib/src/styles/theme.dart @@ -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)); @@ -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; diff --git a/pubspec.yaml b/pubspec.yaml index 313304f..21e22bf 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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