getHeader function

Widget getHeader (
  1. String name,
  2. int numBanks,
  3. int depth,
  4. double width,
  5. Color color,
  6. double hdrHgt
)

Return the MissileSite header data for a particulat Missile type.

The values numBanks, width and hdrHgt are used to calculated the dimensions of this section of the header. The color is based on the Missile type as seen in MissileSiteFactory.

Implementation

Widget getHeader(String name,int numBanks,int depth,double width,Color color,double hdrHgt) {
  return Container(
    child: ConstrainedBox(
        constraints: BoxConstraints.expand(height: hdrHgt, width: (width * numBanks) + (2.0 * (numBanks - 1))),
        child: Center(child:Text("${name}s: $depth",style:TextStyle(fontWeight:FontWeight.bold)))
    ),
    decoration: BoxDecoration(color: color,border:Border.all()),
  );
}