AwesomeImageSelector Package Documentation

The AwesomeImageSelector package simplifies the process of selecting and displaying images in your Flutter application. It offers an easy-to-use widget that handles image selection, display, and editing. This package is compatible with Android and iOS platforms.

Installation

To use the AwesomeImageSelector package, add it to your pubspec.yaml file:

dependencies:
  awesome_image_selector: ^1.0.0

Then run flutter pub get to install the package.

Getting Started

1. Import the package:

import 'package:awesome_image_selector/awesome_image_selector.dart';

2. Implement the AwesomeImageSelector Widget:

AwesomeImageSelector(
  onImageChanged: (XFile file) {
    // Handle the selected image file here
    // This function will be called whenever an image is selected or changed
  },
  // Other optional parameters...
)

3. Basic Usage:

AwesomeImageSelector(
  onImageChanged: (XFile file) {
    // Handle the selected image file here
  },
)

This will display a card with an "UPLOAD IMAGE" button. When the button is pressed, the user can select an image from their gallery. Once an image is selected, the onImageChanged callback will be triggered.

4. Advanced Usage with Initial Image and Customization:

AwesomeImageSelector(
  onImageChanged: (XFile file) {
    // Handle the selected image file here
  },
  initialImage: AssetImage('assets/placeholder.png'),
  bgCardColor: Colors.grey[200],
  selectText: 'Select Image',
  changeText: 'Change Image',
)

In this example, an initial image is provided, and the card's background color, select button text, and change button text are customized.

Image Editing

The AwesomeImageSelector package also supports basic image editing:

  • When an image is selected, an "EDIT IMAGE" button will appear.
  • Pressing the button will open the selected image for editing.

Note

  • This package only works on Android and iOS platforms.
  • Make sure to handle errors and edge cases appropriately in your implementation.

Feel free to customize and extend the provided examples to fit your application's needs. The AwesomeImageSelector package simplifies the process of image selection and display, enhancing the user experience in your Flutter app.