/*
 * @author lsy
 * @date   2019-11-01
 **/
import 'dart:io';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_drag_scale/core/drag_scale_widget.dart';
import 'package:gmalpha_flutter/AlbumModel/page/preview/AlbumPreviewModel.dart';
import 'package:gmalpha_flutter/commonModel/base/BaseComponent.dart';

class AlbumPreviewPage extends StatefulWidget {
  AlbumPreviewModel _model;
  String fromPage;

  AlbumPreviewPage(String imgPath, this.fromPage) {
    _model = AlbumPreviewModel(imgPath);
  }

  @override
  State<StatefulWidget> createState() => AlbumPreviewState(_model, fromPage);
}

class AlbumPreviewState extends State<AlbumPreviewPage> {
  AlbumPreviewModel _model;
  final String fromPage;

  AlbumPreviewState(this._model, this.fromPage);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: baseAppBar(backClick: () {
          Navigator.pop(context);
        }),
        body: Container(
          alignment: Alignment.center,
          width: double.maxFinite,
          height: double.maxFinite,
          child: DragScaleContainer(
              doubleTapStillScale: false,
              child: new Image.file(
                File(
                  _model.imgPath,
                ),
                fit: BoxFit.fitWidth,
              )),
        ));
  }

//  @override
//  String pageName() {
//    return "album_preview";
//  }
//
//  @override
//  String referrer() {
//    return fromPage;
//  }
}
