-
Notifications
You must be signed in to change notification settings - Fork 700
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
'Cookbook: Dart by Example' page issue #558
Comments
You are exactly right. I'm sure this code worked years ago when it was written, but it doesn't work now. I'm going to file a bug about the larger issue of maintaining and testing the cookbook code. Thanks very much, @jerryisbusy, for bringing this to our attention! |
Another issue on this page: It says that the dart:io library "is used solely for command-line applications running on a stand-alone Dart VM". But you can use it with Flutter, too. |
I try to reach https://www.dartlang.org/dart-vm/dart-by-example but I get redirected to https://www.dartlang.org/samples Does Cookbook: Dart by Example still exist? |
No, we've retired the cookbook, though the samples repo still exists (as you discovered) at https://github.com/dart-lang/dart-samples. I'm going to close this issue. It looks like we have an open issue (very old :( ) for this at dart-archive/dart-samples#73. |
From URL: https://www.dartlang.org/dart-vm/dart-by-example
The example 'Read file as bytes' may should not import 'crypto' library ?
It should be 'cryptoutils' library i think.
`import 'dart:io';
import 'package:crypto/crypto.dart';
main() async {
var bytes = await new File('file.txt').readAsBytes();
// Do something with the bytes. For example, convert to base64.
String base64 = CryptoUtils.bytesToBase64(bytes);
print(base64);
}`
NoSuchMethodException occured while call 'CryptoUtils.bytesToBase64(bytes)'.
import 'package:cryptoutils/cryptoutils.dart' do fix it.
The text was updated successfully, but these errors were encountered: