getStateLocation method Null safety

  1. @override
Folder? getStateLocation(
  1. String pluginId

Return the folder in which the plugin with the given pluginId can store state that will persist across sessions. The folder returned for a given id will not be returned for a different id, ensuring that plugins do not need to be concerned with file name collisions with other plugins, assuming that the plugin ids are unique. The plugin ids must be valid folder names.


Folder? getStateLocation(String pluginId) {
  if (_stateLocation != null) {
    io.Directory directory = io.Directory(join(_stateLocation!, pluginId));
    directory.createSync(recursive: true);
    return _PhysicalFolder(directory);
  return null;