Infrastructure SDKs
utilities_sdk Free
- Tier
- Freeversion 4.1.8
- Command
archipelago generate utilities_sdk- Generates
shared/utilities/device_info/device_info_api(if selected)shared/utilities/device_info/device_info_impl(if selected)shared/utilities/package_info/package_info_api(if selected)shared/utilities/package_info/package_info_impl(if selected)
- Generates first
- test_prereq, package_info_providerwhen needed and missing, so there is nothing to install first
Device info (pre-resolved sync getters) and package info (
installerSource,buildSignature) with an API/Impl split. Biometric handling has moved toauth_sdk— this brick has no biometric variable or templates.
What it is
Two independent, individually-toggleable utility SDKs generated under utilities/ (or shared/utilities/ in a monorepo): device_info (platform + device snapshot) and package_info (app version/build metadata, installer source, build signature). Most projects generate both once, early, alongside flutter_modular_monorepo.
Variables
| Variable | Type | Default | Description |
|---|---|---|---|
| appName | string | MyApp | Application name |
| organization | string | MyCompany | Your organization or company name |
| domain | string | com | Your organization's top-level domain |
| prefix | string | (none — required prompt) | Unique prefix for component naming |
| includeDeviceInfo | boolean | true | Include device information utilities |
| includePackageInfo | boolean | true | Include package information utilities |
| isForMonorepo | boolean | true | Whether this will be part of a monorepo structure |
| includeGenerated | boolean | false | Whether to include generated files in version control |
There is no includeBiometric variable — an earlier version of this page documented one, but it does not exist in brick.yaml. Biometric authentication now ships as the separate biometric_auth_sdk brick.
Prerequisites
hooks/pre_gen.dart runs ArchipelagoConfigGuard.requireExists() and exits with an error if the project has no archipelago.yaml yet — generate flutter_modular_monorepo (or another brick that creates it) first. With includePackageInfo: true, pre_gen also self-generates package_info_provider via SubBrickGenerator if infrastructure/package_info_provider is missing, since package_info_impl relies on that brick's single global PackageInfo registration.
Usage
Interactive
archipelago generate utilities_sdkNon-interactive (CI)
archipelago generate utilities_sdk --config my_config.jsonGenerated Structure
Each utility is a separate API/Impl pair under utilities/ — or shared/utilities/ when isForMonorepo is true.
When includeDeviceInfo is true:
utilities/
└── device_info/
├── device_info_api/
│ ├── lib/
│ │ ├── device_info_api.dart
│ │ └── src/
│ │ ├── device_info.dart # DeviceInfo model
│ │ ├── device_info_service.dart # DeviceInfoService contract
│ │ └── device_platform.dart # DevicePlatform enum
│ └── pubspec.yaml
└── device_info_impl/
├── lib/
│ ├── device_info_impl.dart
│ └── src/
│ ├── di/
│ │ ├── injector.dart
│ │ └── register_module.dart
│ └── utils/
│ └── device_info_impl.dart # DeviceInfoImpl
├── build.yaml
└── pubspec.yamlWhen includePackageInfo is true:
utilities/
└── package_info/
├── package_info_api/
│ ├── lib/
│ │ ├── package_info_api.dart
│ │ └── src/
│ │ ├── installer_source.dart # InstallerSource enum
│ │ └── package_info_util.dart # PackageInfoUtil contract
│ └── pubspec.yaml
└── package_info_impl/
├── lib/
│ ├── package_info_impl.dart
│ └── src/
│ ├── di/
│ │ └── injector.dart
│ └── utils/
│ └── package_info_impl.dart # PackageInfoImpl
├── build.yaml
└── pubspec.yamlPublic API
Device info
abstract interface class DeviceInfoService {
DeviceInfo get info; // synchronous — resolved once at boot via @preResolve
}DeviceInfo carries platform (DevicePlatform: ios/android/web/macOS/windows/linux/fuchsia/unknown), osVersion, androidSdkInt, manufacturer, model, modelName, deviceId, isPhysicalDevice, isLowRamDevice. DeviceInfoImpl builds it once from device_info_plus's BaseDeviceInfo, pre-resolved via @preResolve in RegisterModule.baseDeviceInfo. There is deliberately no advertising-ID API (removed in 4.0.0): a real one needs its own consent/ATT flow and platform permissions, so use a dedicated ads-attribution SDK (for example AppsFlyer via analytics_sdk) instead.
Package info
abstract class PackageInfoUtil {
String get version;
String get buildNumber;
String get appName;
String get packageName;
InstallerSource get installerSource; // appStore / playStore / amazonStore / sideloaded / unknown
String get buildSignature; // APK signing cert (Android) / provisioning profile id (iOS) / '' otherwise
}PackageInfoImpl takes the PackageInfo registered by package_info_provider (it no longer registers its own) and maps installerStore to InstallerSource (com.android.vending → playStore, com.amazon.venezia → amazonStore, com.apple.appstore/appstore → appStore, empty/null → unknown, anything else → sideloaded).
Wiring
hooks/post_gen.dart (skipped when isForMonorepo is false) registers each generated package pair into the melos workspace, adds the device_info_impl/package_info_impl path dependencies to the host app, and registers DeviceInfoImplPackageModule / PackageInfoImplPackageModule in the app's injector.dart. Both packages declare these modules in their archipelago: di_modules manifest so generate host-registry keeps them. It then appends utilities_sdk to archipelago.yaml's installed-bricks list via ArchipelagoConfigHelper.
Dependencies
device_info_plus (^13.2.0), package_info_plus (^10.2.1), injectable/get_it. package_info_impl depends at runtime on the package_info_provider brick (self-generated).
Limitations
- No advertising ID:
DeviceInfoService.advertisingId()was removed in 4.0.0 (it was a stub that always returnednull). - Generating
utilities_sdkwithincludePackageInfo: truenext tofeedback_sdkorrating_review_sdkis safe: all of them share the singlePackageInforegistration frompackage_info_provider. - There is nothing biometric in this brick; see
biometric_auth_sdk.
Testing
device_info_impl does platform I/O while the injector initialises (@preResolve on DeviceInfoPlugin). It declares a DeviceInfoTestPrerequisite in lib/testing.dart, which swaps in a fake DeviceInfoPlatform. The generated injector_test installs it for you. The fake serves macOS and Linux hosts. See test prerequisites.
Changelog
Run archipelago brick info utilities_sdk to see the latest published version. Enterprise customers can read the full CHANGELOG.md in the brick source repository.