followWidget method
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,
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 toUtils.appFontFamily.interFontFamily.countFontWeight: Font weight for count. Defaults toUtils.appConstants.followFollowingCountFontWeight.labelFontWeight: Font weight for label. Defaults toUtils.appConstants.followFollowingTitleFontWeight.labelFontFamily: Font family for label. Defaults toUtils.appFontFamily.textMainFontRegular.countFontSize: Font size for count. Defaults toUtils.appFontFamily.textSelectStateSize.labelFontSize: Font size for label. Defaults toUtils.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))
],
);
}