device_preview 0.1.9-beta

flutter_device_preview (WIP) #


Preview of your app on various device screen configurations from one of your devices and save time when adapting your app visuals for various form factors.

Targeted features :

  • Preview any device from any device
  • Change Device orientation
  • Display a device frames
  • Change the device at any time but keep the application state
  • Take screenshots

Quickstart #

void main() => runApp(
    child: MyApp(),
class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
    return MaterialApp(
      builder: DevicePreview.appBuilder, // <--- Add the builder 
      title: 'Flutter Demo',
      theme: ThemeData(
      home: MyHomePage(title: 'Flutter Demo Home Page'),

Roadmap #

[ ] Android devices [ ] Desktop devices [ ] TV devices [ ] Local screenshot server [ ] Documentation [ ] Clean code

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  device_preview: ^0.1.9-beta

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:device_preview/device_preview.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Sep 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.2


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/src/menu.dart. (-0.50 points)

Analysis of lib/src/menu.dart reported 1 hint:

line 1 col 8: Unused import: 'dart:convert'.

Format lib/src/device_frame_preview.dart.

Run flutter format to format lib/src/device_frame_preview.dart.

Format lib/src/devices/android.dart.

Run flutter format to format lib/src/devices/android.dart.

Fix additional 4 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/devices/ios.dart (Run flutter format to format lib/src/devices/ios.dart.)
  • lib/src/freeform/resizer.dart (Run flutter format to format lib/src/freeform/resizer.dart.)
  • lib/src/screenshots/screenshot.dart (Run flutter format to format lib/src/screenshots/screenshot.dart.)
  • lib/src/screenshots/upload_service.dart (Run flutter format to format lib/src/screenshots/upload_service.dart.)

Maintenance issues and suggestions

Provide a file named (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and device_preview.dart. Packages with multiple examples should provide example/

For more information see the pub package layout conventions.

Package is pre-release. (-5 points)

Pre-release versions should be used with caution; their API can change in breaking ways.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
http ^0.12.0 0.12.0+2
meta ^1.1.6 1.1.7
Transitive dependencies
async 2.3.0
charcode 1.1.2
collection 1.14.11 1.14.12
http_parser 3.1.3
path 1.6.4
pedantic 1.8.0+1
sky_engine 0.0.99
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies