Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support expressions for line-dasharray #89

Open
mvarendorff opened this issue Aug 7, 2023 · 1 comment
Open

Support expressions for line-dasharray #89

mvarendorff opened this issue Aug 7, 2023 · 1 comment

Comments

@mvarendorff
Copy link
Contributor

Currently the paint_factory only allows fixed arrays of numbers for line-dasharray and not expressions like ["get", "stroke-dasharray"]:

final dashJson = paint['$prefix-dasharray'];
if (dashJson != null && dashJson is List<num> && dashJson.length >= 2) {
if (dashJson.any((element) => element < .0)) {
logger.warn(() => '$prefix-dasharray contains value < 0');
} else {
dashArray = dashJson.map((e) => e.toDouble()).toList(growable: false);
}
}

@greensopinion
Copy link
Owner

feel free to send a PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants