AgeSignalsMockData class

Configuration for mock/test data used when useMockData is true.

Android only - Uses Google's official FakeAgeSignalsManager for testing. Apple does not provide testing utilities for DeclaredAgeRange API, so mock data is not supported on iOS.

Allows customizing the mock response from Dart without modifying native platform code. Useful for testing different scenarios and automated testing on Android.

Example (Android only):

await AgeRangeSignals.instance.initialize(
  useMockData: true,  // Ignored on iOS
  mockData: AgeSignalsMockData(
    status: AgeSignalsStatus.supervised,
    ageLower: 16,
    ageUpper: 17,
  ),
);

Constructors

AgeSignalsMockData({required AgeSignalsStatus status, int? ageLower, int? ageUpper, AgeDeclarationSource? source, String? installId, DateTime? mostRecentApprovalDate})
Creates mock data configuration.
const

Properties

ageLower int?
The mock lower bound of the user's age range.
final
ageUpper int?
The mock upper bound of the user's age range.
final
hashCode int
The hash code for this object.
no setteroverride
installId String?
Mock unique identifier for this app installation (Android only).
final
mostRecentApprovalDate DateTime?
Mock guardian approval date (Android only).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
source AgeDeclarationSource?
The mock source of the age declaration.
final
status AgeSignalsStatus
The mock verification status to return.
final

Methods

copyWith({AgeSignalsStatus? status, int? ageLower, int? ageUpper, AgeDeclarationSource? source, String? installId, DateTime? mostRecentApprovalDate}) AgeSignalsMockData
Creates a copy of this mock data with the given fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, dynamic>
Converts this mock data to a map for platform channel.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override