This commit is contained in:
Thibault Deckers 2019-07-22 20:00:49 +09:00
parent 033f979fb3
commit 5bb63cc6ef
3 changed files with 70 additions and 33 deletions

View file

@ -121,38 +121,67 @@ class FullscreenOverlay extends StatelessWidget {
child: Container( child: Container(
padding: EdgeInsets.all(8.0).add(EdgeInsets.only(bottom: viewInsets.bottom)), padding: EdgeInsets.all(8.0).add(EdgeInsets.only(bottom: viewInsets.bottom)),
color: Colors.black45, color: Colors.black45,
child: Column( child: DefaultTextStyle(
mainAxisSize: MainAxisSize.min, style: TextStyle(
crossAxisAlignment: CrossAxisAlignment.start, shadows: [
children: [ Shadow(
Text('${index + 1} / $total - ${entry['title']}'), color: Colors.black87,
Row( offset: Offset(0.0, 1.0),
children: [ )
Expanded(child: Text('${DateFormat.yMMMd().format(date)} ${DateFormat.Hm().format(date)}')), ],
Expanded(child: Text('${entry['width']} × ${entry['height']}')), ),
], child: Column(
), mainAxisSize: MainAxisSize.min,
FutureBuilder( crossAxisAlignment: CrossAxisAlignment.start,
future: ImageFetcher.getOverlayMetadata(entry['path']), children: [
builder: (futureContext, AsyncSnapshot<Map> snapshot) { Text(
if (snapshot.connectionState != ConnectionState.done || snapshot.hasError) { '${index + 1} / $total ${entry['title']}',
return Text(''); overflow: TextOverflow.ellipsis,
} ),
var metadata = snapshot.data; SizedBox(height: 4),
if (metadata.isEmpty) { Row(
return Text(''); children: [
} Padding(
return Row( padding: EdgeInsets.only(right: 8.0),
children: [ child: Icon(
Expanded(child: Text(metadata['aperture'])), Icons.calendar_today,
Expanded(child: Text(metadata['exposureTime'])), size: 16,
Expanded(child: Text(metadata['focalLength'])), ),
Expanded(child: Text(metadata['iso'])), ),
], Expanded(child: Text('${DateFormat.yMMMd().format(date)} ${DateFormat.Hm().format(date)}')),
); Expanded(child: Text('${entry['width']} × ${entry['height']}')),
}, ],
) ),
], SizedBox(height: 4),
FutureBuilder(
future: ImageFetcher.getOverlayMetadata(entry['path']),
builder: (futureContext, AsyncSnapshot<Map> snapshot) {
if (snapshot.connectionState != ConnectionState.done || snapshot.hasError) {
return Text('');
}
var metadata = snapshot.data;
if (metadata.isEmpty) {
return Text('');
}
return Row(
children: [
Padding(
padding: EdgeInsets.only(right: 8.0),
child: Icon(
Icons.camera,
size: 16,
),
),
Expanded(child: Text((metadata['aperture'] as String).replaceAll('f', 'ƒ'))),
Expanded(child: Text(metadata['exposureTime'])),
Expanded(child: Text(metadata['focalLength'])),
Expanded(child: Text(metadata['iso'])),
],
);
},
)
],
),
), ),
), ),
); );

View file

@ -16,6 +16,7 @@ class MyApp extends StatelessWidget {
theme: ThemeData( theme: ThemeData(
brightness: Brightness.dark, brightness: Brightness.dark,
accentColor: Colors.amberAccent, accentColor: Colors.amberAccent,
scaffoldBackgroundColor: Colors.grey[900]
), ),
home: HomePage(), home: HomePage(),
); );

View file

@ -103,8 +103,15 @@ class SectionHeader extends StatelessWidget {
child: OutlinedText( child: OutlinedText(
primaryText, primaryText,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.grey[200],
fontSize: 20, fontSize: 20,
shadows: [
Shadow(
offset: Offset(0, 2),
blurRadius: 3,
color: Colors.grey[900]
),
],
), ),
outlineColor: Colors.black87, outlineColor: Colors.black87,
outlineWidth: 2, outlineWidth: 2,