device_preview를 확장하여 미리보기 환경에서 직접 스크린샷 캡처를 가능하게 하는 Flutter 플러그인입니다. 개발자들은 다양한 기기와 화면 크기에서 앱의 UI를 실제 모습 그대로 빠르게 스크린샷으로 캡처할 수 있어, 시각적 테스트 및 문서화가 용이합니다. 이 플러그인은 device_preview 패키지와 원활하게 통합되며, Android, iOS, macOS, Windows, Linux 등 여러 플랫폼을 지원합니다. 물리적 디바이스에 배포하지 않고도 효율적인 UI 검증이 필요한 팀에게 이상적입니다.
사용 사례
시각적 회귀 테스트
UI 문서
빠른 디자인 검증
크로스 플랫폼 UI 확인
개발 워크플로우 개선
주요 기능
device_preview와의 원활한 통합
크로스 플랫폼 지원
한 번의 탭으로 스크린샷 캡처
여러 장치 에뮬레이션을 지원합니다
실시간 미리보기 스냅샷
적합한 대상
Flutter 개발자
UI/UX 디자이너
QA 테스터
크로스 플랫폼 앱 팀
빠른 프로토타이핑 워크플로우
고려 사항
device_preview가 설치되어 있어야 합니다
미리보기 모드만 가능
자동 배치 스크린샷 기능 없음
스크린샷은 기본적으로 저장되지 않습니다
플랫폼별 렌더링 차이가 출력에 영향을 줄 수 있습니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
Simulate any device — screen, safe areas, locale, accessibility — with full framework fidelity.
You build on one screen; your users arrive on hundreds. Device Preview switches your running app to another device — an old 320pt phone, a tablet in landscape, a notched display, a half-width desktop window — instantly, with no rebuild and no simulator.
Screen size, pixel ratio, safe areas, orientation, folds, the software keyboard, locales, brightness, text scale, accessibility settings and target platform all change with it, and your app reads them through the same MediaQuery it always used. So the problems that normally surface in front of a customer — a clipped headline, a button under the home indicator, an overflow at 200% text — surface in front of you instead.
Control it from Flutter DevTools, from Dart, or from your tests.
Quickstart
dependencies:device_preview:<latestversion>
voidmain() {
DevicePreview.enable();
runApp(constMyApp()); // runs as usual — now simulatable
}
That's the whole integration. Open DevTools, select the device_preview tab, and pick a device.
enable() is safe to call unconditionally: simulation is active in debug and profile builds and completely off in release, so nothing ships to your users. Pass a value to decide yourself — DevicePreview.enable(enabled: kDebugMode) for debug only, DevicePreview.enable(enabled: false) to turn it off.
Programmatic control:
import'package:device_preview/presets.dart';
final c = DevicePreview.controller;
await c.applyPreset(DevicePresets.iPhone16Pro);
await c.setOrientation(Orientation.landscape);
await c.update((s) => s.copyWith(textScaleFactor: 2.0, platformBrightness: Brightness.dark));
await c.reset();
DevicePreview.controller throws when simulation is off (every release build); use DevicePreview.maybeController?.… from code that ships.
See device_preview/README.md for the full package documentation, including widget-test support via DevicePreviewBindingMixin.
The device catalog: one JSON per device — metrics, screen outline and body artwork. Generated into both the extension catalog and the package's built-in DevicePresets; see its README to add a device.
Legacy device frame drawings package from the 2.x era. Nothing in the 3.0 release depends on it — 3.0 renders frames from the device_specs artwork, carried by the built-in presets and pushed over the DevTools protocol.
The website, including its interactive demo — docs/demo is the counter example built for the web, docs/device_catalog.json the catalog its HTML panel pushes to it. Rebuild both with tool/build_demo.sh.