device_frame
1.4.0, released a year ago by aloisdeniel.com
Provides mock device frames to preview Flutter UI on various device screens.
What it does
The package renders a visual frame that mimics real phones, tablets, and desktops around any widget. It also offers a virtual keyboard and media‑query/theme inheritance to simulate device conditions.
AI-written summary of version 1.4.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- Testing UI on multiple device sizes without real hardware
- Demonstrating app screenshots for marketing or documentation
- Developing responsive layouts with accurate safe‑area insets
Skip it when
- Running in production builds where the frame adds unnecessary UI overhead
- Needing high‑performance rendering for animations
Strengths
- Large library of pre‑defined devices
- Simple API – just wrap your widget in DeviceFrame
- Supports virtual keyboard and custom generic devices
Weaknesses
- Only for preview – not meant for release builds
- Adds extra widget layer which may affect performance in debug
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- Yes (build_runner)
- Direct dependencies
- 1
DeviceFrame(
device: Devices.ios.iPhone11,
isFrameVisible: true,
orientation: Orientation.portrait,
screen: Container(
color: Colors.blue,
child: const Text('Hello'),
),
);Alternatives
Packages that do the same job and could replace device_frame.
- home_widget
Plugin to send data to native home screen widgets on Android and iOS
88Compare - forui_hooks
Provides Flutter Hooks wrappers for Forui widget controllers.
77Compare - inspireui
A collection of e‑commerce widgets and utilities for Flutter apps.
76Compare - eva_icons_flutter
Flutter package that provides Eva Icons as IconData for easy use in apps.
70Compare
Works with
Packages commonly used together with device_frame: ones it builds on, ones built on it, and its own family.
- freezed_annotationdevice_frame depends on itAnnotations for the freezed code-generator.
- device_previewSame familyA custom WidgetsBinding that simulates device characteristics (screen metrics, safe areas, locale, brightness, text scale, accessibility flags, target platform) at the engine-abstraction level. No in-app UI — driven programmatically and by a DevTools extension.
- storybook_flutterBuilt on device_frameA storybook for Flutter widgets to showcase and preview isolated components.
- dashbookBuilt on device_frameDashbook is a Flutter UI development tool for creating isolated widget stories and showcases.