autoshot library
Automated App Store / Play Store screenshot generation for device_preview.
This plugin iterates through a configurable matrix of screens × locales × devices, programmatically controlling DevicePreview to render each combination and capturing the output as PNG images. On Flutter Web the results are bundled into a ZIP archive and triggered as a browser download.
Quick start
import 'package:autoshot/autoshot.dart';
Autoshot(
config: AutoshotConfig(
screens: [
ScreenEntry.widget(name: 'home', builder: (_) => HomeScreen()),
ScreenEntry.widget(name: 'profile', builder: (_) => ProfileScreen()),
],
locales: [Locale('en', 'US'), Locale('fr', 'FR')],
devices: [Devices.ios.iPhone14Pro, Devices.android.samsungGalaxyS20],
),
builder: (context) => MyApp(),
)
Classes
- AccessibilitySection
- All the simulated accessibility settings.
- Autoshot
- A convenience widget that sets up DevicePreview with the autoshot screenshot automation already wired in.
- AutoshotApp
- A wrapper widget placed inside the DevicePreview.builder that allows the automation runner to swap the displayed content during the screenshot capture loop.
- AutoshotCapture
- A single captured screenshot with its metadata and pixel data.
- AutoshotConfig
- Configuration for the automated screenshot generation.
- AutoshotController
- Controls which widget is displayed inside AutoshotApp during the automated capture loop.
- AutoshotRunner
- The automation engine that iterates through the screens × locales × devices matrix, programmatically updating the DevicePreview state for each combination, waiting for the frame to settle, and capturing the rendered pixels.
- AutoshotToolbar
- A DevicePreview toolbar plugin that automates generating App Store / Play Store screenshots across a matrix of screens × locales × devices.
- CustomDeviceInfoData
- Info about a device and its frame.
- DeviceFrame
- Simulate a physical device and embedding a virtual screen into it.
- DeviceFrameStyle
-
The device frame style only allows to update the
keyboardStylefor now. - DeviceFrameTheme
- The theme gives a style to all its descentant device frames.
- DeviceIdentifier
- A unique identifier that represents a device.
- DeviceInfo
- Info about a device and its frame.
- DeviceKeyboardStyle
- The keyboard style allows to customize the virtual onscreen keyboard visuals.
- DevicePreview
- Simulates how the result of builder would render on different devices.
- DevicePreviewData
- A DevicePreview configuration snapshot that can be serialized to be persisted between sessions.
- DevicePreviewSettingsData
- Settings of device preview itself (tool bar position, background style).
- DevicePreviewState
- Represents the current state of the device preview.
- DevicePreviewStorage
- A storage for device preview user's preferences.
- DevicePreviewStore
- The store is a container for the current state of the device preview.
- Devices
- A list of common device specifications sorted by target platform.
- DeviceScreenshot
- A screenshot from a preview.
- DeviceSection
- All the simulated properties for the device.
- FileDevicePreviewStorage
-
A storage that saves device preview user preferences into
a single
fileas json content. - GenericDesktopMonitorFramePainter
- GenericLaptopFramePainter
- GenericPhoneFramePainter
- GenericTabletFramePainter
- NamedLocale
- A locale that has a display name.
- NoDevicePreviewStorage
- A storage that keep preferences only in memory : they are reset on each fresh start of the app.
- PreferencesDevicePreviewStorage
- Since share_preferences makes pub considering the package as not supported we should remove this functionnality from the web version to get the maximum score.
- ScreenEntry
- A single screen entry to be captured during the automation loop.
- SettingsSection
- All the settings for customizing the preview.
- SystemSection
- All the simulated system settings.
- ToolPanelSection
-
A
Sliverrepresenting a section in the DevicePreview menu. - VirtualKeyboard
- Display a simulated on screen keyboard at the bottom of a child widget.
Enums
- AutoshotDelivery
- The delivery mode for captured screenshots.
- DevicePreviewBackgroundThemeData
- DevicePreviewToolBarPositionData
- DevicePreviewToolBarThemeData
- DeviceType
- A device form factor.
Extensions
- DeviceInfoExtension on DeviceInfo
- DevicePreviewStateHelperExtensions on DevicePreviewStore
- A set of extension to triggers updates of the state.
Constants
-
defaultAvailableLocales
→ const List<
NamedLocale> - A set of many named locales.
Functions
-
basicLocaleListResolution(
List< Locale> ? preferredLocales, Iterable<Locale> supportedLocales) → Locale -
buildGenericDesktopMonitorDevice(
{required TargetPlatform platform, required String id, required String name, required Size screenSize, required Rect windowPosition, EdgeInsets safeAreas = EdgeInsets.zero, double pixelRatio = 2.0, EdgeInsets? rotatedSafeAreas, GenericDesktopMonitorFramePainter? framePainter}) → DeviceInfo -
Creates a generic desktop monitor device definition for the given
name, targetplatformandscreenSize. ThewindowPositiondefines the position of a virtual window with a window frame adapted for the given platform. -
buildGenericLaptopDevice(
{required TargetPlatform platform, required String id, required String name, required Size screenSize, required Rect windowPosition, EdgeInsets safeAreas = EdgeInsets.zero, double pixelRatio = 2.0, EdgeInsets? rotatedSafeAreas, GenericLaptopFramePainter? framePainter}) → DeviceInfo - Creates a generic laptop device definition.
-
buildGenericPhoneDevice(
{required TargetPlatform platform, required String id, required String name, required Size screenSize, EdgeInsets safeAreas = EdgeInsets.zero, EdgeInsets rotatedSafeAreas = EdgeInsets.zero, double pixelRatio = 2.0, GenericPhoneFramePainter framePainter = const GenericPhoneFramePainter()}) → DeviceInfo - Creates a generic phone device definition.
-
buildGenericTabletDevice(
{required TargetPlatform platform, required String id, required String name, required Size screenSize, EdgeInsets safeAreas = EdgeInsets.zero, EdgeInsets rotatedSafeAreas = EdgeInsets.zero, double pixelRatio = 2.0, GenericTabletFramePainter framePainter = const GenericTabletFramePainter()}) → DeviceInfo - Creates a generic tablet device definition.
Typedefs
-
AutoshotLocaleChangedCallback
= Future<
void> Function(BuildContext context, Locale locale) - Callback invoked when the autoshot runner switches to a new locale.
- Callback used to navigate to a target screen inside the real app shell.
-
ScreenPrepareCallback
= Future<
void> Function(BuildContext context) - Optional hook that runs after screen selection/navigation and before capture.