fix: physical pixel border

This commit is contained in:
Rongjian Zhang 2019-12-21 21:45:21 +08:00
parent 891ca417cd
commit 42f67c3ed1
2 changed files with 15 additions and 13 deletions

View File

@ -113,7 +113,7 @@ class ThemeModel with ChangeNotifier {
tertiaryText: PrimerColors.gray500,
background: PrimerColors.white,
grayBackground: PrimerColors.gray100,
border: PrimerColors.gray100,
border: Colors.grey.shade400,
);
case Brightness.dark:
return Palette(
@ -123,7 +123,7 @@ class ThemeModel with ChangeNotifier {
tertiaryText: PrimerColors.gray500,
background: PrimerColors.black,
grayBackground: PrimerColors.gray800,
border: PrimerColors.gray900,
border: Colors.grey.shade600,
);
default:
return null;

View File

@ -7,7 +7,7 @@ class BorderView extends StatelessWidget {
final double leftPadding;
BorderView({
this.height = 1,
this.height,
this.leftPadding = 0,
});
@ -15,6 +15,18 @@ class BorderView extends StatelessWidget {
Widget build(BuildContext context) {
final theme = Provider.of<ThemeModel>(context);
if (height == null) {
// Physical pixel
return Container(
margin: EdgeInsets.only(left: leftPadding),
decoration: BoxDecoration(
border: Border(
top: BorderSide(color: theme.palette.border, width: 0),
),
),
);
}
return Row(
children: <Widget>[
SizedBox(
@ -34,15 +46,5 @@ class BorderView extends StatelessWidget {
),
],
);
// Physical pixel
// return Container(
// margin: EdgeInsets.only(left: leftPadding),
// decoration: BoxDecoration(
// border: Border(
// top: BorderSide(color: color, width: height),
// ),
// ),
// );
}
}