remove share and change position of download

This commit is contained in:
2024-10-02 14:41:17 +02:00
parent 2a16b70027
commit f2c3db5877
2 changed files with 59 additions and 33 deletions

View File

@@ -66,6 +66,8 @@ class _BuildFileViewState extends State<BuildFileView> {
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<BuildFileView> {
icon: Icon(
Icons.fullscreen,
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
size: 35,
),
),
),
@@ -88,6 +89,8 @@ class _BuildFileViewState extends State<BuildFileView> {
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<BuildFileView> {
icon: Icon(
Icons.download,
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
size: 35,
),
),
),
@@ -124,6 +126,8 @@ class _BuildFileViewState extends State<BuildFileView> {
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<BuildFileView> {
icon: Icon(
Icons.fullscreen,
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
size: 35,
),
),
),
@@ -147,6 +150,8 @@ class _BuildFileViewState extends State<BuildFileView> {
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<BuildFileView> {
icon: Icon(
Icons.download,
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
size: 35,
),
),
),

View File

@@ -90,6 +90,8 @@ class _FullScreenFileViewerState extends State<FullScreenFileViewer> {
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<FullScreenFileViewer> {
icon: Icon(
Icons.arrow_back,
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
size: 35,
),
),
),
@@ -116,6 +117,8 @@ class _FullScreenFileViewerState extends State<FullScreenFileViewer> {
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<FullScreenFileViewer> {
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<FullScreenFileViewer> {
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<FullScreenFileViewer> {
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<FullScreenFileViewer> {
}
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(),
),
),
),
],
),
],
);
}