Skip to content
pubscout

device_sim

0.1.3, released 2 years ago by an unverified publisher

A device simulator widget to speed up development for different devices on desktop and web.

$ flutter pub add device_sim
Source repository

What it does

It approximates how an app looks and behaves on various physical devices by simulating screen size, frames, notches, orientation, and safe areas inside desktop or web apps. It also includes a calibration screen to find correct values for custom devices.

AI-written summary of version 0.1.3, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are developing a Flutter web or desktop app and want to preview mobile device layouts without changing windows.
  • You need to test how your app handles notches, home indicators, keyboard insets, and safe areas.

Skip it when

  • You are building mobile-only apps where you can readily use standard physical emulators or simulators.
  • You are not targeting web or desktop platforms for your development workflow.

Strengths

  • Provides simulated frames, resolutions, orientations, and keyboard insets.
  • Supports custom device configurations and includes a calibration screen.

Weaknesses

  • Requires the app to run as a desktop or web app to function as a simulator.
  • Not documented to work on mobile targets.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1

Wrap your root app with the DeviceSim widget, set useInheritedMediaQuery: true in your MaterialApp, and run the app on desktop or web.

DeviceSim(
  builder: (context) => MaterialApp(
    useInheritedMediaQuery: true,
    home: MyHomePage(),
  ),
)

Alternatives

Packages that do the same job and could replace device_sim.

Works with

Packages commonly used together with device_sim: ones it builds on, ones built on it, and its own family.