Health import
Generated reference for ovok_flutter: health import.
- Stable unknown
- Release candidate since 0.1.0-rc.6
- Development since 0.1.0-dev.32+1028d01
HealthImportAccessStatus
enum HealthImportAccessStatusHealth-source access state for one data type.
Values
HealthImportAccessStatus.authorized
static const HealthImportAccessStatus authorizedThe app can read this data type.
HealthImportAccessStatus.shouldRequest
static const HealthImportAccessStatus shouldRequestThe app can request access to this data type.
HealthImportAccessStatus.refused
static const HealthImportAccessStatus refusedThe user did not grant access to this data type.
HealthImportAccessStatus.unsupported
static const HealthImportAccessStatus unsupportedThe active health source does not provide this data type.
HealthImportAdapter
abstract interface class HealthImportAdapter<TType>Reads and requests access to one health data type.
Methods
HealthImportAdapter.getStatus
Future<HealthImportAccessStatus> getStatus(TType type)Returns the current access status of type.
| Parameter | Type | Kind | Default |
|---|---|---|---|
type | TType | positional |
Returns Future<HealthImportAccessStatus>.
HealthImportAdapter.request
Future<void> request(List<TType> types, {required bool background})Requests access to types, optionally including background reading.
| Parameter | Type | Kind | Default |
|---|---|---|---|
types | List<TType> | positional | |
background | bool | required named |
Returns Future<void>.
HealthImportController
class HealthImportController<TType> extends ChangeNotifierTracks health import access and requests permission when import is enabled.
Constructors
HealthImportController.new
HealthImportController<TType>({
required Iterable<TType> types,
required HealthImportAdapter<TType> adapter,
bool background = false,
})Creates a controller for types using adapter.
| Parameter | Type | Kind | Default |
|---|---|---|---|
types | Iterable<TType> | required named | |
adapter | HealthImportAdapter<TType> | required named | |
background | bool | named | false |
Properties
HealthImportController.types
final List<TType> typesData types managed by this controller.
HealthImportController.background
final bool backgroundWhether the health source should allow reading data in the background.
HealthImportController.enabled
bool get enabledWhether health import is switched on.
HealthImportController.statusByType
Map<TType, HealthImportAccessStatus> get statusByTypeAccess status for each type whose status was read successfully.
HealthImportController.notShared
List<TType> get notSharedData types that the user has not shared.
HealthImportController.error
Object? get errorError from the last status check or access request.
Methods
HealthImportController.refresh
Future<void> refresh()Refreshes access status for all configured types.
Returns Future<void>.
HealthImportController.setEnabled
Future<void> setEnabled(bool enabled)Requests access before switching import on; switches off without a request.
| Parameter | Type | Kind | Default |
|---|---|---|---|
enabled | bool | positional |
Returns Future<void>.
Last updated on