0

我正在使用share: ^2.0.4插件将一些数据从应用程序共享到 WhatsApp。

GestureDetector(
                            onTap: () async {
                              File a =
                                  await cache.getSingleFile(widget.proData[9]);
                              print(a.path);
                              List<String> b = [a.path];
                              Share.shareFiles(b,
                                  text: "Diamond Ct  :  " +
                                      widget.proData[1] +
                                      "\nDiamond Col  :  " +
                                      widget.proData[2] +
                                      "\nDiamond Grd  :  " +
                                      widget.proData[3] +
                                      "\nGold Weight  :  " +
                                      widget.proData[6] +
                                      "\nColour Stone :  " +
                                      widget.proData[4] +
                                      "\nColour Stone Ct :  " +
                                      widget.proData[5]);
                            },
                            child: Container(
                                decoration: BoxDecoration(
                                  color: Colors.grey[100],
                                  borderRadius:
                                      BorderRadius.all(Radius.circular(25)),
                                  boxShadow: [
                                    BoxShadow(
                                      color: Colors.grey[400]!,
                                      offset: Offset(0, 2), //(x,y)
                                      blurRadius: 1,
                                    ),
                                  ],
                                ),
                                width: MediaQuery.of(context).size.width / 2.4,
                                height: 40,
                                child: Center(
                                    child: Text(
                                  "Share",
                                  style: GoogleFonts.ibmPlexSerif(
                                      fontSize: 17, letterSpacing: 4),
                                ))))

一切正常,数据共享完美,但是当我返回应用程序时,它重新启动不知道为什么会发生这种情况。

4

0 回答 0