Skip to content

Instantly share code, notes, and snippets.

@kasperpeulen
Last active August 29, 2015 14:26
Show Gist options
  • Select an option

  • Save kasperpeulen/f3f162cef95b94967edd to your computer and use it in GitHub Desktop.

Select an option

Save kasperpeulen/f3f162cef95b94967edd to your computer and use it in GitHub Desktop.
Reading a file as a string.
hello world
import 'dart:io';
import 'dart:async';
Future main() async {
print(await new File('lib/file.txt').readAsString());
}
name: dart.io_File.readAsString
description: |
Reading a file as a string.
Use the File readAsString() method to read a file as a string.
homepage: https://gist.github.com/kasperpeulen/f3f162cef95b94967edd
environment:
sdk: '>=1.11.0 <2.0.0'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment