Skip to content

Commit 2698376

Browse files
committed
Migrate lib & test to nullsafety
1 parent 0e5fb4e commit 2698376

File tree

6 files changed

+207
-241
lines changed

6 files changed

+207
-241
lines changed

lib/flutter_html.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class Html extends StatelessWidget {
3333
/// **style** Pass in the style information for the Html here.
3434
/// See [its wiki page](https://github.com/Sub6Resources/flutter_html/wiki/Style) for more info.
3535
Html({
36-
Key key,
37-
@required this.data,
36+
Key? key,
37+
required this.data,
3838
this.onLinkTap,
3939
this.customRender = const {},
4040
this.customImageRenders = const {},
@@ -47,13 +47,13 @@ class Html extends StatelessWidget {
4747
}) : super(key: key);
4848

4949
final String data;
50-
final OnTap onLinkTap;
50+
final OnTap? onLinkTap;
5151
final Map<ImageSourceMatcher, ImageRender> customImageRenders;
52-
final ImageErrorListener onImageError;
52+
final ImageErrorListener? onImageError;
5353
final bool shrinkWrap;
5454

5555
/// Properties for the Image widget that gets rendered by the rich text parser
56-
final OnTap onImageTap;
56+
final OnTap? onImageTap;
5757

5858
final List<String> blacklistedElements;
5959

@@ -67,11 +67,11 @@ class Html extends StatelessWidget {
6767
/// Decides how to handle a specific navigation request in the WebView of an
6868
/// Iframe. It's necessary to use the webview_flutter package inside the app
6969
/// to use NavigationDelegate.
70-
final NavigationDelegate navigationDelegateForIframe;
70+
final NavigationDelegate? navigationDelegateForIframe;
7171

7272
@override
7373
Widget build(BuildContext context) {
74-
final double width = shrinkWrap ? null : MediaQuery.of(context).size.width;
74+
final double? width = shrinkWrap ? null : MediaQuery.of(context).size.width;
7575

7676
return Container(
7777
width: width,

0 commit comments

Comments
 (0)