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 web #197

Merged
merged 6 commits into from
Mar 4, 2024
Merged

support web #197

merged 6 commits into from
Mar 4, 2024

Conversation

melodysdreamj
Copy link
Contributor

Thanks a lot for contributing!

Provide a description of your changes below

The dart:io package is not supported on the web, and because of this, it is marked as not supported for web on pub.dev. Therefore, dart:io is conditionally used only in non-web environments, and in web environments, it is replaced with suitable alternative code.

Copy link
Owner

@Frezyx Frezyx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @melodysdreamj !
Thanks a lot for this contribution, but please fix review issues

Comment on lines 14 to 15
_output = output ??
(String message) => message.split('\n').forEach(stdout.writeln);
Copy link
Owner

@Frezyx Frezyx Mar 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only difference between logger_io and logger_web is in this line
Please make outout_io.dart and output_web.dart files with output(String message) method realizations

We can't make two almost identical files

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @Frezyx

As you mentioned, I've added only the changes to the two files and preserved most of the original code. The modified code runs well on both web and Android, but on Android, stdout.writeln did not work, so I changed it to print. Thank you.

Comment on lines 2 to 3

void outputLog(String message) => message.split('\n').forEach(print);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use stdout.writeln here
print method used in TalkerFlutter.init() method from talker_flutter lib

https://github.com/Frezyx/talker/blob/master/packages/talker_flutter/lib/src/extensions/talker_flutter.dart

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your kind guidance. As you suggested, I've changed "print" to "stdout.writeln". Thank you.

@Frezyx Frezyx merged commit e906512 into Frezyx:master Mar 4, 2024
1 check passed
@Frezyx
Copy link
Owner

Frezyx commented Mar 4, 2024

@melodysdreamj Thank you for this great contribution! ❤️
I will make new release version soon

@melodysdreamj
Copy link
Contributor Author

melodysdreamj commented Mar 4, 2024

@Frezyx Thank you for your kind help 🙏

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

Successfully merging this pull request may close these issues.

None yet

2 participants