Instance member ‘initSharedPreferences’ can’t be accessed using static access.dartstatic_access_to_instance_member
class SharedPrefHelper {
SharedPreferences? sharedPref;
Future<void> initSharedPreferences() async {
print("Running get instance");
sharedPref = await SharedPreferences.getInstance();
}
}
when I tried to access this methos got an above error,
How to fix it?