Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 将本地存储的图像传递到social_share插件的路径_Flutter_Dart_Socialshare - Fatal编程技术网

Flutter 将本地存储的图像传递到social_share插件的路径

Flutter 将本地存储的图像传递到social_share插件的路径,flutter,dart,socialshare,Flutter,Dart,Socialshare,当用户共享内容时,我想将我的pubspec.yaml资产文件中本地存储的图像传递给社交共享插件。我可以从截图和图库中分享,但我不知道如何分享本地图像 RaisedButton( onPressed: () async { SocialShare.shareInstagramStory( 'assets/images/iPhone_11_Pro_fast_food.png',

当用户共享内容时,我想将我的pubspec.yaml资产文件中本地存储的图像传递给社交共享插件。我可以从截图和图库中分享,但我不知道如何分享本地图像

  RaisedButton(
                  onPressed: () async {
                    SocialShare.shareInstagramStory(
                      'assets/images/iPhone_11_Pro_fast_food.png',
                      backgroundTopColor: "#ffffff",
                      backgroundBottomColor: "#000000",
                      attributionURL: "https://deep-link-url",
                      backgroundImagePath:
                          'assets/images/iPhone_11_Pro_fast_food.png',
                    ).then((data) {
                      print(data);
                    });
                  },
                  child: Text("Share On Instagram Story"),
                ),
正如您所看到的,我已经输入了路径,这导致了一个错误

image path FileImage("assets/images/iPhone_11_Pro_fast_food.png", scale: 1.0)
 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]'