smooth_highlight 0.0.2
smooth_highlight: ^0.0.2 copied to clipboard
Developer emphasize a specific widget by highlight animation.
Smooth Highlight #
You can emphasize a specific widget by highlight animation when you want to emphasize something to your users. As you can see from the following samples, you can use smooth_highlight
in any widget.
And also, you can use ValueChangeHighlight
that is useful when you simply want to highlight only the text changes(refer to Sample2). It is inspired by the Firestore value change animation in the Firebase console.
Sample1 | Sample2 | Sample3 |
---|---|---|
![]() |
![]() |
![]() |
Usage #
SmoothHighlight
is just wrap your widget.
SmoothHighlight(
// set your custom color
highlightColor: Colors.yellow,
child: Text('Hightlight'),
);
ValueChangeHighlight
requires highlight trigger value.
ValueChangeHighlight(
// highlight if count changes
value: count,
highlightColor: Colors.yellow,
child: Text('count: $count'),
);
and you can also define custom behavior.
SmoothHighlight(
// highlight in initState phase.
useInitialHighLight: true,
// highlight if count is only even.
enabled: count % 2 ==0,
);
if you don't want to highlight a specific values, disableValues
property prevents it.
ValueChangeHighlight(
value: count,
// disable highlight if count changes from `null` or `2`.
disableValues: const [null, 2],
);