Ver Fonte

1.3 ver

kidd3166 há 3 anos atrás
pai
commit
f90668b661
2 ficheiros alterados com 17 adições e 1 exclusões
  1. 1 0
      lib/pages/home/consume_page.dart
  2. 16 1
      lib/pages/social/share_webview.dart

+ 1 - 0
lib/pages/home/consume_page.dart

@@ -529,6 +529,7 @@ class _PageState extends State<ConsumePage> with InjectApi {
                         (context) => WebViewSharePage(
                               "http://shoes-web.hiyd.com/share",
                               hash: hash,
+                          openShare: true,
                             ));
                   }
                 },

+ 16 - 1
lib/pages/social/share_webview.dart

@@ -14,7 +14,8 @@ import 'package:webview_flutter/webview_flutter.dart';
 class WebViewSharePage extends StatefulWidget {
   final String url;
   final String hash;
-  WebViewSharePage(this.url, {this.hash});
+  final bool openShare;
+  WebViewSharePage(this.url, {this.hash, this.openShare = false});
   @override
   _WebViewSharePageState createState() => _WebViewSharePageState();
 }
@@ -25,6 +26,20 @@ class _WebViewSharePageState extends State<WebViewSharePage> {
   bool _isLoading = true;
 
   @override
+  void initState() {
+    super.initState();
+    if(widget.openShare == true){
+      WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
+        menuShareBottom(context, "Link",
+            url: "http://shoes-web.hiyd.com/share",
+            hasDownload: false,
+            hash: widget.hash);
+    });
+
+    }
+  }
+
+  @override
   Widget build(BuildContext context) {
     return AnnotatedRegion<SystemUiOverlayStyle>(
         value: SystemUiOverlayStyle.dark,