Skip to content
Open
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
32 changes: 5 additions & 27 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,7 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
analyzer:
exclude:
# Example is a separate package (see example/pubspec.yaml); analyzing it
# from the root package duplicates work and lacks example-only deps.
- example/**
8 changes: 8 additions & 0 deletions example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
import FlutterMacOS
import Foundation

import package_info_plus
import video_player_avfoundation
import wakelock_plus
import webview_flutter_wkwebview

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
FVPVideoPlayerPlugin.register(with: registry.registrar(forPlugin: "FVPVideoPlayerPlugin"))
WakelockPlusMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockPlusMacosPlugin"))
WebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "WebViewFlutterPlugin"))
}
2 changes: 2 additions & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ environment:
dependencies:
flutter_html:
path: ../
flutter_html_all:
path: ../packages/flutter_html_all
flutter:
sdk: flutter

Expand Down
4 changes: 2 additions & 2 deletions lib/flutter_html.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Html extends StatefulWidget {
Html.fromDom({
Key? key,
GlobalKey? anchorKey,
@required dom.Document? document,
required dom.Document? document,
this.onLinkTap,
this.onAnchorTap,
this.extensions = const [],
Expand All @@ -84,7 +84,7 @@ class Html extends StatefulWidget {
Html.fromElement({
Key? key,
GlobalKey? anchorKey,
@required this.documentElement,
required this.documentElement,
this.onLinkTap,
this.onAnchorTap,
this.extensions = const [],
Expand Down
6 changes: 4 additions & 2 deletions lib/src/css_box_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ class CssBoxWidget extends StatelessWidget {
child: top
? child
: MediaQuery(
data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
data: MediaQuery.of(context)
.copyWith(textScaler: TextScaler.noScaling),
child: child,
),
),
Expand Down Expand Up @@ -179,6 +180,7 @@ class CssBoxWidget extends StatelessWidget {
}

class _CSSBoxRenderer extends MultiChildRenderObjectWidget {
// ignore: prefer_const_constructors_in_immutables
_CSSBoxRenderer({
Key? key,
required super.children,
Expand Down Expand Up @@ -769,7 +771,7 @@ extension Normalize on Dimension {

double _calculateEmValue(Style style, BuildContext buildContext) {
return (style.fontSize?.emValue ?? 16) *
MediaQuery.textScaleFactorOf(buildContext) *
MediaQuery.textScalerOf(buildContext).scale(1.0) *
MediaQuery.of(buildContext).devicePixelRatio;
}

Expand Down
2 changes: 0 additions & 2 deletions lib/src/css_parser.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:ui';

import 'package:collection/collection.dart';
import 'package:csslib/visitor.dart' as css;
import 'package:csslib/parser.dart' as cssparser;
Expand Down
2 changes: 0 additions & 2 deletions lib/src/style.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:flutter_html/src/css_parser.dart';
Expand Down
4 changes: 2 additions & 2 deletions packages/flutter_html_audio/lib/flutter_html_audio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ class _AudioWidgetState extends State<AudioWidget> {
];

if (sources.isNotEmpty && sources.first != null) {
audioController = VideoPlayerController.network(
sources.first ?? "",
audioController = VideoPlayerController.networkUrl(
Uri.parse(sources.first!),
);
chewieAudioController = ChewieAudioController(
videoPlayerController: audioController!,
Expand Down
7 changes: 2 additions & 5 deletions packages/flutter_html_iframe/lib/iframe_mobile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class IframeWidget extends StatelessWidget {
final givenHeight =
double.tryParse(extensionContext.attributes['height'] ?? "");

Uri? srcUri;
final Uri srcUri;
if (extensionContext.attributes['srcdoc'] != null) {
srcUri = Uri.dataFromString(
extensionContext.attributes['srcdoc'] ?? '',
Expand All @@ -54,10 +54,7 @@ class IframeWidget extends StatelessWidget {
style: extensionContext.styledElement!.style,
childIsReplaced: true,
child: WebViewWidget(
controller: controller
..loadRequest(
Uri.tryParse(extensionContext.attributes['src'] ?? "") ??
Uri()),
controller: controller..loadRequest(srcUri),
key: key,
gestureRecognizers: {Factory(() => VerticalDragGestureRecognizer())},
),
Expand Down
3 changes: 1 addition & 2 deletions packages/flutter_html_video/lib/flutter_html_video.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ class _VideoWidgetState extends State<VideoWidget> {
VideoPlayerController.file(File.fromUri(sourceUri));
break;
default:
_videoController =
VideoPlayerController.network(sourceUri.toString());
_videoController = VideoPlayerController.networkUrl(sourceUri);
break;
}
_chewieController = ChewieController(
Expand Down