-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
support web #197
Conversation
There was a problem hiding this 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
_output = output ?? | ||
(String message) => message.split('\n').forEach(stdout.writeln); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
|
||
void outputLog(String message) => message.split('\n').forEach(print); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
@melodysdreamj Thank you for this great contribution! ❤️ |
@Frezyx Thank you for your kind help 🙏 |
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.