device_preview 0.1.9-beta

flutter_device_preview (WIP) #

gif

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(
  DevicePreview(
    child: MyApp(),
  ),
);
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      builder: DevicePreview.appBuilder, // <--- Add the builder 
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      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:


dependencies:
  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';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
58
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
55
Overall:
Weighted score of the above. [more]
70
Learn more about scoring.

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

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.3

Platforms

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 CHANGELOG.md. (-20 points)

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

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (meta).

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/README.md.

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.

Dependencies

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.6 1.1.7
Transitive dependencies
async 2.3.0
charcode 1.1.2
collection 1.14.11
http_parser 3.1.3
path 1.6.2
pedantic 1.8.0+1
sky_engine 0.0.99
source_span 1.5.5
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test

Admin