[GH-ISSUE #2220] [Bug] Replace use of Color.fromARGB #909

Closed
opened 2026-03-23 20:42:56 +00:00 by mirror · 3 comments
Owner

Originally created by @AmanNegi on GitHub (Apr 9, 2023).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/2220

Originally assigned to: @AmanNegi on GitHub.

Bug Description

NOTE: This does not affect the working of application. Only helps in Code Quality.

In flowy_infra under dandelion theme, we are using the following format to define a color:

const Color(ColorCode);

However, in two places we are using the following the following format:

const Color.fromARGB(Values);

It would be nice if we follow the same approach throughout the file.

How to Reproduce

Checkout the dandelion.dart at line 54 and 103, you can find the format I specified. As I told this is the only place it is done in the complete flowy_infra package, so it would be better to replace it with what we are using elsewhere.

Expected Behavior

Provides a same format to define a color throughout the package flowy_infra. Only helps in code quality no application value provided.

Operating System

Ubuntu 20.04.5 LTS

AppFlowy Version(s)

0.1.2

Screenshots

Screenshot from 2023-04-09 08-23-17

Notice the main2 field here.

Additional Context

No response

Originally created by @AmanNegi on GitHub (Apr 9, 2023). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/2220 Originally assigned to: @AmanNegi on GitHub. ### Bug Description > NOTE: This does not affect the working of application. Only helps in Code Quality. In `flowy_infra` under dandelion theme, we are using the following format to define a color: ``` dart const Color(ColorCode); ``` However, in two places we are using the following the following format: ``` dart const Color.fromARGB(Values); ``` It would be nice if we follow the same approach throughout the file. ### How to Reproduce Checkout the `dandelion.dart` at line 54 and 103, you can find the format I specified. As I told this is the only place it is done in the complete `flowy_infra` package, so it would be better to replace it with what we are using elsewhere. ### Expected Behavior Provides a same format to define a color throughout the package `flowy_infra`. Only helps in code quality no application value provided. ### Operating System Ubuntu 20.04.5 LTS ### AppFlowy Version(s) 0.1.2 ### Screenshots ![Screenshot from 2023-04-09 08-23-17](https://user-images.githubusercontent.com/37607224/230751666-f769e09c-a35c-4ce9-8459-cb797841e13b.png) Notice the `main2` field here. ### Additional Context _No response_
mirror 2026-03-23 20:42:56 +00:00
Author
Owner

@AmanNegi commented on GitHub (Apr 9, 2023):

I would love to work on this as well 😸

<!-- gh-comment-id:1501026036 --> @AmanNegi commented on GitHub (Apr 9, 2023): I would love to work on this as well :smile_cat:
Author
Owner

@AmanNegi commented on GitHub (Apr 9, 2023):

Would It be fine If I fixed it throughout the app? Like we have 2-3 more occurrences outside of the flowy_infra package.

<!-- gh-comment-id:1501026860 --> @AmanNegi commented on GitHub (Apr 9, 2023): Would It be fine If I fixed it throughout the app? Like we have 2-3 more occurrences outside of the `flowy_infra` package.
Author
Owner

@AmanNegi commented on GitHub (Apr 9, 2023):

Also in board_page.dart it makes no sense to use the extension HexColor.fromHex:

  final config = AppFlowyBoardConfig(
    groupBackgroundColor: HexColor.fromHex('#F7F8FC'),
  );

We can simply use Color(0xFFF7F8FC);

<!-- gh-comment-id:1501027645 --> @AmanNegi commented on GitHub (Apr 9, 2023): Also in `board_page.dart` it makes no sense to use the extension `HexColor.fromHex`: ``` dart final config = AppFlowyBoardConfig( groupBackgroundColor: HexColor.fromHex('#F7F8FC'), ); ``` We can simply use `Color(0xFFF7F8FC);`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#909
No description provided.