import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.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: [ Expanded( flex: 2, child: Text( des, style: TextStyle( fontSize: 1.7 * SizeConfig.textMultiplier, color: Hexcolor('#B8382C'), fontWeight: FontWeight.bold), ), ), Expanded( flex: 1, child: Column( children: [ 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: Hexcolor('#B8382C'), ), ), ], ), )) ], ), ) ], ), ), ); } }