NightReader class

Widget that drawing NightReader.tint with BlendMode.darken to it's subtree, making a darkened screen effect.

Do note that this widget has nothing (yet) to do with the night-light of OS/native platform. It just simply apply specific BlendMode to it's children.

Inheritance

Constructors

NightReader({Key? key, required double value, Color tint = Colors.yellow, double minDarkenOpacity = 0, double maxDarkenOpacity = 0.3, double minTintOpacity = 0, double maxTintOpacity = 0.5, required Widget child})
const

Properties

child Widget
The subtree/child/widget bellow this widget.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxDarkenOpacity double
final
maxTintOpacity double
final
minDarkenOpacity double
The darkened of the subtree, however, is control by minDarkenOpacity and maxDarkenOpacity. At each value of value, the subtree will be darkened by lerpDouble between minDarkenOpacity and maxDarkenOpacity, making the screen go darker. Were maxDarkenOpacity set to 1., the screen will be completely black when value is 1.
final
minTintOpacity double
At each value of value, the opacity of tint will lerpDouble from minTintOpacity to maxTintOpacity, making the subtree below this widgets blended with such color.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tint Color
The color that this widget will apply to the subtree with specific BlendMode.
final
value double
The current value of darkened progress, this value must be within range 0 - 1. This property can be animated with AnimationController or any type of mechanism that trigger a State.setState. In case of one need to simply animating between values, the use of AnimatedNightReader should be considered.
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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}) 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