aboutsummaryrefslogtreecommitdiff
path: root/lib/views/image_view.dart
blob: 615aa26ef9b6415ec99097034db171049aa661cc (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
38
39
import 'dart:io';

import 'package:flutter/material.dart';

import 'package:kulinar_app/constants.dart';

class ImageView extends StatelessWidget {
  const ImageView({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: Container(
            child: GestureDetector(
              child: Hero(
                tag: "image",
                child: Image(
                  image: FileImage(File(image)),
                ),
              ),
              onTap: () {
                Navigator.pop(context);
              },
            ),
          ),
        ),
      ),
    );
  }

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