2020-05-29 07:45:27 +06:30
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
2020-10-07 02:33:06 +06:30
|
|
|
|
|
|
|
|
import 'show_img.dart';
|
2020-05-29 07:45:27 +06:30
|
|
|
|
|
|
|
|
typedef OnFile = void Function(File);
|
|
|
|
|
|
|
|
|
|
class ImageUrl extends StatefulWidget {
|
2021-09-10 14:25:37 +06:30
|
|
|
final String? title;
|
|
|
|
|
final String? url;
|
2020-05-29 07:45:27 +06:30
|
|
|
|
2021-09-10 14:25:37 +06:30
|
|
|
const ImageUrl({Key? key, this.title, this.url}) : super(key: key);
|
2020-05-29 07:45:27 +06:30
|
|
|
@override
|
|
|
|
|
_ImageUrlState createState() => _ImageUrlState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _ImageUrlState extends State<ImageUrl> {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return InkWell(
|
|
|
|
|
onTap: () => {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) =>
|
2021-09-10 14:25:37 +06:30
|
|
|
ShowImage(url: widget.url!, fileName: widget.title!)),
|
2020-05-29 07:45:27 +06:30
|
|
|
)
|
|
|
|
|
},
|
|
|
|
|
child: Chip(
|
|
|
|
|
avatar: Icon(Icons.image),
|
2021-09-10 14:25:37 +06:30
|
|
|
label: Text(widget.title!),
|
2020-05-29 07:45:27 +06:30
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|