followWidget method

Widget followWidget({
  1. required String count,
  2. required String label,
  3. MaterialColor countColor = Colors.blue,
  4. MaterialColor labelColor = Colors.blue,
  5. String? countFontFamily,
  6. FontWeight? countFontWeight,
  7. FontWeight? labelFontWeight,
  8. String? labelFontFamily,
  9. double? countFontSize,
  10. double? labelFontSize,
})

Creates a follower/following widget with count and label.

Displays a numerical count above a descriptive label in a vertical column layout. Commonly used in social media profiles to show follower counts, post counts, etc.

Parameters:

  • count: The numerical value to display (as a string).
  • label: The descriptive label below the count.
  • countColor: Color for the count text (defaults to blue).
  • labelColor: Color for the label text (defaults to blue).
  • countFontFamily: Font family for count. Defaults to Utils.appFontFamily.interFontFamily.
  • countFontWeight: Font weight for count. Defaults to Utils.appConstants.followFollowingCountFontWeight.
  • labelFontWeight: Font weight for label. Defaults to Utils.appConstants.followFollowingTitleFontWeight.
  • labelFontFamily: Font family for label. Defaults to Utils.appFontFamily.textMainFontRegular.
  • countFontSize: Font size for count. Defaults to Utils.appFontFamily.textSelectStateSize.
  • labelFontSize: Font size for label. Defaults to Utils.appFontFamily.textMediumFontSize.

Returns a Column widget with count and label.

The label includes custom letter spacing and line height from Utils.appConstants.

Example:

followWidget(
  count: '1.2K',
  label: 'Followers',
  countColor: Colors.black,
  labelColor: Colors.grey,
);

Implementation

Widget followWidget(
    {required String count,
    required String label,
    MaterialColor countColor = Colors.blue,
    MaterialColor labelColor = Colors.blue,
    String? countFontFamily,
    FontWeight? countFontWeight,
    FontWeight? labelFontWeight,
    String? labelFontFamily,
    double? countFontSize,
    double? labelFontSize}) {
  return Column(
    children: <Widget>[
      Text(count,
          style: TextStyle(
              fontFamily:
                  countFontFamily ?? Utils.appFontFamily.interFontFamily,
              fontWeight: countFontWeight ??
                  Utils.appConstants.followFollowingCountFontWeight,
              fontSize:
                  countFontSize ?? Utils.appFontFamily.textSelectStateSize,
              color: countColor)),
      Text(label,
          style: TextStyle(
              letterSpacing: Utils.appConstants.textLetterSpacing,
              height: Utils.appConstants.textLineHeight,
              fontSize:
                  labelFontSize ?? Utils.appFontFamily.textMediumFontSize,
              color: labelColor,
              fontWeight: labelFontWeight ??
                  Utils.appConstants.followFollowingTitleFontWeight,
              fontFamily:
                  labelFontFamily ?? Utils.appFontFamily.textMainFontRegular))
    ],
  );
}