merged add figma link in this branch

This commit is contained in:
mike doornenbal 2024-02-07 09:53:11 +01:00
commit 9e3eaff8c2
4 changed files with 21 additions and 18 deletions

View file

@ -6,6 +6,9 @@ Image Picker that can be used to pick an image from storage or make a picture wi
![Image Picker GIF](flutter_image_picker.gif) ![Image Picker GIF](flutter_image_picker.gif)
Figma Design that defines this component (only accessible for Iconica developers): https://www.figma.com/file/4WkjwynOz5wFeFBRqTHPeP/Iconica-Design-System?type=design&node-id=357%3A3354&mode=design&t=XulkAJNPQ32ARxWh-1
Figma clickable prototype that demonstrates this component (only accessible for Iconica developers): https://www.figma.com/proto/4WkjwynOz5wFeFBRqTHPeP/Iconica-Design-System?type=design&node-id=340-611&viewport=188%2C-512%2C0.05&t=XulkAJNPQ32ARxWh-0&scaling=min-zoom&starting-point-node-id=516%3A2544&show-proto-sidebar=1
## Setup ## Setup
To use this package, add `flutter_image_picker` as a dependency in your pubspec.yaml file. To use this package, add `flutter_image_picker` as a dependency in your pubspec.yaml file.

View file

@ -64,22 +64,22 @@ class ImagePickerTheme {
/// The size of the space between the two icons in the Image Picker Dialog. /// The size of the space between the two icons in the Image Picker Dialog.
final double spaceBetweenIcons; final double spaceBetweenIcons;
/// The icon that is displayed for the 'Make Photo' functionality of the /// The icon that is displayed for the 'Make Photo' functionality of the
/// Image Picker Dialog. /// Image Picker Dialog.
final Widget? makePhotoIcon; final Widget? makePhotoIcon;
/// The text that is displayed underneath the 'Make Photo' icon. /// The text that is displayed underneath the 'Make Photo' icon.
final String makePhotoText; final String makePhotoText;
/// The icon that is displayed for the 'Select Image From Gallery' /// The icon that is displayed for the 'Select Image From Gallery'
/// functionality of the Image Picker Dialog. /// functionality of the Image Picker Dialog.
final Widget? selectImageIcon; final Widget? selectImageIcon;
/// The text that is displayed underneath the 'Select Image From Gallery' /// The text that is displayed underneath the 'Select Image From Gallery'
/// icon. /// icon.
final String selectImageText; final String selectImageText;
/// The text that is shown on the 'Close Dialog' button at the bottom of the /// The text that is shown on the 'Close Dialog' button at the bottom of the
/// Image Picker Dialog. /// Image Picker Dialog.
final String closeButtonText; final String closeButtonText;
@ -89,11 +89,11 @@ class ImagePickerTheme {
/// The color of the text of the close button of the Image Picker Dialog. /// The color of the text of the close button of the Image Picker Dialog.
final Color closeButtonTextColor; final Color closeButtonTextColor;
/// The width of the 'Close Dialog' button at the bottom of the Image Picker /// The width of the 'Close Dialog' button at the bottom of the Image Picker
/// Dialog. /// Dialog.
final double closeButtonWidth; final double closeButtonWidth;
/// The height of the 'Close Dialog' button at the bottom of the Image Picker /// The height of the 'Close Dialog' button at the bottom of the Image Picker
/// Dialog. /// Dialog.
final double closeButtonHeight; final double closeButtonHeight;

View file

@ -11,7 +11,7 @@ import 'package:image_picker/image_picker.dart';
/// If you have your own implementation of the Image Picker you can add it to /// If you have your own implementation of the Image Picker you can add it to
/// the constructor when creating the class. /// the constructor when creating the class.
mixin ImagePickerService { mixin ImagePickerService {
/// [pickImage] is the function that picks the image and returns it as a /// [pickImage] is the function that picks the image and returns it as a
/// [Uint8List]. /// [Uint8List].
/// The function requires [source], an [ImageSource] /// The function requires [source], an [ImageSource]
Future<Uint8List?> pickImage( Future<Uint8List?> pickImage(
@ -20,20 +20,20 @@ mixin ImagePickerService {
}); });
} }
/// The ImagePickerServiceDefault is the default implementation of the /// The ImagePickerServiceDefault is the default implementation of the
/// ImagePickerService. /// ImagePickerService.
/// It uses the Image Picker package to pick an image and returns it as a /// It uses the Image Picker package to pick an image and returns it as a
/// [Uint8List]. /// [Uint8List].
class ImagePickerServiceDefault implements ImagePickerService { class ImagePickerServiceDefault implements ImagePickerService {
ImagePickerServiceDefault({this.imagePicker}); ImagePickerServiceDefault({this.imagePicker});
/// It's possible to have your own implementation for the Image Picker if you /// It's possible to have your own implementation for the Image Picker if you
/// don't want to use the Image Picker Package. /// don't want to use the Image Picker Package.
ImagePicker? imagePicker; ImagePicker? imagePicker;
/// [pickImage] is the function that picks the image and returns it as a /// [pickImage] is the function that picks the image and returns it as a
/// [Uint8List]. /// [Uint8List].
/// The function requires [source], an [ImageSource] that's the method of how /// The function requires [source], an [ImageSource] that's the method of how
/// the image needs to be picked, for example gallery or camera. /// the image needs to be picked, for example gallery or camera.
@override @override
Future<Uint8List?> pickImage( Future<Uint8List?> pickImage(

View file

@ -114,17 +114,17 @@ class ImagePicker extends StatelessWidget {
), ),
); );
/// The [_generateIconButtonWithText] function returns a column that includes /// The [_generateIconButtonWithText] function returns a column that includes
/// an [IconButton] and [Text]. /// an [IconButton] and [Text].
/// The function requires the following parameters to be able to generate an /// The function requires the following parameters to be able to generate an
/// icon with text: /// icon with text:
/// [context] The build context that is required to make the [pickImage] /// [context] The build context that is required to make the [pickImage]
/// function in [_imagePickerService] work. /// function in [_imagePickerService] work.
/// [imagePickerTheme] The ImagePickerTheme that includes all default values /// [imagePickerTheme] The ImagePickerTheme that includes all default values
/// for the Image Picker Dialog. /// for the Image Picker Dialog.
/// [icon] The icon that needs to be displayed, requires an [IconData] as /// [icon] The icon that needs to be displayed, requires an [IconData] as
///value to be used. ///value to be used.
/// [imageSource] The type of [ImageSource] to be used to pick an image when /// [imageSource] The type of [ImageSource] to be used to pick an image when
/// pressed on the icon. /// pressed on the icon.
/// [bottomText] The text that's displayed underneath the icon. /// [bottomText] The text that's displayed underneath the icon.
Column _generateIconButtonWithText( Column _generateIconButtonWithText(