九宫格看图,效果如下图
Screenshot_1571750889.png
import 'package:flutter/material.dart';
import 'dart:math';
// ignore: must_be_immutable
class NinePicture extends StatelessWidget {
List> list = [];
NinePicture(List> list) {
this.list = list;
}
void showPhoto(BuildContext context, Map img) {
Navigator.push(context,
MaterialPageRoute(builder: (BuildContext context) {
return GestureDetector(
child: SizedBox.expand(
child: Hero(
tag: img['tag'],
child: Image.asset(
img['img'],
fit: BoxFit.contain,
),
),
),
onTap: () {
Navigator.maybePop(context);
},
);
}));
}
@override