mirror of
https://github.com/Iconica-Development/flutter_image_picker.git
synced 2025-05-18 11:43:44 +02:00
merged add figma link in this branch
This commit is contained in:
commit
9e3eaff8c2
4 changed files with 21 additions and 18 deletions
|
@ -6,6 +6,9 @@ Image Picker that can be used to pick an image from storage or make a picture wi
|
|||
|
||||

|
||||
|
||||
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
|
||||
|
||||
To use this package, add `flutter_image_picker` as a dependency in your pubspec.yaml file.
|
||||
|
|
|
@ -64,22 +64,22 @@ class ImagePickerTheme {
|
|||
/// The size of the space between the two icons in the Image Picker Dialog.
|
||||
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.
|
||||
final Widget? makePhotoIcon;
|
||||
|
||||
/// The text that is displayed underneath the 'Make Photo' icon.
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
final String closeButtonText;
|
||||
|
||||
|
@ -89,11 +89,11 @@ class ImagePickerTheme {
|
|||
/// The color of the text of the close button of the Image Picker Dialog.
|
||||
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.
|
||||
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.
|
||||
final double closeButtonHeight;
|
||||
|
||||
|
|
|
@ -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
|
||||
/// the constructor when creating the class.
|
||||
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].
|
||||
/// The function requires [source], an [ImageSource]
|
||||
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.
|
||||
/// 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].
|
||||
class ImagePickerServiceDefault implements ImagePickerService {
|
||||
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.
|
||||
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].
|
||||
/// 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.
|
||||
@override
|
||||
Future<Uint8List?> pickImage(
|
||||
|
|
|
@ -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].
|
||||
/// 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:
|
||||
/// [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.
|
||||
/// [imagePickerTheme] The ImagePickerTheme that includes all default values
|
||||
/// [imagePickerTheme] The ImagePickerTheme that includes all default values
|
||||
/// 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.
|
||||
/// [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.
|
||||
/// [bottomText] The text that's displayed underneath the icon.
|
||||
Column _generateIconButtonWithText(
|
||||
|
|
Loading…
Reference in a new issue