1
0
mirror of https://github.com/git-touch/git-touch synced 2024-12-19 11:43:30 +01:00
git-touch-android-ios-app/lib/screens/image_view.dart

27 lines
719 B
Dart
Raw Normal View History

2019-11-02 14:44:26 +01:00
import 'package:flutter/material.dart';
2019-11-05 14:22:41 +01:00
import 'package:git_touch/models/theme.dart';
2019-11-02 14:44:26 +01:00
import 'package:git_touch/scaffolds/common.dart';
import 'package:photo_view/photo_view.dart';
2019-11-05 14:22:41 +01:00
import 'package:provider/provider.dart';
2019-11-02 14:44:26 +01:00
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) {
2019-11-05 14:22:41 +01:00
final theme = Provider.of<ThemeModel>(context);
2019-11-02 14:44:26 +01:00
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),
2020-01-14 11:13:07 +01:00
backgroundDecoration:
BoxDecoration(color: theme.paletteOf(context).background),
2019-11-02 14:44:26 +01:00
),
);
}
}