By default home_widget uses UserDefaults on iOS and SharedPreferences on Android to store data. In this section it is explained how to save and read data from the Flutter App as well as how to access data from your HomeScreen Widgets
In order to save Data call
HomeWidget.saveWidgetData<String>('id', data);Primitive values (strings, numbers, booleans, etc.) are stored directly in UserDefaults / SharedPreferences. For binary payloads (JSON files, images, or any bytes), write a file with saveFile or saveImage and use the same id with getWidgetData: the value will be the absolute path to the file on disk, which your widget can open natively.
To retrieve the current Data saved in the Widget call
HomeWidget.getWidgetData<String>('id', defaultValue: data);Check out the platform documentation of iOS and Android to see how to access this data in your widget.