Skip to content

mulieriq/flutter_device_preview

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

device_preview

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
  • Freeform device with adjustable resolution and safe areas
  • Dynamic system configuration : language, dark mode, text scaling factor
  • Display device frames
  • Keep the application state
  • Take screenshots

Quickstart

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

FAQ

Can I use device preview with Desktop embedding ?

Yes, you just have to add thoses dependencies in your pubspec.yaml :

device_preview:
path_provider_fde:
  git:
    url: https://github.com/google/flutter-desktop-embedding/
    path: plugins/flutter_plugins/path_provider_fde

Roadmap

[ ] Status bar [ ] Storage explorer [ ] Add custom devices state [ ] Desktop devices [ ] TV devices [ ] Documentation [ ] Clean code

About

Preview of your Flutter app on various device screen configurations from one of your devices.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 93.8%
  • Ruby 2.2%
  • Objective-C 2.1%
  • Java 1.4%
  • Shell 0.5%