info: minor changes

This commit is contained in:
Thibault Deckers 2020-03-25 15:41:21 +09:00
parent 77c9d86ea3
commit 678c2509ae
5 changed files with 24 additions and 15 deletions

View file

@ -1,10 +1,10 @@
import 'package:aves/model/collection_lens.dart';
import 'package:aves/model/image_entry.dart';
import 'package:aves/widgets/common/coma_divider.dart';
import 'package:aves/widgets/common/providers/media_query_data_provider.dart';
import 'package:aves/widgets/fullscreen/info/basic_section.dart';
import 'package:aves/widgets/fullscreen/info/location_section.dart';
import 'package:aves/widgets/fullscreen/info/metadata_section.dart';
import 'package:aves/widgets/fullscreen/info/navigation_button.dart';
import 'package:aves/widgets/fullscreen/info/xmp_section.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
@ -161,26 +161,32 @@ class InfoPageState extends State<InfoPage> {
}
class SectionRow extends StatelessWidget {
final String title;
final IconData icon;
const SectionRow(this.title);
const SectionRow(this.icon);
@override
Widget build(BuildContext context) {
const double dim = 32;
final buildDivider = () => const SizedBox(
width: dim,
child: Divider(
thickness: NavigationButton.buttonBorderWidth,
color: Colors.white70,
),
);
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Expanded(child: ComaDivider(alignment: Alignment.centerRight)),
buildDivider(),
Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
title,
style: const TextStyle(
fontSize: 20,
fontFamily: 'Concourse Caps',
),
child: Icon(
icon,
size: dim,
),
),
const Expanded(child: ComaDivider(alignment: Alignment.centerLeft)),
buildDivider(),
],
);
}

View file

@ -86,7 +86,7 @@ class _LocationSectionState extends State<LocationSection> {
if (widget.showTitle)
const Padding(
padding: EdgeInsets.only(bottom: 8),
child: SectionRow('Location'),
child: SectionRow(OMIcons.place),
),
ImageMap(
markerId: entry.uri ?? entry.path,

View file

@ -7,6 +7,7 @@ import 'package:aves/utils/color_utils.dart';
import 'package:aves/widgets/common/fx/highlight_decoration.dart';
import 'package:aves/widgets/fullscreen/info/info_page.dart';
import 'package:flutter/material.dart';
import 'package:outline_material_icons/outline_material_icons.dart';
class MetadataSectionSliver extends StatefulWidget {
final ImageEntry entry;
@ -67,7 +68,7 @@ class _MetadataSectionSliverState extends State<MetadataSectionSliver> with Auto
return SliverList(
delegate: SliverChildListDelegate(
[
if (_metadata.isNotEmpty) const SectionRow('Metadata'),
if (_metadata.isNotEmpty) const SectionRow(OMIcons.info),
...directoriesWithoutTitle.map((dir) => InfoRowGroup(dir.tags)),
Theme(
data: Theme.of(context).copyWith(cardColor: Colors.grey[900]),

View file

@ -4,7 +4,9 @@ import 'package:aves/model/image_entry.dart';
import 'package:aves/widgets/album/filtered_collection_page.dart';
import 'package:aves/widgets/fullscreen/info/info_page.dart';
import 'package:aves/widgets/fullscreen/info/navigation_button.dart';
import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
import 'package:outline_material_icons/outline_material_icons.dart';
class XmpTagSectionSliver extends AnimatedWidget {
final CollectionLens collection;
@ -18,13 +20,13 @@ class XmpTagSectionSliver extends AnimatedWidget {
@override
Widget build(BuildContext context) {
final tags = entry.xmpSubjects;
final tags = entry.xmpSubjects..sort(compareAsciiUpperCase);
return SliverList(
delegate: SliverChildListDelegate.fixed(
tags.isEmpty
? []
: [
const SectionRow('Tags'),
const SectionRow(OMIcons.label),
Padding(
padding: const EdgeInsets.symmetric(horizontal: NavigationButton.buttonBorderWidth / 2),
child: Wrap(