web_preview 0.0.3 copy "web_preview: ^0.0.3" to clipboard
web_preview: ^0.0.3 copied to clipboard

Easily create a web view for your app

Web Preview #

Easily create a web preview for your app

screenshot

Installation #

Add web_preview as a dependency in your pubspec.yaml file:

dependencies:
  web_preview: ^0.0.3

Then, run flutter pub get to install the package.

Usage #

To use WebPreview, you must wrap your application widget with the WebPreview widget:

import 'package:web_preview/web_preview.dart';

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return WebPreview(
      enabled: true,
      application: Your application ...,
    );
  }
}

If you want to show a QrCode for easily test on your mobile device you can add your url on the qrCodeUrl parameter.

return WebPreview(
  enabled: true,
  application: Your application ...,
  qrCodeUrl: 'https://www.example.com',
);

You can also customize the widget using a builder function: the builder function takes the preview and the QR code as arguments and returns a custom widget.

WebPreview(
  enabled: true,
  application: Your application ...,
  builder: (preview, qrCode) {
    return Column(
      children: [
        Text('My custom text')
        preview,
        qrCode,
      ],
    );
  },
)

Contributions #

Contributions are welcome! If you find a bug or would like to request a feature, please open an issue on GitHub.

License #

This package is available as open source under the terms of the MIT License.