product_size_color_selector 1.1.1 copy "product_size_color_selector: ^1.1.1" to clipboard
product_size_color_selector: ^1.1.1 copied to clipboard

A Flutter package for selecting colors and sizes from predefined lists, with callbacks for selections and graceful handling of edge cases.

product_size_color_selector #

This is a Flutter package that provides a user-friendly way for users to select colors and sizes. It allows users to pick from a predefined list of colors and sizes, and provides a callback mechanism to handle the selection. The package also handles edge cases like empty color and size lists gracefully.

img.png

img_1.png

Features #

  • Allows users to pick colors and sizes from a predefined list.
  • Supports custom color and size palettes.
  • Provides a callback mechanism to handle color and size selection.
  • Handles edge cases like empty color and size lists gracefully.

Installation #

Add the following dependency to your pubspec.yaml file:

dependencies:
  color_size_picker: ^0.0.1

Then, run flutter pub get to install the package.

Usage #

Import the package in your Dart file:

import 'package:color_size_picker/color_size_picker.dart';

Use the ColorSelector in your app:

ColorSelector(
  colors: ["Green", "Red", "Blue", "Yellow"],
  onChangeColor: (selectedColor) {
    print("Selected color: $selectedColor");
  },
)

Use the SizeSelector in your app:

SizeSelector(
  sizes: ["S", "M", "L", "XL"],
  onChangeSize: (size) {
    setState(() {
      print("Selected size: $size");
    });
  },
),

Properties #

  • colors: A list of colors to display in the color selector.
  • sizes: A list of sizes to display in the size selector.
  • onChangeColor: A callback function that is called when a color is selected.
  • onChangeSize: A callback function that is called when a size is selected.
  • backgroundColor: The background color of the color selector and size selector. Default is Colors.indigo.
  • borderColor: The border color of the color selector and size selector. Default is Colors.black.

Contributing Contributions are welcome! Please open an issue or submit a pull request on GitHub.

License This project is licensed under the MIT License. See the LICENSE file for details.

3
likes
145
points
1
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package for selecting colors and sizes from predefined lists, with callbacks for selections and graceful handling of edge cases.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on product_size_color_selector