OnImageMatrixWidget class
This widget will make everything more easy to edit basics information of a image using native matrix you'll be able to control the brightness, exposure, contrast, saturation, etc.. of a image(or a widget), apply filter and convert this widget into a image(bytes).
This package isn't focused on professional image(widget) editting.
All edit use native code(matrix) and widget(ColorFiltered and ImageFiltered).
Examples:
Editting only one matrix:
body: OnImageMatrixWidget(
colorFilter: OnImageMatrix.brightness(3.0),
child: Image.network(
'https://source.unsplash.com/j0QOYiYwIYE/1600x900',
),
),
Applying a filter:
body: OnImageMatrixWidget(
colorFilter: OnImageFilters.gray1,
child: Image.network(
'https://source.unsplash.com/j0QOYiYwIYE/1600x900',
),
),
Editting mutiples matrices:
body: OnImageMatrixWidget(
colorFilter: OnImageMatrix.matrix(
brightnessAndContrast: 5.0,
exposure: 1.0,
saturation: 2.0,
visibility: 1.0,
),
child: Image.network(
'https://source.unsplash.com/j0QOYiYwIYE/1600x900',
),
),
Using the OnImageMatrixWidget you won't be able to 'get' this widget and convert into a image. To achieve this you will use the OnImageMatrixWidget.builder.
Example:
body: OnImageMatrixWidget.builder(
controller: _controller, // required
imageKey: _globalKey, // required
colorFilter: OnImageMatrix.matrix(
brightnessAndContrast: 0.0,
exposure: 0.0,
saturation: 1.0,
visibility: 1.0,
),
child: Image.network(
'https://source.unsplash.com/j0QOYiYwIYE/1600x900',
),
),
To save this widget into a image(bytes) use the controller
onTap: () {
controller.save();
}
To get the bytes:
onTap: () {
Uint8List imageBytes = controller.imageBytes;
}
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- OnImageMatrixWidget
Constructors
- OnImageMatrixWidget.new({Key? key, required Widget child, double? blur, TileMode? blurMode, ColorFilter? colorFilter})
-
This widget will make everything more easy to edit basics information of a image
using native matrix you'll be able to control the brightness, exposure, contrast,
saturation, etc.. of a image(or a widget), apply filter and convert this widget
into a image(bytes).
const
-
OnImageMatrixWidget.builder({Key? key, required OnImageController? controller, required GlobalKey<
State< ? imageKey, required Widget child, ImageByteFormat? imageFormat, double? blur, TileMode? blurMode, ColorFilter? colorFilter, bool visible = true})StatefulWidget> > -
This widget will make everything more easy to edit basics information of a image
using native matrix you'll be able to control the brightness, exposure, contrast,
saturation, etc.. of a image(or a widget), apply filter and convert this widget
into a image(bytes).
const
Properties
- blur → double?
-
blur is the value of how many blur needs to be applyed into the child widget.
final
- blurMode → TileMode?
-
blurMode is the mode of how the blur will be applyed into the child widget.
final
- child → Widget
-
child is the Widget that will be applyed the filter.
final
- colorFilter → ColorFilter?
-
colorFilter is the filter that will be applyed to the child widget.
final
- controller → OnImageController?
-
controller is used to call anytime and anywhere the 'save' method.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- imageFormat → ImageByteFormat?
-
imageFormat is used when calling
saveBytes
from OnImageController.final -
imageKey
→ GlobalKey<
State< ?StatefulWidget> > -
imageKey is used to identify the widget when calling
saveBytes
from OnImageController.final - key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- visible → bool
-
visible is used to control when the child widget will be visible or not..
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _OnImageMatrixWidgetState -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited