aves/lib/widgets/fullscreen/info_page.dart
2019-07-28 18:25:12 +09:00

53 lines
1.3 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'package:aves/model/image_entry.dart';
import 'package:aves/utils/file_utils.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
class InfoPage extends StatelessWidget {
final ImageEntry entry;
const InfoPage({this.entry});
@override
Widget build(BuildContext context) {
final date = entry.getBestDate();
return Scaffold(
appBar: AppBar(
title: Text('Info'),
),
body: Padding(
padding: EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
InfoRow('Title', entry.title),
InfoRow('Date', '${DateFormat.yMMMd().format(date)} ${DateFormat.Hm().format(date)}'),
InfoRow('Size', formatFilesize(entry.sizeBytes)),
InfoRow('Resolution', '${entry.width} × ${entry.height} (${entry.getMegaPixels()} MP)'),
InfoRow('Path', entry.path),
],
),
),
);
}
}
class InfoRow extends StatelessWidget {
final String label, value;
const InfoRow(this.label, this.value);
@override
Widget build(BuildContext context) {
return Wrap(
children: [
Text(
label,
style: TextStyle(color: Colors.white70),
),
SizedBox(width: 8),
Text(value),
],
);
}
}