For example, I am writing the unit test case for the following method, where I am reading the userId from the SecuredStorageutil.
checkIfUserIdExsits(BuildContext context) async {
dynamic userId = await SecuredStorageUtil.instance.readSecureData(constants.preferenceUserId);
}
After running the test case for this, I am getting MissingPluginException for Flutter secured storage.
Unit test case, I have written:
test('if userId exists', () async {
/// set user Id as not null
await SecuredStorageUtil.instance
.writeSecureData(constants.preferenceUserId, "userId");
await viewModel.checkIfUserIdExsits(buildContext);
});
After running the above test case I am getting MissingPluginException for Flutter secured storage.
I am getting the same for other packages like location and permission_handler.