info: styled dividers

This commit is contained in:
Thibault Deckers 2019-12-28 01:22:11 +09:00
parent d3f1b2ceb2
commit afdcdc8745
2 changed files with 37 additions and 2 deletions

View file

@ -0,0 +1,34 @@
import 'package:flutter/material.dart';
class ComaDivider extends StatelessWidget {
final Color color;
final Alignment alignment;
const ComaDivider({
this.color = Colors.white70,
this.alignment = Alignment.center,
});
double get peakStop => (alignment.x + 1 / 2).clamp(.02, .98);
@override
Widget build(BuildContext context) {
return Container(
height: 1,
decoration: BoxDecoration(
gradient: LinearGradient(
stops: [
0,
peakStop,
1,
],
colors: [
Colors.transparent,
color,
Colors.transparent,
],
),
),
);
}
}

View file

@ -1,5 +1,6 @@
import 'package:aves/model/image_collection.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';
@ -114,7 +115,7 @@ class SectionRow extends StatelessWidget {
Widget build(BuildContext context) {
return Row(
children: [
const Expanded(child: Divider(color: Colors.white70)),
const Expanded(child: ComaDivider(alignment: Alignment.centerRight)),
Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
@ -125,7 +126,7 @@ class SectionRow extends StatelessWidget {
),
),
),
const Expanded(child: Divider(color: Colors.white70)),
const Expanded(child: ComaDivider(alignment: Alignment.centerLeft)),
],
);
}