You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The logic for determining an AbstractGradient's identity has some improvements that can be made:
1. Add Gradient Direction To AbstractGradient's Identity Check
The GradientDirection is not considered part of the AbstractGradient's identity check.
The only properties checked are:
the widget string,
the gradient style and
the flutter gradient object.
This leads to specifying the gradient direction separately from the gradient object when selecting rebuild triggers for the PreviewSection. See #80 (comment).
Improvements
The logic for determining an
AbstractGradient
's identity has some improvements that can be made:1. Add Gradient Direction To AbstractGradient's Identity Check
The
GradientDirection
is not considered part of theAbstractGradient
's identity check.The only properties checked are:
This leads to specifying the gradient direction separately from the gradient object when selecting rebuild triggers for the
PreviewSection
. See #80 (comment).LinearStyleGradient
flutter_gradient_generator/lib/models/linear_style_gradient.dart
Lines 83 to 94 in f725587
2. Reuse Identity Check Logic
The logic for the identity check is duplicated across
LinearStyleGradient
,RadialStyleGradient
, andSweepStyleGradient
.The logic can be centralized in the
AbstractGradient
class.This will improve maintainability, especially as other gradient styles will be introduced.
LinearStyleGradient:
flutter_gradient_generator/lib/models/linear_style_gradient.dart
Lines 83 to 94 in f725587
RadialStyleGradient:
flutter_gradient_generator/lib/models/radial_style_gradient.dart
Lines 67 to 78 in f725587
SweepStyleGradient:
flutter_gradient_generator/lib/models/sweep_style_gradient.dart
Lines 69 to 80 in f725587
The text was updated successfully, but these errors were encountered: