2019-10-02 14:58:11 +08:00
|
|
|
import 'package:flutter/material.dart';
|
2019-11-05 21:22:41 +08:00
|
|
|
import 'package:git_touch/models/theme.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
2019-10-02 14:58:11 +08:00
|
|
|
|
|
|
|
class BorderView extends StatelessWidget {
|
2021-05-16 15:16:35 +08:00
|
|
|
final double? height;
|
2019-10-02 14:58:11 +08:00
|
|
|
final double leftPadding;
|
|
|
|
|
2019-11-05 21:22:41 +08:00
|
|
|
BorderView({
|
2019-12-21 21:45:21 +08:00
|
|
|
this.height,
|
2019-10-02 14:58:11 +08:00
|
|
|
this.leftPadding = 0,
|
|
|
|
});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2019-11-05 21:22:41 +08:00
|
|
|
final theme = Provider.of<ThemeModel>(context);
|
2019-10-02 14:58:11 +08:00
|
|
|
|
2019-12-21 21:45:21 +08:00
|
|
|
if (height == null) {
|
|
|
|
// Physical pixel
|
|
|
|
return Container(
|
|
|
|
margin: EdgeInsets.only(left: leftPadding),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
2020-01-27 15:11:51 +08:00
|
|
|
top: BorderSide(color: theme.palette.border, width: 0),
|
2019-12-21 21:45:21 +08:00
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2019-10-02 14:58:11 +08:00
|
|
|
return Row(
|
|
|
|
children: <Widget>[
|
|
|
|
SizedBox(
|
|
|
|
width: leftPadding,
|
|
|
|
height: height,
|
|
|
|
child: DecoratedBox(
|
2020-01-27 15:11:51 +08:00
|
|
|
decoration: BoxDecoration(color: theme.palette.background),
|
2019-11-05 21:22:41 +08:00
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: SizedBox(
|
|
|
|
height: height,
|
|
|
|
child: DecoratedBox(
|
2020-01-27 15:11:51 +08:00
|
|
|
decoration: BoxDecoration(color: theme.palette.border),
|
2019-11-05 21:22:41 +08:00
|
|
|
),
|
2019-10-02 14:58:11 +08:00
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|