56- Flutter Storage - Read and Write files

56- Flutter Storage - Read and Write files

Code2Start - Mohamed Fathy Taha

4 года назад

2,894 Просмотров

In some cases, you need to read and write files to disk. For example, you may need to persist data across app launches, or download data from the internet and save it for later offline use.

To save files to disk, combine the path_provider plugin with the dart:io library.

This recipe uses the following steps:

Find the correct local path.
Create a reference to the file location.
Write data to the file.
Read data from the file.

Тэги:

#SharedPreferences #flutter_course #flutter_advanced_course #flutter_save_data_on_disk #flutter_storage #local_storage #offline_database #flutter_offline #flutter_sqlite_database #flutter_sqlite #local_sqlite #async #await #persistence #userdefaults #value #path_provider #t_getCacheDir() #NSCachesDirectory #getCacheDir() #NSDocumentDirectory #AppData #getApplicationDocumentsDirectory #Create_a_reference_to_the_file_location #File #Read_data_from_the_file #readAsString()
Ссылки и html тэги не поддерживаются


Комментарии: