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

Changes to the Color API make current usage of Color.toString() broken #448

Open
M4dhav opened this issue Mar 26, 2025 · 1 comment
Open

Comments

@M4dhav
Copy link
Contributor

M4dhav commented Mar 26, 2025

🐛 Describe the bug

The recent changes to the Color API resulted in the Color.toString() method returning a String representing the object:

Color(alpha: 1.0000, red: 0.7961, green: 0.9490, blue: 0.3608, colorSpace: ColorSpace.sRGB)

But the way this is currently used in the code, it expects the method to return a Color Hex Code that can later be used to reform the Colors after fetching hexcodes from the database.
This has currently broken the entirety of the Stories and Chapters flow:

flutter (14324): #0      int._handleFormatError (dart:core-patch/integers_patch.dart:127:5)
E/flutter (14324): #1      int._parseRadix (dart:core-patch/integers_patch.dart:171:16)
E/flutter (14324): #2      int._parse (dart:core-patch/integers_patch.dart:94:18)
E/flutter (14324): #3      int.parse (dart:core-patch/integers_patch.dart:61:12)
E/flutter (14324): #4      ExploreStoryController.convertAppwriteDocListToStoryList.<anonymous closure> (package:resonate/controllers/explore_story_controller.dart:517:35)
E/flutter (14324): #8      new _GrowableList.of (dart:core-patch/growable_array.dart:150:28)
E/flutter (14324): #9      new List.of (dart:core-patch/array_patch.dart:39:18)
E/flutter (14324): #11     ExploreStoryController.convertAppwriteDocListToStoryList (package:resonate/controllers/explore_story_controller.dart:536:8)
E/flutter (14324): #12     ExploreStoryController.fetchUserCreatedStories (package:resonate/controllers/explore_story_controller.dart:390:15)
E/flutter (14324): #13     ExploreStoryController.createStory (package:resonate/controllers/explore_story_controller.dart:276:5)

I propose a simple fix by adding an Extension method to the color class that can handle this conversion of the Color to it's Hex Code

@M4dhav
Copy link
Contributor Author

M4dhav commented Mar 26, 2025

@Aarush-Acharya please assign this to me

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

1 participant