device_simulator 0.9.6 copy "device_simulator: ^0.9.6" to clipboard
device_simulator: ^0.9.6 copied to clipboard

DeviceSimulator allows you to easily test your Flutter app for different screen resolutions and platforms.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:device_simulator/device_simulator.dart';

// It's good practice to define a constant for enabling the device simulator
// so you can easily turn it on or off
const bool debugEnableDeviceSimulator = true;

void main() => runApp(MyApp());

// Insert Device simulator at the top of your widget, as a child of your
// App widget. Build the rest of your widget tree as you would normally do.
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'DeviceSimulator demo',
      home: DeviceSimulator(
        brightness: Brightness.dark,
        enable: debugEnableDeviceSimulator,
        child: Scaffold(
          appBar: AppBar(
            title: Text('DeviceSimulator Demo'),
          ),
          body: Center(
            child: Text('Hello multiple resolutions!'),
          ),
        ),
      ),
    );
  }
}
178
likes
40
pub points
56%
popularity

Publisher

unverified uploader

DeviceSimulator allows you to easily test your Flutter app for different screen resolutions and platforms.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

custom_navigator, flutter

More

Packages that depend on device_simulator