You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.8 KiB
61 lines
1.8 KiB
10 months ago
|
import 'package:flutter/material.dart';
|
||
|
import 'package:capture/common/settings.dart';
|
||
|
import 'package:photo_view/photo_view.dart';
|
||
|
class ImageZoomPage extends StatefulWidget {
|
||
|
var imageName;
|
||
|
var imageDetails;
|
||
|
ImageZoomPage({this.imageName,this.imageDetails});
|
||
|
|
||
|
|
||
|
@override
|
||
|
State<ImageZoomPage> createState() => _ImageZoomPageState();
|
||
|
}
|
||
|
|
||
|
class _ImageZoomPageState extends State<ImageZoomPage> {
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return Scaffold(
|
||
|
appBar:AppBar(
|
||
|
backgroundColor: primaryColor,
|
||
|
title: Text(widget.imageName),
|
||
|
actions: [
|
||
|
IconButton(
|
||
|
onPressed: () {
|
||
|
|
||
|
Navigator.pop(context);
|
||
|
},
|
||
|
icon: Icon(
|
||
|
Icons.cancel,
|
||
|
color: Colors.red,
|
||
|
size: 30,
|
||
|
),
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
body: Container(
|
||
|
//width: MediaQuery.of(context).size.width * .10,
|
||
|
//height: MediaQuery.of(context).size.height * .50,
|
||
|
child: Column(
|
||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||
|
children: [
|
||
|
Padding(padding:EdgeInsets.fromLTRB(10,10,10,0),
|
||
|
child: Text('Use two fingers to zoom/double tap',style: TextStyle(color: Colors.black,fontSize: 12),),),
|
||
|
SizedBox(height:MediaQuery.of(context).size.height * .02,),
|
||
|
Expanded(
|
||
|
child: PhotoView(
|
||
|
imageProvider: NetworkImage(widget.imageDetails) as ImageProvider,
|
||
|
maxScale: PhotoViewComputedScale.contained * 4.0,
|
||
|
minScale: PhotoViewComputedScale.contained,
|
||
|
initialScale: PhotoViewComputedScale.contained,
|
||
|
basePosition: Alignment.center,
|
||
|
|
||
|
),
|
||
|
)
|
||
|
],
|
||
|
)
|
||
|
),
|
||
|
|
||
|
);
|
||
|
}
|
||
|
}
|