Flutter Project Kit

Flutter Project Kit (flutter_project_kit) is an all-in-one package designed to simplify and enhance your Flutter projects. It offers customizable routing, theming, buttons, snackbars, read-more text widgets, and other essential UI elements to speed up your development process while keeping your app's design attractive and consistent.

Features

  • Routing: Seamlessly manage routes with customizable navigation flows.
  • Theming: Easily switch between light and dark themes with full customization.
  • Buttons: Pre-built buttons with rich styling and functionality.
  • Snackbars: Beautiful snackbars with multiple types and customization options.
  • Read-More Text: Flexible and customizable text widgets with "read more" and "show less" functionality.
  • Extensions: Handy extension methods to make your code more efficient.

Installation

Add flutter_project_kit to your pubspec.yaml file:

dependencies:
  flutter_project_kit: latest_version

Then, run:

flutter pub get

Usage

1. Buttons

The ProKitButton widget allows you to create a variety of buttons with custom styles, icons, gradients, and more.

Examples

ProKitButton(
  text: "Click Me",
  onPressed: () {
    // Do something
  },
  buttonStyle: ProKitButtonStyle.gradient, // Gradient styling
  showIcon: true,  // Show an icon with the button
  iconAsset: "assets/icons/custom_icon.svg", // SVG icon asset
  buttonColor: Colors.blue, // Background color for the button
  gradient: LinearGradient( // Gradient colors
    colors: [Colors.red, Colors.orange],
  ),
)

Other button variations include:

  • Simple Button: A basic button with text.
  • Button with Icon: Add icons to your buttons for a more informative UI.
  • Custom Styled Button: Create fully custom buttons by modifying text styles, padding, elevation, and more.
  • Button with Custom Widget Icon: Replace the icon with any widget you want.

2. Snackbars

Display engaging, fully customizable snackbars in your app using ProKitSnackBar. You can adjust the snackbars' types, styles, positions, and much more.

Examples

_showSuccessSnackBar(BuildContext context) {
  showProKitSnackBar(
    context,
    title: "Success",
    message: "Operation completed successfully.",
    snackBarType: ProKitSnackBarType.bordered,
    notificationType: ProKitNotificationType.success,
  );
}

Snackbar Types:

  • Bordered Snackbars: Snackbars with borders that match the notification type.
  • Colored Snackbars: Snackbars with a solid background color to match the message type (Success, Error, Warning, Help).
  • Custom Size: Modify the width and height of your snackbars.
  • Positioning: Display your snackbars at various positions on the screen, including top-left, top-right, and center.
  • Auto-Close: Set the duration before the snackbar automatically closes or leave it open until dismissed.

3. Read More Text

The ProKitRichTextReadMore widget allows for truncating lengthy text with "Read More" and "Show Less" functionality, and offers full customization over styles and behavior.

Examples

const ProKitRichTextReadMore(
  text: "This is a short example text to demonstrate the Read More functionality.",
  maxChars: 20, // Maximum characters to show before truncating
)

You can further customize the widget with:

  • Custom Read More/Show Less Text: Modify the text displayed when expanded/collapsed.
  • Custom Colors: Set colors for the "Read More" and "Show Less" texts.
  • Underlining: Enable or disable underlining for the "Read More" and "Show Less" texts.
  • Custom Actions: Add custom behavior when the "Read More" or "Show Less" text is tapped.

4. Theming

Seamlessly integrate light and dark modes into your app using the built-in theme support. You can quickly switch between themes or customize them to fit your branding needs.


5. Extensions

Included in the package are various extension methods that can streamline your Flutter development. Whether it's string manipulation or widget customization, these extensions make your code cleaner and more maintainable.


Getting Started

To get started, import the package:

import 'package:flutter_project_kit/flutter_project_kit.dart';

From there, start using the widgets and utilities offered by the flutter_project_kit package in your Flutter app. Explore the examples provided above for each feature.


Contribution

If you'd like to contribute, please feel free to submit issues or pull requests on the GitHub repository.


License

This package is licensed under the MIT License.