57 lines
1.9 KiB
Dart
57 lines
1.9 KiB
Dart
import 'dart:convert';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:manager_api/api.dart';
|
|
import 'package:mymuseum_visitapp/Components/ShowImagePopup.dart';
|
|
import 'package:mymuseum_visitapp/Models/resourceModel.dart';
|
|
import 'package:mymuseum_visitapp/app_context.dart';
|
|
|
|
class BuilderImageSlider extends StatelessWidget {
|
|
const BuilderImageSlider(
|
|
{Key? key,
|
|
required this.appContext,
|
|
required this.currentIndex,
|
|
required this.imagesDTO,
|
|
required this.size,
|
|
required this.i}
|
|
) : super(key: key);
|
|
|
|
final AppContext appContext;
|
|
final int currentIndex;
|
|
final List<ImageDTO?> imagesDTO;
|
|
final Size size;
|
|
final ResourceModel i;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
/*return Builder(
|
|
builder: (BuildContext context) {*/
|
|
return InkWell(
|
|
onTap: () {
|
|
showImagePopup(imagesDTO[currentIndex-1]!, i, appContext, context, size);
|
|
},
|
|
child: Container(
|
|
//color: Colors.red,
|
|
//height: widget.height * 1,
|
|
//width: size.width * 0.95,
|
|
child: ClipRRect(
|
|
borderRadius: BorderRadius.circular(15.0),
|
|
child: Image.memory(base64Decode(i.data!))/*PhotoView(
|
|
imageProvider: Image.memory(base64Decode(i!.data!)).image,
|
|
minScale: PhotoViewComputedScale.contained * 0.8,
|
|
maxScale: PhotoViewComputedScale.contained * 3.0,
|
|
backgroundDecoration: BoxDecoration(
|
|
color: Colors.transparent,
|
|
/*shape: BoxShape.rectangle,
|
|
borderRadius: BorderRadius.circular(15.0),*/
|
|
),
|
|
)*/,
|
|
),
|
|
),
|
|
);
|
|
//},
|
|
//);
|
|
}
|
|
}
|
|
|