git-touch-android-ios-app/lib/widgets/border_view.dart

49 lines
1.1 KiB
Dart
Raw Permalink Normal View History

2022-09-24 20:46:37 +02:00
import 'package:antd_mobile/antd_mobile.dart';
2022-09-17 14:35:45 +02:00
import 'package:flutter/widgets.dart';
2019-10-02 08:58:11 +02:00
class BorderView extends StatelessWidget {
2022-09-06 18:28:12 +02:00
const BorderView({
2019-12-21 14:45:21 +01:00
this.height,
2019-10-02 08:58:11 +02:00
this.leftPadding = 0,
});
2022-09-21 18:28:21 +02:00
final double? height;
final double leftPadding;
2019-10-02 08:58:11 +02:00
@override
Widget build(BuildContext context) {
2019-12-21 14:45:21 +01:00
if (height == null) {
// Physical pixel
return Container(
margin: EdgeInsets.only(left: leftPadding),
decoration: BoxDecoration(
border: Border(
2022-10-04 14:18:04 +02:00
top: BorderSide(color: AntTheme.of(context).colorBorder, width: 1),
2019-12-21 14:45:21 +01:00
),
),
);
}
2019-10-02 08:58:11 +02:00
return Row(
children: <Widget>[
SizedBox(
width: leftPadding,
height: height,
child: DecoratedBox(
2022-09-24 20:46:37 +02:00
decoration:
BoxDecoration(color: AntTheme.of(context).colorBackground),
2019-11-05 14:22:41 +01:00
),
),
Expanded(
child: SizedBox(
height: height,
child: DecoratedBox(
2022-09-24 20:46:37 +02:00
decoration:
BoxDecoration(color: AntTheme.of(context).colorBorder),
2019-11-05 14:22:41 +01:00
),
2019-10-02 08:58:11 +02:00
),
),
],
);
}
}