extended_image
library
Classes
BaseClient
The abstract base class for an HTTP client.
BaseRequest
The base class for HTTP requests.
BaseResponse
The base class for HTTP responses.
BaseResponseWithUrl
A BaseResponse with a url field.
Boundary
extended_image_gesture_utils.dart
create by zmtzawqlp on 2019/4/3
ByteStream
A stream of chunks of bytes representing a single piece of data.
CancellationToken
CancellationTokenSource
Client
The interface for HTTP clients that take care of maintaining persistent
connections across multiple requests to the same server.
CropAspectRatios
CropAspectRatios defines a set of commonly used aspect ratios
for cropping an image. These static constants represent different
ratios between width and height.
EditActionDetails
EditorConfig
The EditorConfig
class provides a customizable configuration for the image editor.
This class defines various parameters for controlling the behavior and appearance
of the cropping functionality, such as maximum scale, aspect ratio, padding,
and corner styles. It allows fine-tuning of the user interface and interaction
within the image editing and cropping environment.
EditorCropLayerPainter
This class is responsible for painting the crop layer in the editor.
It includes methods to paint the mask, grid lines, and corner markers
around the crop area.
ExtendedAssetBundleImageKey
ExtendedAssetImageProvider
ExtendedExactAssetImageProvider
ExtendedFileImageProvider
ExtendedHorizontalDragGestureRecognizer
HorizontalDragGestureRecognizer
ExtendedImage
extended image base on official
Image
ExtendedImageBorderPainter
ExtendedImageCropLayerPainter
This class extends CustomPainter and is responsible for managing
the state of the crop layer, including rotation, crop area dimensions,
and visual attributes like line color, corner size, and mask color.
ExtendedImageEditor
create by zmtzawqlp on 2019/8/22
ExtendedImageEditorState
ExtendedImageGesture
scale idea from https://github.com/flutter/flutter/blob/master/examples/layers/widgets/gestures.dart
zoom image
ExtendedImageGesturePageView
page view to support gesture for image
ExtendedImageGesturePageViewState
ExtendedImageGestureState
ExtendedImageSlidePage
ExtendedImageSlidePageHandler
create by zmtzawqlp on 2019/6/14
ExtendedImageSlidePageHandlerState
ExtendedImageSlidePageState
ExtendedMemoryImageProvider
ExtendedNetworkImageProvider
NetworkImage
ExtendedPageController
ExtendedRawImage
A widget that displays a dart:ui.Image directly.
ExtendedRenderImage
ExtendedRenderSliverFillViewport
A sliver that contains multiple box children that each fill the viewport.
ExtendedResizeImage
Instructs Flutter to decode the image at the specified dimensions
instead of at its native size.
ExtendedSliverFillViewport
A sliver that contains multiple box children that each fills the viewport.
ExtendedVelocityTracker
VelocityTracker
ExtendedVerticalDragGestureRecognizer
GestureAnimation
GestureConfig
GestureDetails
GesturePageView
GestureWidgetDelegateFromRect
GestureWidgetDelegateFromState
HttpClientHelper
ImageEditorController
ImageEditorController is used to control the state of the image editor
by providing functions like rotating, flipping, undoing, and redoing actions.
It communicates with the editor state and allows for real-time updates using
Flutter's ChangeNotifier
.
MultipartFile
A file to be uploaded as part of a MultipartRequest .
MultipartRequest
A multipart/form-data
request.
Request
An HTTP request where the entire request body is known in advance.
RetryHelper
StreamedRequest
An HTTP request where the request body is sent asynchronously after the
connection has been established and the headers have been sent.
StreamedResponse
An HTTP response where the response body is received asynchronously after
the headers have been received.
Functions
cachedImageExists (String url , {String ? cacheKey })
→ Future <bool >
Check if the image exists in cache
clampScale (double scale , double min , double max )
→ double
clearDiskCachedImage (String url , {String ? cacheKey })
→ Future <bool >
Clear the disk cache image then return if it succeed.
clearDiskCachedImages ({Duration ? duration })
→ Future <bool >
Clear the disk cache directory then return if it succeed.
clearGestureDetailsCache ()
→ void
clear the gesture details
clearMemoryImageCache ([String ? name ])
→ void
clear all of image in memory
defaultEditorMaskColorHandler (BuildContext context , bool pointerDown )
→ Color
defaultEditorMaskColorHandler
is a helper function that determines the color
of the editor mask overlay based on whether the pointer is down or not.
defaultSlideEndHandler ({Offset offset = Offset.zero , Size pageSize = const Size(100, 100) , SlideAxis pageGestureAxis = SlideAxis.both })
→ bool
defaultSlidePageBackgroundHandler ({Offset offset = Offset.zero , Size pageSize = const Size(100, 100) , required Color color , SlideAxis pageGestureAxis = SlideAxis.both })
→ Color
ExtendedImageGesturePage
defaultSlideScaleHandler ({Offset offset = Offset.zero , Size pageSize = const Size(100, 100) , SlideAxis pageGestureAxis = SlideAxis.both })
→ double
delete (Uri url , {Object ? body , Encoding ? encoding })
→ Future <Response >
Sends an HTTP DELETE request with the given headers to the given URL.
get (Uri url , { })
→ Future <Response >
Sends an HTTP GET request with the given headers to the given URL.
getCachedImageFile (String url , {String ? cacheKey })
→ Future <File ? >
Get the local file of the cached image
getCachedImageFilePath (String url , {String ? cacheKey })
→ Future <String ? >
Get the local file path of the cached image
getCachedSizeBytes ()
→ Future <int >
Get total size of cached image
getDestinationRect ({required Rect rect , required Size inputSize , double scale = 1.0 , BoxFit ? fit , Alignment alignment = Alignment.center , Rect ? centerSlice , bool flipHorizontally = false })
→ Rect
getDestinationRect
calculates the destination rectangle where an image
or widget should be drawn based on the given input size, scale, alignment,
and fit behavior. This is useful when transforming or resizing images.
getMemoryImageCache ([String ? name ])
→ ImageCache ?
get ImageCache
getNetworkImageData (String url , {bool useCache = true , StreamController <ImageChunkEvent > ? chunkEvents })
→ Future <Uint8List ? >
get network image data from cached
head (Uri url , { })
→ Future <Response >
Sends an HTTP HEAD request with the given headers to the given URL.
keyToMd5 (String key )
→ String
get md5 from key
paintExtendedImage ({required Canvas canvas , required Rect rect , required Image image , String ? debugImageLabel , double scale = 1.0 , double opacity = 1.0 , ColorFilter ? colorFilter , BoxFit ? fit , Alignment alignment = Alignment.center , Rect ? centerSlice , ImageRepeat repeat = ImageRepeat.noRepeat , bool flipHorizontally = false , bool invertColors = false , FilterQuality filterQuality = FilterQuality.low , Rect ? customSourceRect , BeforePaintImage ? beforePaintImage , AfterPaintImage ? afterPaintImage , GestureDetails ? gestureDetails , EditActionDetails ? editActionDetails , bool isAntiAlias = false , EdgeInsets layoutInsets = EdgeInsets.zero })
→ void
Paints an image into the given rectangle on the canvas.
patch (Uri url , {Object ? body , Encoding ? encoding })
→ Future <Response >
Sends an HTTP PATCH request with the given headers and body to the given
URL.
post (Uri url , {Object ? body , Encoding ? encoding })
→ Future <Response >
Sends an HTTP POST request with the given headers and body to the given URL.
put (Uri url , {Object ? body , Encoding ? encoding })
→ Future <Response >
Sends an HTTP PUT request with the given headers and body to the given URL.
read (Uri url , { })
→ Future <String >
Sends an HTTP GET request with the given headers to the given URL and
returns a Future that completes to the body of the response as a String .
readBytes (Uri url , { })
→ Future <Uint8List >
Sends an HTTP GET request with the given headers to the given URL and
returns a Future that completes to the body of the response as a list of
bytes.
roundAfter (double number , int position )
→ double
runWithClient <R > (R body (), Client clientFactory (), {ZoneSpecification ? zoneSpecification })
→ R
Runs body
in its own Zone with the Client returned by clientFactory
set as the default Client .
typeOf <T > ()
→ Type
get type from T
Typedefs
AfterPaintImage
= void Function(Canvas canvas , Rect rect , Image image , Paint paint )
Call after paint image
BeforePaintImage
= bool Function(Canvas canvas , Rect rect , Image image , Paint paint )
rect
is render size
if return true, it will not paint original image,
BuildGestureImage
= Widget Function(GestureDetails gestureDetails )
Build Gesture Image
CanHorizontalOrVerticalDrag
= bool Function()
CanScaleImage
= bool Function(GestureDetails ? details )
Whether should scale image
CanScrollPage
= bool Function(GestureDetails ? gestureDetails )
Whether we can scroll page
DoubleTap
= void Function(ExtendedImageGestureState state )
Double tap call back
EditActionDetailsIsChanged
= void Function(EditActionDetails ? details )
Call when EditActionDetails is changed
EditorMaskColorHandler
= Color Function(BuildContext context , bool pointerDown )
Get editor mask color base on pointerDown
GestureDetailsIsChanged
= void Function(GestureDetails ? details )
Call when GestureDetails is changed
GestureOffsetAnimationCallBack
= void Function(Offset offset )
Animation call back for inertia drag
GestureScaleAnimationCallBack
= void Function(double scale )
Animation call back for scale
HeroBuilderForSlidingPage
= Widget Function(Widget widget )
Build Hero only for sliding page
the transform of sliding page must be working on Hero
so that Hero animation wouldn't be strange when pop page
ImageBuilderForGesture
= Widget Function(Widget image , {ExtendedImageGestureState ? imageGestureState })
Build image for gesture, we can handle custom Widget about gesture
InitDestinationRect
= void Function(Rect initialDestinationRect )
Return initial destination rect
InitEditorConfigHandler
= EditorConfig ? Function(ExtendedImageState ? state )
Init GestureConfig when image is ready.
InitGestureConfigHandler
= GestureConfig Function(ExtendedImageState state )
Init GestureConfig when image is ready.
LoadStateChanged
= Widget ? Function(ExtendedImageState state )
extended_image_typedef.dart
create by zmtzawqlp on 2019/4/3
MergeEditRect
= Rect Function(Rect editRect )
Return merged editRect rect
OnSlidingPage
= void Function(ExtendedImageSlidePageState state )
Call on sliding page
ShouldAccpetHorizontalOrVerticalDrag
= bool Function(Map <int , VelocityTracker > velocityTrackers )
SlideEndHandler
= bool ? Function(Offset offset , {ScaleEndDetails details , ExtendedImageSlidePageState state })
if return true ,pop page
else reset page state
SlideOffsetHandler
= Offset ? Function(Offset offset , {ExtendedImageSlidePageState state })
customize offset of page when slide page
SlidePageBackgroundHandler
= Color Function(Offset offset , Size pageSize )
Build page background when slide page
SlideScaleHandler
= double ? Function(Offset offset , {ExtendedImageSlidePageState state })
Customize scale of page when slide page
VoidFunction
= void Function()