first implementation finished
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
class ReceivedParameter {
|
||||
final String? content;
|
||||
final String? tool;
|
||||
|
||||
ReceivedParameter(this.content, this.tool);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
|
||||
|
||||
class WebPageInfo {
|
||||
final Uri url;
|
||||
final String? title;
|
||||
final Favicon? favicon;
|
||||
|
||||
WebPageInfo({
|
||||
required this.url,
|
||||
required this.title,
|
||||
required this.favicon,
|
||||
});
|
||||
|
||||
factory WebPageInfo.fromJson(Map<String, dynamic> json) {
|
||||
return WebPageInfo(
|
||||
url: Uri.parse(json['url'] as String),
|
||||
title: json['title'] as String?,
|
||||
favicon: switch (json['favicon']) {
|
||||
final Map<String, dynamic> favicon => Favicon.fromMap(favicon),
|
||||
_ => null
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'url': url.toString(),
|
||||
'title': title,
|
||||
'favicon': favicon?.toJson(),
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user