plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

[Request] device_info_plus has no setMockInitialValues

Open lucavenir opened this issue 3 years ago • 0 comments

Plugin

device_info_plus

Use case

Hi. I need to test DeviceInfoPlugin.deviceInfo() and I need a qucik and easy way to mock its values.

I use PackageInfo and SharedPreferences; there, I am used to just call .setMockInitialValues. This API is very handy when testing.

But DeviceInfoPlugin doesn't have this API. Why?

Workarounds

When testing, I am injecting a BaseDeviceInfo with @riverpod 's .overrideWith methods.

Proposal

Let DeviceInfo.setMockInitialValues be a thing.

lucavenir avatar Dec 08 '22 10:12 lucavenir