If you're not targeting web, this documentation will probably help you : https://docs.flutter.dev/cookbook/persistence/reading-writing-files
Basically you have to use the package path_provider with dart.io .
path_provider
dart.io