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.
cloudsolutions-atoms/lib/views/widgets/images/multi_image_picker_item.dart

60 lines
2.1 KiB
Dart

3 years ago
import 'dart:io';
import 'package:flutter/material.dart';
3 years ago
import 'package:test_sa/views/app_style/colors.dart';
import 'package:test_sa/views/app_style/sizing.dart';
import 'package:test_sa/views/widgets/buttons/app_back_button.dart';
class MultiImagesPickerItem extends StatelessWidget {
final File image;
final Function(File) onRemoveTap;
const MultiImagesPickerItem({Key key, this.image, this.onRemoveTap}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
width: 80 * AppStyle.getScaleFactor(context),
height: 80 * AppStyle.getScaleFactor(context),
decoration:
BoxDecoration(boxShadow: [BoxShadow(color: Colors.black38, blurRadius: 2)], image: DecorationImage(image: FileImage(image), fit: BoxFit.cover), borderRadius: BorderRadius.circular(8)),
3 years ago
child: MaterialButton(
padding: EdgeInsets.zero,
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (_) => Scaffold(
3 years ago
body: SafeArea(
child: Stack(
children: [
Center(
child: InteractiveViewer(
child: Image(
image: FileImage(image),
)),
3 years ago
),
ABackButton(),
],
),
),
)));
3 years ago
},
child: Align(
alignment: Alignment.topRight,
child: IconButton(
3 years ago
padding: const EdgeInsets.all(2.0),
icon: Container(
padding: EdgeInsets.all(1),
decoration: BoxDecoration(color: Theme.of(context).scaffoldBackgroundColor.withOpacity(.3), borderRadius: BorderRadius.circular(8)),
child: Icon(
Icons.remove_circle,
color: AColors.red,
)),
onPressed: () {
3 years ago
onRemoveTap(image);
},
)),
3 years ago
),
);
}
}