getSiteHeader function
- MissileSite site,
- double wid
Return the top header for the site.
It changes when the state changes and does special processing when the MS.ssDistressed state is entered.
Implementation
Widget getSiteHeader(MissileSite site,double wid) {
String siteName = site.cfg.getHot('siteName') ?? "no-name";
return
Container(
color:Color.fromRGBO(242, 240, 249, 1),
height:MissileSite.bannerHgt,
width:wid+4,
child:
Row(children:[
//Spacer(),
Text("Missile Site: "),
Text("$siteName",style:TextStyle(fontWeight:FontWeight.bold)),
Text(" Site Status: "),
site.watch((SamBuild sb) {
//log("building header ${site.getHot('distressedCtr')}");
if (site.isState(MS.ssDistressed)) {
Color color = ((site.getHot("distressedCtr") as int) % 2 == 0)
? Colors.red
: Colors.orange;
return Text("${site.samState}".substring(5),
style: TextStyle(fontWeight: FontWeight.bold, color: color));
} else {
return Text("${site.samState}".substring(5),
style: TextStyle(fontWeight: FontWeight.bold));
}
})
//Spacer(),
]));
}