You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mohemm-flutter-app/lib/ui/chat/chat_full_image_preview.dart

51 lines
1.4 KiB
Dart

import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
class ChatImagePreviewScreen extends StatelessWidget {
const ChatImagePreviewScreen({Key? key, required this.imgTitle, required this.img}) : super(key: key);
final String imgTitle;
final Uint8List img;
@override
Widget build(BuildContext context) {
return Dialog(
backgroundColor: Colors.transparent,
insetPadding: const EdgeInsets.all(10),
child: Stack(
alignment: Alignment.center,
fit: StackFit.loose,
children: <Widget>[
Image.memory(
img,
fit: BoxFit.fill,
).paddingAll(15),
Positioned(
right: 0,
top: 0,
child: Container(
width: 30,
height: 30,
alignment: Alignment.center,
padding: EdgeInsets.zero,
margin: EdgeInsets.zero,
constraints: const BoxConstraints(),
color: MyColors.white,
child: const Icon(
Icons.cancel,
color: MyColors.redA3Color,
size: 30,
),
).onPress(() {
Navigator.of(context).pop();
}).circle(35),
)
],
),
);
}
}