ElStorageService constructor
ElStorageService({})
单例工程构造方法,若要自定义本地存储文件夹,只需在 El.init 调用前构建此类即可, 例如:
void main() async {
ElStorageService(rootFolder: 'my_storage', storageName: 'my_storage');
await El.init();
runApp(MainApp());
}
Implementation
factory ElStorageService({
String rootFolder = 'flutter_element_data',
String storageName = 'el_storage',
}) {
_instance ??= ElStorageService._(
rootFolder: rootFolder,
storageName: storageName,
);
return _instance!;
}