From 9487cc1bc60e7c5025ae459e48f36c85aa0fdcfc Mon Sep 17 00:00:00 2001 From: Rongjian Zhang Date: Sat, 28 Sep 2019 23:45:56 +0800 Subject: [PATCH] fix: physical pixel border --- lib/utils/utils.dart | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index c29fe66..ffd75f3 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -128,31 +128,20 @@ class BorderView extends StatelessWidget { final double leftPadding; const BorderView({ - this.height = 1, - this.color = PrimerColors.gray100, + this.height = 0, // One physical pixel. + this.color = PrimerColors.gray500, this.leftPadding = 0, }); @override Widget build(BuildContext context) { - return Row( - children: [ - SizedBox( - width: leftPadding, - height: 1, - child: DecoratedBox( - decoration: BoxDecoration(color: PrimerColors.white), - ), + return Container( + margin: EdgeInsets.only(left: leftPadding), + decoration: BoxDecoration( + border: Border( + top: BorderSide(color: color, width: height), ), - Expanded( - child: SizedBox( - height: height, - child: DecoratedBox( - decoration: BoxDecoration(color: color), - ), - ), - ), - ], + ), ); } }