flutter

Text Style helpers

Widget _buildHeadingSub(mainString, subString) {
  return SizedBox(
    // color: Colors.red,
    width: double.infinity,
    child: Column(
      children: <Widget>[
        Text(
          mainString,
          textAlign: TextAlign.center,
          overflow: TextOverflow.ellipsis,
          style: TextStyle(
            fontSize: 20,
            fontWeight: FontWeight.bold,
          ),
        ),
        SizedBox(
          height: 2.0,
        ),
        Text(
          subString,
          textAlign: TextAlign.center,
          overflow: TextOverflow.ellipsis,
          style: TextStyle(
            fontSize: 15,
            color: Colors.grey[600],
          ),
        ),
      ],
    ),
  );
}

// Leading Icon Header
Widget _buildUI() {
  return Row(
    mainAxisAlignment: MainAxisAlignment.start,
    children: <Widget>[
      Icon(Icons.star, size: 50),
      Expanded(
        child: Container(
          color: Colors.green,
          child: Padding(
            child: Text("Some big heading here"),
            padding: EdgeInsets.all(10.0),
          ),
        ),
      ),
    ],
  );
}
Was this helpful?