mark-nicepants / figma2flutter

Converts design token json files to flutter
Apache License 2.0
17 stars 16 forks source link

[BUG] #1

Closed JDDV closed 8 months ago

JDDV commented 1 year ago

:information_source: Info

Pulled version 0.1.1-alpha from GitHub. Version on Pub.dev however is still 0.1.0-alpha (that version is used if you activate the package using dart pub global activate figma2flutter).

:speech_balloon: Description

First of all, @mark-nicepants thank you for this awesome package!

I've been trying out the package but there are 2 small bugs that I've noticed.

The generated output is not correct, and I think I've found the reason for it. In the tokens.g.dart file the generated class DefaultRadiiTokens tokens returns a const BorderRadius.zero which is not possible, since there is no const constructor for BorderRadius.zero. The same goes for DefaultSpacingTokens, where a const EdgeInsets.zero can be returned, which is not possible either since there is no const constructor for EdgeInsets.zero.

I tried to make a PR, but I have no permissions it said when I tried to push the PR. I noticed how ever that the bug for the DefaultSpacingTokens class is fixed in version 0.1.1-alpha, but because the version 0.1.0-alpha is being used (that's the version on pub.dev) the files still generate the wrong output.

I fixed those little bugs locally on my machine, but another error came to light when I did that. I tried to activate the local package by using dart pub global activate --source path <local dir>, so I am able to run the figma2flutter --input <input json> --output <output dir> with the fixed bugs. This however did not work because the paths are hardcoded in version 0.1.1-alpha in the figma2flutter.dart file, instead of using the values from the parameters.

Edit: I missed the commented lines above the part were the paths were hardcoded, so locally on my machine I uncommented the variables that take the values supplied for the input and output parameters, and commented the hardcoded lines and that worked!

Summary / TL;DR:

:scroll: tokens file you tried to import

Not applicable

freemansoft commented 9 months ago

It looks like someone merged a PR for the const BorderRadius.zero

mark-nicepants commented 8 months ago

Sorry for the delay. I pushed a new update to pub.dev with these bugs all fixed.

JDDV commented 8 months ago

No worries! Keep up the good work!