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

77 lines
2.3 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)
),
child: MaterialButton(
padding: EdgeInsets.zero,
onPressed: (){
Navigator.of(context).push(
MaterialPageRoute(
builder: (_)=> Scaffold(
body: SafeArea(
child: Stack(
children: [
Center(
child: InteractiveViewer(
child: Image(image:FileImage(image),)
),
),
ABackButton(),
],
),
),
)
)
);
},
child: Align(
alignment: Alignment.topRight,
child: IconButton(
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: (){
onRemoveTap(image);
},
)
),
),
);
}
}