Saving Data in Flutter

Jan 31 2024 · Dart 3, Flutter 3.10, Visual Studio Code

Part 3: Reading & Writing Files

12. Creating the File List Screen (Part 1)

Episode complete

Play next episode

Next
About this episode
Leave a rating/review
See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 11. Storing a Text File Next episode: 13. Creating the File List Screen (Part 2)

Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it's simply the best investment you can make in your development career.

Learn more Already a subscriber? Sign in.

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

As we can have multiple recipes in our app, in order to deal with the files in our app we need two screens: one that shows the list of all the available files, and one that reads the content of a single file.

  String _listName = ''; 
  bool _showSize = false; 
  bool _showDate = false; 
final prefs = await SPHelper.getInstance(); 
_listName = prefs.getListName(); 
_showSize = prefs.getShowFileSize(); 
_showDate = prefs.getShowDate(); 
setState(() {}); 
  @override 
  void initState() { 
    super.initState(); 
    getSettings(); 
  } 
  Future<List<FileSystemEntity>> _getFiles() async { 
    final directory = await getApplicationDocumentsDirectory(); 
    return directory.listSync().whereType<File>().toList(); 
  }