improve vital sign item details
parent
4afca06aec
commit
10877ac658
@ -0,0 +1,79 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../config/size_config.dart';
|
||||
import '../../../../widgets/shared/rounded_container_widget.dart';
|
||||
class VitalSignItem extends StatelessWidget {
|
||||
const VitalSignItem(
|
||||
{Key key,
|
||||
@required this.url,
|
||||
@required this.des,
|
||||
this.lastVal = 'N/A',
|
||||
this.unit = '',
|
||||
this.height,
|
||||
this.width})
|
||||
: super(key: key);
|
||||
|
||||
final String url;
|
||||
final String des;
|
||||
final String lastVal;
|
||||
final String unit;
|
||||
|
||||
final double height;
|
||||
final double width;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return RoundedContainer(
|
||||
margin: 0.025 * SizeConfig.realScreenWidth,
|
||||
height: 0.14 * SizeConfig.realScreenHeight,
|
||||
width: 0.45 * SizeConfig.realScreenWidth,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(5),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Text(
|
||||
des,
|
||||
style: TextStyle(
|
||||
fontSize: 1.7 * SizeConfig.textMultiplier,
|
||||
color: Theme.of(context).primaryColor,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Image.asset(
|
||||
url,
|
||||
height: SizeConfig.heightMultiplier * 7,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
style: TextStyle(color: Colors.black),
|
||||
children: [
|
||||
new TextSpan(text: lastVal),
|
||||
new TextSpan(
|
||||
text: ' ${unit}',
|
||||
style:
|
||||
TextStyle(color: Theme.of(context).primaryColor)),
|
||||
],
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue