Search packages, repositories and app categories

flutter_device_emulator cover
Package detailsv0.0.3

flutter_device_emulator

Preview your Flutter widgets across multiple device screens in real-time.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
45
Likes
0
Pub points
150

Install package

flutter pub add flutter_device_emulator

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Flutter Device Emulator is a tool that allows developers to preview their Flutter widgets across various device screen sizes and orientations in real-time. It supports multiple platforms including Android, iOS, Web, macOS, Windows, and Linux, enabling consistent UI testing without needing physical devices. The package integrates seamlessly into the development workflow, offering instant visual feedback during design iterations. It's particularly useful for ensuring responsive layouts and cross-platform compatibility.

Use cases

  • Real-time widget preview
  • Cross-platform UI testing
  • Responsive design validation
  • Rapid prototyping
  • Design consistency checks
  • Screen size simulation

Key features

  • Real-time device preview
  • Multiple device templates
  • Support for all major platforms
  • Live layout updates
  • Easy integration with Flutter
  • Orientation switching

Suitable for

  • UI/UX designers
  • Flutter developers
  • Cross-platform app testers
  • Prototyping teams
  • Frontend engineers

Considerations

  • Requires manual setup for some features
  • Limited to visual preview (no runtime interaction)
  • May impact performance on low-end machines
  • Not a replacement for physical device testing
  • No built-in theme or locale simulation

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

flutter_device_emulator

Pub Version License: MIT

A Flutter package to emulate different device screens and layouts, making it easier to preview and test your app on various device types and resolutions directly within your Flutter app or development environment.

flutter_device_emulator demo

Features

  • Emulate multiple device screen sizes and resolutions
  • Switch between device types (phone, tablet, etc.)
  • Preview your app in different orientations
  • Easy integration with your existing Flutter project
  • Customizable device frames and backgrounds

Installation

Add the following to your pubspec.yaml:

dependencies:
  flutter_device_emulator: latest_version

Then run:

flutter pub get

Usage

Import the package and wrap your app or widget with the emulator:

import 'package:flutter_device_emulator/flutter_device_emulator.dart';

DeviceEmulator(
  builder: (context) => SafeArea(child: HomePage()),
)
Example

See the example/ directory for a complete sample app demonstrating usage and available features.

API Reference

DeviceEmulator

The main widget to wrap your app for device emulation. Provides controls for device type, orientation, theme, and text direction.

Constructor:

DeviceEmulator({
  required WidgetBuilder builder,
  bool enableThemeToggle = true,
  bool enableOrientationToggle = true,
  bool enableLanguageToggle = true,
  Key? key,
})

Parameters:

  • builder (required): A function that builds the widget tree to be emulated inside the device frame.
  • enableThemeToggle (default: true): If true, shows a button to toggle between light and dark themes.
  • enableOrientationToggle (default: true): If true, shows a button to toggle between portrait and landscape orientations.
  • enableLanguageToggle (default: true): If true, shows a button to toggle between left-to-right and right-to-left text directions.
  • key: Optional widget key.

Features:

  • Device selector: Choose from a list of common devices to emulate.
  • Theme toggle: Switch between light and dark modes.
  • Orientation toggle: Switch between portrait and landscape.
  • Text direction toggle: Switch between LTR and RTL layouts.
  • Screenshot: Capture the current emulated screen (web only).

Example:

DeviceEmulator(
  builder: (context) => SafeArea(child: HomePage()),
)

For detailed API documentation, see the source code in lib/.

Contributing

Contributions are welcome! Please open issues or submit pull requests for bug fixes, features, or improvements.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -am 'Add new feature')
  4. Push to the branch (git push origin feature/my-feature)
  5. Open a pull request

License

This project is licensed under the MIT License.

Categories

Dependencies

Dependency list 3 items

Source repository

Projects using this package

No data available yet.