|
@@ -116,31 +116,31 @@ class PDFScreen extends StatelessWidget {
|
|
|
return PDFViewerScaffold(
|
|
|
appBar: MyAppBar(
|
|
|
centerTitle: fileUrl!=null&&fileUrl!="null"?'电梯资料库':"详情",
|
|
|
- actions: <Widget>[
|
|
|
- fileUrl!=null&&fileUrl!="null"? FlatButton(
|
|
|
- child: Text("下载"),
|
|
|
- textColor: Colours.dark_text,
|
|
|
- highlightColor: Colors.transparent,
|
|
|
- onPressed: () async {
|
|
|
- String _localPath = (await _findLocalPath()) + '/Download/';
|
|
|
- var pos = fileUrl.lastIndexOf("/");
|
|
|
- if (pos == -1) {
|
|
|
- pos = fileUrl.lastIndexOf("\\");
|
|
|
- }
|
|
|
- var filename = fileUrl.substring(pos + 1);
|
|
|
- Response responce =
|
|
|
- await Dio().download(fileUrl, _localPath + filename);
|
|
|
- if (responce.statusCode == 200) {
|
|
|
- // Scaffold.of(context).showSnackBar(SnackBar(content: Text("下载成功")));
|
|
|
- getUpdateDownLoadNum();
|
|
|
- toasts("下载成功");
|
|
|
- } else {
|
|
|
- // Scaffold.of(context).showSnackBar(SnackBar(content: Text("下载失败")));
|
|
|
- toasts("下载失败");
|
|
|
- }
|
|
|
- },
|
|
|
- ):Container(child:null,)
|
|
|
- ],
|
|
|
+ // actions: <Widget>[
|
|
|
+ // fileUrl!=null&&fileUrl!="null"? FlatButton(
|
|
|
+ // child: Text("下载"),
|
|
|
+ // textColor: Colours.dark_text,
|
|
|
+ // highlightColor: Colors.transparent,
|
|
|
+ // onPressed: () async {
|
|
|
+ // String _localPath = (await _findLocalPath()) + '/Download/';
|
|
|
+ // var pos = fileUrl.lastIndexOf("/");
|
|
|
+ // if (pos == -1) {
|
|
|
+ // pos = fileUrl.lastIndexOf("\\");
|
|
|
+ // }
|
|
|
+ // var filename = fileUrl.substring(pos + 1);
|
|
|
+ // Response responce =
|
|
|
+ // await Dio().download(fileUrl, _localPath + filename);
|
|
|
+ // if (responce.statusCode == 200) {
|
|
|
+ // // Scaffold.of(context).showSnackBar(SnackBar(content: Text("下载成功")));
|
|
|
+ // getUpdateDownLoadNum();
|
|
|
+ // toasts("下载成功");
|
|
|
+ // } else {
|
|
|
+ // // Scaffold.of(context).showSnackBar(SnackBar(content: Text("下载失败")));
|
|
|
+ // toasts("下载失败");
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // ):Container(child:null,)
|
|
|
+ // ],
|
|
|
),
|
|
|
path: pathPDF);
|
|
|
}
|