From f2c3db5877f1a638eda2f3ddeec43e04a3d14f9a Mon Sep 17 00:00:00 2001 From: yaso Date: Wed, 2 Oct 2024 14:41:17 +0200 Subject: [PATCH] remove share and change position of download --- .../builder/build_file_view.dart | 12 ++- .../patient_profile/full_screen_file.dart | 80 ++++++++++++------- 2 files changed, 59 insertions(+), 33 deletions(-) diff --git a/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_file_view.dart b/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_file_view.dart index 608ab2d3..74898615 100644 --- a/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_file_view.dart +++ b/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_file_view.dart @@ -66,6 +66,8 @@ class _BuildFileViewState extends State { width: 50, height: 50, child: IconButton.filled( + iconSize: 35, + padding: const EdgeInsets.all(0), onPressed: () { Navigator.of(context).pushNamed( '/file-veiwer', @@ -78,7 +80,6 @@ class _BuildFileViewState extends State { icon: Icon( Icons.fullscreen, color: MzanziInnovationHub.of(context)!.theme.primaryColor(), - size: 35, ), ), ), @@ -88,6 +89,8 @@ class _BuildFileViewState extends State { width: 50, height: 50, child: IconButton.filled( + iconSize: 35, + padding: const EdgeInsets.all(0), onPressed: () { html.window.open( widget.link, @@ -97,7 +100,6 @@ class _BuildFileViewState extends State { icon: Icon( Icons.download, color: MzanziInnovationHub.of(context)!.theme.primaryColor(), - size: 35, ), ), ), @@ -124,6 +126,8 @@ class _BuildFileViewState extends State { width: 50, height: 50, child: IconButton.filled( + iconSize: 35, + padding: const EdgeInsets.all(0), onPressed: () { //expandImage(width, height); Navigator.of(context).pushNamed( @@ -137,7 +141,6 @@ class _BuildFileViewState extends State { icon: Icon( Icons.fullscreen, color: MzanziInnovationHub.of(context)!.theme.primaryColor(), - size: 35, ), ), ), @@ -147,6 +150,8 @@ class _BuildFileViewState extends State { width: 50, height: 50, child: IconButton.filled( + iconSize: 35, + padding: const EdgeInsets.all(0), onPressed: () { html.window.open( widget.link, @@ -156,7 +161,6 @@ class _BuildFileViewState extends State { icon: Icon( Icons.download, color: MzanziInnovationHub.of(context)!.theme.primaryColor(), - size: 35, ), ), ), diff --git a/Frontend/patient_manager/lib/mih_packages/patient_profile/full_screen_file.dart b/Frontend/patient_manager/lib/mih_packages/patient_profile/full_screen_file.dart index f83330c0..248ec77c 100644 --- a/Frontend/patient_manager/lib/mih_packages/patient_profile/full_screen_file.dart +++ b/Frontend/patient_manager/lib/mih_packages/patient_profile/full_screen_file.dart @@ -90,6 +90,8 @@ class _FullScreenFileViewerState extends State { Visibility( visible: isPDF, child: IconButton( + iconSize: 30, + padding: const EdgeInsets.all(0), onPressed: () { pdfViewerController.previousPage(); //print(pdfViewerController.); @@ -102,7 +104,6 @@ class _FullScreenFileViewerState extends State { icon: Icon( Icons.arrow_back, color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - size: 35, ), ), ), @@ -116,6 +117,8 @@ class _FullScreenFileViewerState extends State { Visibility( visible: isPDF, child: IconButton( + iconSize: 30, + padding: const EdgeInsets.all(0), onPressed: () { pdfViewerController.nextPage(); //print(pdfViewerController.pageNumber); @@ -128,13 +131,14 @@ class _FullScreenFileViewerState extends State { icon: Icon( Icons.arrow_forward, color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - size: 35, ), ), ), Visibility( visible: isPDF, child: IconButton( + iconSize: 30, + padding: const EdgeInsets.all(0), onPressed: () { if (zoomOut > 0) { setState(() { @@ -150,13 +154,14 @@ class _FullScreenFileViewerState extends State { icon: Icon( Icons.zoom_in, color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - size: 35, ), ), ), Visibility( visible: isPDF, child: IconButton( + iconSize: 30, + padding: const EdgeInsets.all(0), onPressed: () { if (pdfViewerController.zoomLevel > 1) { setState(() { @@ -174,46 +179,37 @@ class _FullScreenFileViewerState extends State { icon: Icon( Icons.zoom_out, color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - size: 35, ), ), ), Visibility( visible: isPDF, child: IconButton( + iconSize: 30, + padding: const EdgeInsets.all(0), onPressed: () { printDocument(); }, icon: Icon( Icons.print, color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - size: 35, ), ), ), - IconButton( - onPressed: () { - html.window.open( - widget.arguments.link, - // '${AppEnviroment.baseFileUrl}/mih/$filePath', - 'download'); - }, - icon: Icon( - Icons.download, - color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - size: 35, - ), - ), - IconButton( - onPressed: () { - shareDocument(); - }, - icon: Icon( - Icons.share, - color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - size: 35, - ), - ), + // IconButton( + // iconSize: 30, + // padding: const EdgeInsets.all(0), + // onPressed: () { + // html.window.open( + // widget.arguments.link, + // // '${AppEnviroment.baseFileUrl}/mih/$filePath', + // 'download'); + // }, + // icon: Icon( + // Icons.download, + // color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + // ), + // ), ], ); } @@ -258,7 +254,33 @@ class _FullScreenFileViewerState extends State { } return MIHBody( borderOn: false, - bodyItems: [fileViewer], + bodyItems: [ + Stack( + children: [ + Expanded(child: fileViewer), + Positioned( + bottom: 5, + right: 5, + width: 50, + height: 50, + child: IconButton.filled( + iconSize: 35, + padding: const EdgeInsets.all(0), + onPressed: () { + html.window.open( + widget.arguments.link, + // '${AppEnviroment.baseFileUrl}/mih/$filePath', + 'download'); + }, + icon: Icon( + Icons.download, + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + ), + ), + ), + ], + ), + ], ); }