Reading and Writing Data and Files with Path Provider using Dart's Flutter Framework

What Will I Learn?

  • You will learn how to use the path provider plugin in a flutter application
  • You will learn how to use a future builder widget
  • You will learn how to use the require meta keyword
  • You will learn how to read and write data into a small file store on android or iOS

Requirements

Difficulty

  • Intermediate

Description

In this flutter video tutorial, we take a look at Google's path provider plugin. We also look at future builder widgets as well as asynchronous snapshots and we talk about how we can read and write data into files using flutter. We touch briefly on some of the meta programming keywords that are a part of the flutter framework, such as the @required keyword.

Path provider gives us a platform agnostic method for accessing common file system locations on the devices that we are targeting. This includes the temporary folders, the documents folders and the external documents directories. This is useful because it makes it easier to create file caches and databases for our applications which will work properly on many different platforms without issue.

Future builders are widgets that let us change the look and feel of a widget based on the state of a future value. Future values are asynchronous which makes it important for us to have a method to check their state to defer the creation of a widget in our tree. We are able to use the asyncsnapshot type to check the current state of our future and then resolve the widget based on that state.

The source code for this project can be found here

Video Tutorial

Curriculum



Posted on Utopian.io - Rewarding Open Source Contributors

H2
H3
H4
3 columns
2 columns
1 column
6 Comments