|
|
|
@ -80,16 +80,18 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
|
|
|
|
|
: article != null |
|
|
|
|
? article.viceTitle |
|
|
|
|
: "", |
|
|
|
|
[activity != null |
|
|
|
|
? activity.coverImg |
|
|
|
|
: article != null |
|
|
|
|
? article.coverImg |
|
|
|
|
: "",], |
|
|
|
|
[ |
|
|
|
|
activity != null |
|
|
|
|
? activity.coverImg |
|
|
|
|
: article != null |
|
|
|
|
? article.coverImg |
|
|
|
|
: "", |
|
|
|
|
], |
|
|
|
|
activity != null |
|
|
|
|
? activity.coverImg |
|
|
|
|
: article != null |
|
|
|
|
? article.coverImg |
|
|
|
|
: "", |
|
|
|
|
? article.coverImg |
|
|
|
|
: "", |
|
|
|
|
"", |
|
|
|
|
"http://hx.lotus-wallet.com/index.html?id=${widget.arguments["activityId"] ?? widget.arguments["articleId"]}", |
|
|
|
|
"", |
|
|
|
@ -101,29 +103,27 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
|
|
|
|
|
debugPrint(activity != null |
|
|
|
|
? activity.coverImg |
|
|
|
|
: article != null |
|
|
|
|
? article.coverImg |
|
|
|
|
: ""); |
|
|
|
|
? article.coverImg |
|
|
|
|
: ""); |
|
|
|
|
|
|
|
|
|
showModalBottomSheet( |
|
|
|
|
context: context, |
|
|
|
|
backgroundColor: Colors.transparent, |
|
|
|
|
builder: (context) { |
|
|
|
|
return ShareDialog((platform){ |
|
|
|
|
return ShareDialog((platform) { |
|
|
|
|
if (platform == ShareSDKPlatforms.line) { |
|
|
|
|
params.map["type"] = SSDKContentTypes.text.value; |
|
|
|
|
params.map["text"] = "${activity != null |
|
|
|
|
? activity.viceTitle |
|
|
|
|
: article != null |
|
|
|
|
? article.viceTitle |
|
|
|
|
: ""} http://hx.lotus-wallet.com/index.html?id=${widget.arguments["activityId"] ?? widget.arguments["articleId"]}"; |
|
|
|
|
params.map["text"] = |
|
|
|
|
"${activity != null ? activity.viceTitle : article != null ? article.viceTitle : ""} http://hx.lotus-wallet.com/index.html?id=${widget.arguments["activityId"] ?? widget.arguments["articleId"]}"; |
|
|
|
|
} |
|
|
|
|
SharesdkPlugin.share(platform, params, (state, userData, contentEntity, error) { |
|
|
|
|
print("share!$state"); |
|
|
|
|
print("share!$platform"); |
|
|
|
|
print("share!$userData"); |
|
|
|
|
print("share!$contentEntity"); |
|
|
|
|
print("share!$error"); |
|
|
|
|
print("share!"); |
|
|
|
|
SharesdkPlugin.share(platform, params, |
|
|
|
|
(state, userData, contentEntity, error) { |
|
|
|
|
print("share!$state"); |
|
|
|
|
print("share!$platform"); |
|
|
|
|
print("share!$userData"); |
|
|
|
|
print("share!$contentEntity"); |
|
|
|
|
print("share!$error"); |
|
|
|
|
print("share!"); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
@ -199,7 +199,7 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
|
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
width: 10, |
|
|
|
|
width: 10.w, |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
activity != null |
|
|
|
@ -228,9 +228,9 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
|
|
|
|
|
networkSourceMatcher(extension: "svg"): |
|
|
|
|
svgNetworkImageRender(), |
|
|
|
|
networkSourceMatcher(): networkImageRender( |
|
|
|
|
loadingWidget: () { |
|
|
|
|
return Container(); |
|
|
|
|
}, |
|
|
|
|
loadingWidget: () { |
|
|
|
|
return Container(); |
|
|
|
|
}, |
|
|
|
|
// mapUrl: (url) { |
|
|
|
|
// print("objectUrl: $url"); |
|
|
|
|
// return "$url?imageMogr2/format/webp/blur/1x0/quality/75"; |
|
|
|
@ -238,26 +238,43 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
|
|
|
|
|
), |
|
|
|
|
}, |
|
|
|
|
customRender: { |
|
|
|
|
"video" : (context, parsedChild, attributes, element) { |
|
|
|
|
"video": (context, parsedChild, attributes, element) { |
|
|
|
|
print("video attributes: ${element.attributes}"); |
|
|
|
|
print("video attributes: ${element.attributeSpans}"); |
|
|
|
|
print("video attributes: ${element.children.first.attributes["src"]}"); |
|
|
|
|
print( |
|
|
|
|
"video attributes: ${element.children.first.attributes["src"]}"); |
|
|
|
|
print("video attributes: $parsedChild"); |
|
|
|
|
return videoWidget(double.tryParse(attributes['width'] ?? ""), double.tryParse(element.attributes['height'] ?? ""), element.children.first.attributes["src"], element.attributes["sandbox"]); |
|
|
|
|
return videoWidget( |
|
|
|
|
double.tryParse(attributes['width'] ?? ""), |
|
|
|
|
double.tryParse(element.attributes['height'] ?? ""), |
|
|
|
|
element.children.first.attributes["src"], |
|
|
|
|
element.attributes["sandbox"]); |
|
|
|
|
}, |
|
|
|
|
"iframe" : (context, parsedChild, attributes, element) { |
|
|
|
|
"iframe": (context, parsedChild, attributes, element) { |
|
|
|
|
print("iframe attributes: ${element.toString()}"); |
|
|
|
|
print("iframe attributes: $parsedChild"); |
|
|
|
|
return videoWidget(double.tryParse(attributes['width'] ?? ""), double.tryParse(element.attributes['height'] ?? ""), element.children.first.attributes["src"], element.attributes["sandbox"]); |
|
|
|
|
return videoWidget( |
|
|
|
|
double.tryParse(attributes['width'] ?? ""), |
|
|
|
|
double.tryParse(element.attributes['height'] ?? ""), |
|
|
|
|
element.children.first.attributes["src"], |
|
|
|
|
element.attributes["sandbox"]); |
|
|
|
|
}, |
|
|
|
|
"audio" : (context, parsedChild, attributes, element) { |
|
|
|
|
"audio": (context, parsedChild, attributes, element) { |
|
|
|
|
final sources = <String>[ |
|
|
|
|
if (element.attributes['src'] != null) element.attributes['src'], |
|
|
|
|
if (element.attributes['src'] != null) |
|
|
|
|
element.attributes['src'], |
|
|
|
|
]; |
|
|
|
|
if (sources == null || sources.isEmpty || sources.first == null) { |
|
|
|
|
if (sources == null || |
|
|
|
|
sources.isEmpty || |
|
|
|
|
sources.first == null) { |
|
|
|
|
return EmptyContentElement(); |
|
|
|
|
} |
|
|
|
|
return audioWidget(attributes['controls'] != null, attributes['loop'] != null, attributes['autoplay'] != null, sources, context.style.width ?? 300.w); |
|
|
|
|
return audioWidget( |
|
|
|
|
attributes['controls'] != null, |
|
|
|
|
attributes['loop'] != null, |
|
|
|
|
attributes['autoplay'] != null, |
|
|
|
|
sources, |
|
|
|
|
context.style.width ?? 300.w); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
@ -279,7 +296,8 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
|
|
|
|
|
height: (MediaQuery.of(context).size.width) / (width / height), |
|
|
|
|
child: chewies = Chewie( |
|
|
|
|
controller: chewieAudioController = ChewieController( |
|
|
|
|
videoPlayerController: videoPlayerController = VideoPlayerController.network( |
|
|
|
|
videoPlayerController: videoPlayerController = |
|
|
|
|
VideoPlayerController.network( |
|
|
|
|
src, |
|
|
|
|
), |
|
|
|
|
aspectRatio: width / height, |
|
|
|
@ -320,13 +338,10 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
void dispose() { |
|
|
|
|
if (chewieAudioController != null) |
|
|
|
|
chewieAudioController.dispose(); |
|
|
|
|
if (chewieAudioController != null) chewieAudioController.dispose(); |
|
|
|
|
|
|
|
|
|
if (videoPlayerController != null) |
|
|
|
|
videoPlayerController.dispose(); |
|
|
|
|
if (videoPlayerController != null) videoPlayerController.dispose(); |
|
|
|
|
|
|
|
|
|
super.dispose(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|