more documentation in the read me

This commit is contained in:
commitimpush 2022-08-31 17:03:20 +02:00
parent a569e91520
commit 817854fac2
4 changed files with 19 additions and 19 deletions

View file

@ -27,18 +27,18 @@ To use this package, add `flutter_image_picker` as a [dependency in your pubspec
See [Example Code](example/lib/main.dart) for an example on how to use this package.
You can add optional parameters to the `showImagePickerDialog(context)` function call. These are:
| Parameter | Explaination |
|-------------------|---------------|
| title | left-aligned |
| titleTextSize | centered |
| iconSize | right-aligned |
| iconTextSize | right-aligned |
| spaceBetweenIcons | right-aligned |
| makePhotoText | right-aligned |
| makePhotoIcon | right-aligned |
| selectImageText | right-aligned |
| selectImageIcon | right-aligned |
| closeButtonText | right-aligned |
| Parameter | Explaination |
|-------------------|----------------|
| title | The title that's shown at the top of the Image Picker Dialog in the bottom of the screen |
| titleTextSize | The font size of the title mentioned above |
| iconSize | The size of the icons that are shown in the Image Picker Dialog |
| iconTextSize | The font size of the text underneath the icons in the Image Picker Dialog |
| spaceBetweenIcons | The space in pixels between the two icons in the Image Picker Dialog |
| makePhotoIcon | The icon that is shown as the Make Photo button |
| makePhotoText | The text that is shown underneath the Make Photo icon in the Image Picker Dialog |
| selectImageIcon | The icon that is shown as the Select Image button |
| selectImageText | The text that is shown underneath the Select Image icon in the Image Picker Dialog |
| closeButtonText | The text that is visible on the button that is shown at the bottom of the Image Picker Dialog that closes the dialog |
## Additional information

View file

@ -13,8 +13,8 @@ class ImagePicker {
double spaceBetweenIcons = ImagePickerDefaultParameters.spaceBetweenIcons,
String makePhotoText = ImagePickerDefaultParameters.makePhotoText,
IconData makePhotoIcon = ImagePickerDefaultParameters.makePhotoIcon,
String selectImageText = ImagePickerDefaultParameters.selectImageText,
IconData selectImageIcon = ImagePickerDefaultParameters.selectImageIcon,
String selectImageText = ImagePickerDefaultParameters.selectImageText,
String closeButtonText = ImagePickerDefaultParameters.closeButtonText}) {
return ImagePickerUI().pickImageDialog(
context,
@ -23,10 +23,10 @@ class ImagePicker {
iconSize,
iconTextSize,
spaceBetweenIcons,
makePhotoText,
makePhotoIcon,
selectImageText,
makePhotoText,
selectImageIcon,
selectImageText,
closeButtonText);
}
}

View file

@ -6,9 +6,9 @@ class ImagePickerDefaultParameters {
static const double iconSize = 125;
static const double iconTextSize = 15;
static const double spaceBetweenIcons = 30;
static const String makePhotoText = "Take a Picture";
static const IconData makePhotoIcon = Icons.camera_alt_rounded;
static const String selectImageText = "Select File";
static const String makePhotoText = "Take a Picture";
static const IconData selectImageIcon = Icons.image;
static const String selectImageText = "Select File";
static const String closeButtonText = "Close";
}

View file

@ -14,10 +14,10 @@ class ImagePickerUI {
double iconSize,
double iconTextSize,
double spaceBetweenIcons,
String makePhotoText,
IconData makePhotoIcon,
String selectImageText,
String makePhotoText,
IconData selectImageIcon,
String selectImageText,
String closeButtonText) async {
return await showModalBottomSheet<Uint8List?>(
context: context,