device_preview_plus
2.9.9, released 3 weeks ago by an unverified publisher
Simulates how a Flutter app looks and behaves on various devices and configurations.
What it does
Provides a widget that wraps your app to emulate different screen sizes, orientations, locales, and system settings. It keeps the app state and offers plugin hooks for screenshots and file exploration.
AI-written summary of version 2.9.9, based on the package's README and metadata. Report an inaccuracy
Use it when
- Testing UI on multiple device form factors without physical devices
- Demonstrating app appearance to stakeholders during development
Skip it when
- Need precise performance metrics from real hardware
- Testing platform-specific native features
Strengths
- Fast visual feedback across many device profiles
- Keeps app state while switching devices
- Extensible via plugins
Weaknesses
- Cannot replace testing on actual devices for performance or native behavior
- Limited to UI simulation, not full device capabilities
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- Yes (build_runner)
- Direct dependencies
- 8
import 'package:device_preview_plus/device_preview_plus.dart';
void main() => runApp(
DevicePreview(
enabled: !kReleaseMode,
builder: (context) => MyApp(),
),
);
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
useInheritedMediaQuery: true,
locale: DevicePreview.locale(context),
builder: DevicePreview.appBuilder,
home: const Scaffold(body: Center(child: Text('Hello'))),
);
}
}
Alternatives
Packages that do the same job and could replace device_preview_plus.
- platform_device_id
Get unique device IDs across Android, iOS, Windows, Linux, macOS, and Web.
50Compare - device_orientation
Check absolute device orientation via accelerometer and keep widgets pointing down.
49Compare - app_launcher
Launches an installed Android app by its package ID, falling back to Google Play if missing.
46Compare - platform_device_id_plus
Get a unique device identifier across Android, iOS, Windows, macOS, Linux, and Web.
41Compare
Works with
Packages commonly used together with device_preview_plus: ones it builds on, ones built on it, and its own family.
- webdevice_preview_plus depends on itLightweight bindings for browser APIs via JS interop
- json_annotationdevice_preview_plus depends on itProvides annotations for json_serializable to generate JSON (de)serialization code.
- shared_preferencesdevice_preview_plus depends on itFlutter plugin for reading and writing simple key-value pairs. Wraps NSUserDefaults on iOS and SharedPreferences on Android.
- freezed_annotationdevice_preview_plus depends on itAnnotations for the freezed code-generator.
- providerdevice_preview_plus depends on itA lightweight wrapper around InheritedWidget for state management
- device_frame_plusdevice_preview_plus depends on itMockups and frames for common devices to preview and test Flutter apps.