Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/mirai_gallery/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ packages:
path: "../../packages/mirai_webview"
relative: true
source: path
version: "0.0.3"
version: "0.0.4"
nested:
dependency: transitive
description:
Expand Down
6 changes: 6 additions & 0 deletions packages/mirai_webview/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.0.4

* Update webview_flutter to 4.10.0
* Add layoutDirection property to the WebView
* Add documentation for the WebView

## 0.0.3

* minor changes
Expand Down
10 changes: 9 additions & 1 deletion packages/mirai_webview/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# Mirai Web View

A webView support for Mirai.
A webView support for [Mirai](https://pub.dev/packages/mirai).

## Usage

1. Add `mirai_webview` as a dependency in your pubspec.yaml file.

Install the plugin by running the following command from the project root:

```bash
flutter pub add mirai_webview
```

or add it manually in your `pubspec.yaml` file:

```yaml
dependencies:
mirai_webview:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter/material.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:webview_flutter/webview_flutter.dart';

Expand All @@ -6,14 +7,36 @@ export 'mirai_webview_parser.dart';
part 'mirai_webview.freezed.dart';
part 'mirai_webview.g.dart';

/// `MiraiWebView` is a widget that renders a web page within a flutter application.
@freezed
class MiraiWebView with _$MiraiWebView {
/// `MiraiWebView` constructor.
const factory MiraiWebView({
/// The URL to load in the `WebView`.
required String url,

/// Sets whether JavaScript execution is enabled.
///
/// Default value is `JavaScriptMode.unrestricted`.
@Default(JavaScriptMode.unrestricted) JavaScriptMode javaScriptMode,
@Default("#000000") String backgroundColor,

/// Background color of the `WebView`.
///
/// Default value is `#FFFFFF`.
@Default("#FFFFFF") String backgroundColor,

/// The user agent for the `WebView`.
String? userAgent,

/// Sets whether zoom is enabled for the `WebView`.
///
/// Default value is `false`.
@Default(false) bool enableZoom,

/// The layout direction for the `WebView`.
///
/// Default value is `TextDirection.ltr`.
@Default(TextDirection.ltr) TextDirection layoutDirection,
}) = _MiraiWebView;

factory MiraiWebView.fromJson(Map<String, dynamic> json) =>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading