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

'Cookbook: Dart by Example' page issue #558

Closed
jerryisbusy opened this issue Feb 6, 2018 · 5 comments
Closed

'Cookbook: Dart by Example' page issue #558

jerryisbusy opened this issue Feb 6, 2018 · 5 comments
Assignees

Comments

@jerryisbusy
Copy link

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.

@kwalrath kwalrath self-assigned this Feb 6, 2018
@kwalrath
Copy link
Contributor

kwalrath commented Feb 6, 2018

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!

@kwalrath
Copy link
Contributor

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.

@kwalrath
Copy link
Contributor

/cc @filiph @chalin

@bcko
Copy link
Contributor

bcko commented May 24, 2018

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?

@kwalrath
Copy link
Contributor

kwalrath commented Jun 7, 2018

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.

@kwalrath kwalrath closed this as completed Jun 7, 2018
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

No branches or pull requests

3 participants