import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; class RowCounts extends StatelessWidget { final name; final int count; final Color c; RowCounts(this.name, this.count, this.c); @override Widget build(BuildContext context) { return Container( padding: EdgeInsets.only(top: 5, bottom: 5), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ dot(c), Expanded( child: Row( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ Expanded( child: AppText( name, color: Colors.black, textAlign: TextAlign.start, // from TextAlign.center fontSize: 11, textOverflow: TextOverflow.ellipsis, ), ), AppText( ' (' + count.toString() + ')', color: Colors.black, textAlign: TextAlign.center, fontSize: 12, fontWeight: FontWeight.bold, ) ], ), ), ], ), ); } Widget dot(Color c) { return Container( padding: EdgeInsets.all(5.0), margin: EdgeInsets.all(5.0), decoration: BoxDecoration(color: c, shape: BoxShape.circle)); } }