git-touch-android-ios-app/lib/screens/image_view.dart

22 lines
544 B
Dart
Raw Normal View History

2019-11-02 14:44:26 +01:00
import 'package:flutter/material.dart';
import 'package:git_touch/scaffolds/common.dart';
import 'package:photo_view/photo_view.dart';
2019-11-02 15:30:26 +01:00
class ImageViewScreen extends StatelessWidget {
2019-11-02 14:44:26 +01:00
final String url;
2019-11-02 15:30:26 +01:00
final Widget title;
2019-11-02 14:44:26 +01:00
2019-11-02 15:30:26 +01:00
ImageViewScreen(this.url, {this.title = const Text('Image')});
2019-11-02 14:44:26 +01:00
@override
Widget build(BuildContext context) {
return CommonScaffold(
2019-11-02 15:30:26 +01:00
title: title,
2019-11-02 14:44:26 +01:00
body: PhotoView(
imageProvider: NetworkImage(url),
backgroundDecoration: BoxDecoration(color: Colors.white),
),
);
}
}