aboutsummaryrefslogtreecommitdiff
path: root/lib/views/image_subview.dart
blob: bc5ac494f08ca744bd911fc059cc924b28a656f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import 'dart:io';

import 'package:flutter/material.dart';

import 'package:kulinar_app/constants.dart';

class ImageSubview extends StatelessWidget {
  const ImageSubview({Key? key, required this.image}) : super(key: key);

  final String image;

  @override
  Widget build(BuildContext context) {
    return InteractiveViewer(
      child: Scaffold(
        backgroundColor: _averageImageColor(image),
        body: Center(
          child: GestureDetector(
            child: Hero(
              tag: "image",
              child: Image(
                image: FileImage(File(image)),
              ),
            ),
            onTap: () {
              Navigator.pop(context);
            },
          ),
        ),
      ),
    );
  }

  Color _averageImageColor(String path) {
    return cPrimaryColor;
  }
}