In this video, Emmanuel Henri demonstrates how to persist data to disk by saving the counter to local disk.
- [Instructor] Okay so in the last video,…we started writing the code to actually write to a file.…So we had those block of codes here…that actually will use the CounterStorage…which will allow us to create a file in the path…and then use that path to actually write and read from it.…Now we need to do some updating onto our state…to make sure that we have a counter…that reflects all this and then when we actually write…to it, we actually use the functions that we created here.…So let's go ahead and use that,…and start changing the code.…
So go inside of the class MyHomePage extends StatefulWidget.…What we're gonna do is also move…the final String title; to the top.…I like to have my strings together,…so we're gonna do this guy here,…and let's indent him to be sure,…and then we're going to create a new value…which is called CounterStorage storage.…And then make sure that we pass this in MyHomePage here…so we have this title that we have created,…we passed this title.…
Now we need to pass,…and this is required otherwise the application…
- Programming with Dart
- Setting up the Flutter SDK
- Setting up app simulators
- Using Flutter for iOS
- Using Flutter for Android
- Using widgets and material components
- Adding interactivity, routing, and navigation
- Reading and writing with Dart IO
- Creating HTTP requests
Skill Level Beginner
Android App Development: Data Persistence Librarieswith Annyce Davis4h 52m Intermediate
1. Introduction and Setup
2. UI Building
3. Use Device and SDK APIs
4. Build and Release
Resources to release to iOS1m 54s
Next steps1m 5s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.