Frezyx / talker

☎️ Advanced error handler and logger for dart and flutter apps
https://pub.dev/packages/talker
MIT License
478 stars 57 forks source link

Fix UI colors #242

Open XanderD99 opened 2 months ago

XanderD99 commented 2 months ago

Thanks a lot for contributing!

Hey, I just found some more UI inconsistencies and tried fixing them all at once.

I removed the "TalkerScreenTheme" class and changed that option with the LogColors property. So now by default all colors for text and background and such just use the theme set by the user.

The LogCards still use the color that is found in the LogColors map. The border of the card uses the color as it is provided and the background is the log color with some opacity added to it. The makes it readable on any theme (at least the colors I tested).

I also changed the default state of the expanded logs to false, if you don't want this I can revert that. I changed that so that the main feed can contain more data and you can then only expand those you want to see more details about. To give errors some more info I set the message to the errorType if no message is given. Errors always show some minor information this way.

If users want to set some custom theme in the log screen they can still wrap it in a Theme widget. Perhaps if needed someone can make a "TalkerTheme" widget that can be used to wrap the talkerScreen?

codecov-commenter commented 1 month ago

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.78%. Comparing base (32fe34e) to head (acfdb3f). Report is 6 commits behind head on master.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #242 +/- ## ========================================== - Coverage 98.80% 98.78% -0.02% ========================================== Files 28 28 Lines 584 576 -8 ========================================== - Hits 577 569 -8 Misses 7 7 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Frezyx commented 3 weeks ago

Hello @XanderD99 ! I've already looked at how the updated log screen looks like

For my opinion it's looks very nice. But it's huge breaking change for develeopers who already used talker_flutter to create self logging packages or logs screen customization.

And now I'm thinking about how we can support old TalkerScreenTheme with Deprecated annotation and new UI

XanderD99 commented 3 weeks ago

I think the best way to have that backwards compability is to keep the TalkerScreenTheme (bring it back in this case) but indeed mark it depricated. Then when someone uses the TalkerScreenTheme in there project just wrap the whole TalkerScreen in a Theme that uses the colors set in TalkerScreenTheme.

That way the TalkerScreenTheme is removed from al the UI itself but is still available to the other developers until it is completely removed after some time.

Hirakota commented 2 weeks ago

It would be batter to change typedef LogColors from Map<TalkerLogType, Color> to Map<String, Color> it's will allow to create custom log types with custom colors

XanderD99 commented 2 weeks ago

hey @Frezyx I updated the code and added TalkerTheme back to TalkerScreen. I marked is as deprecated however, but when it is set it uses logColors from the talkerTheme and it wraps the TalkerView with a theme that should set background and card colors accordingly.

I haven't fully tested this yet so this should be verified.

The failed build is because of the marked deprecated item