QOL: Align fonsize of text

This commit is contained in:
2025-09-29 10:56:44 +02:00
parent 0f0e19b6f3
commit de4b6e8fcc

View File

@@ -92,7 +92,7 @@ class _MihInfoState extends State<MihInfo> {
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: const TextStyle( style: const TextStyle(
//fontWeight: FontWeight.bold, //fontWeight: FontWeight.bold,
fontSize: 15, fontSize: 17,
), ),
), ),
), ),
@@ -512,116 +512,111 @@ class _MihInfoState extends State<MihInfo> {
} }
Widget displayBusinessCount() { Widget displayBusinessCount() {
return SizedBox( return Column(
// width: 300, mainAxisAlignment: MainAxisAlignment.center,
child: Column( mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, children: [
mainAxisSize: MainAxisSize.min, FutureBuilder<int>(
children: [ future: _futureBusinessCount,
FutureBuilder<int>( builder: (context, snapshot) {
future: _futureBusinessCount, bool isLoading = true;
builder: (context, snapshot) { String userCount = "⚠️";
bool isLoading = true; if (snapshot.connectionState == ConnectionState.waiting) {
String userCount = "⚠️"; isLoading = true;
if (snapshot.connectionState == ConnectionState.waiting) { } else if (snapshot.connectionState == ConnectionState.done &&
isLoading = true; snapshot.hasError) {
} else if (snapshot.connectionState == ConnectionState.done && isLoading = false;
snapshot.hasError) { } else if (snapshot.connectionState == ConnectionState.done &&
isLoading = false; snapshot.hasData) {
} else if (snapshot.connectionState == ConnectionState.done && isLoading = false;
snapshot.hasData) { userCount = snapshot.data.toString();
isLoading = false; } else {
userCount = snapshot.data.toString(); isLoading = true;
} else { }
isLoading = true; return SizedBox(
} child: Text(
return SizedBox( userCount,
child: Text( style: TextStyle(
userCount, fontWeight: FontWeight.bold,
style: TextStyle( fontSize: 23,
fontWeight: FontWeight.bold,
fontSize: 23,
),
), ),
).redacted( ),
context: context, ).redacted(
redact: isLoading, context: context,
configuration: RedactedConfiguration( redact: isLoading,
defaultBorderRadius: BorderRadius.circular(5), configuration: RedactedConfiguration(
redactedColor: MihColors.getSecondaryColor( defaultBorderRadius: BorderRadius.circular(5),
MzansiInnovationHub.of(context)!.theme.mode == "Dark", redactedColor: MihColors.getSecondaryColor(
), MzansiInnovationHub.of(context)!.theme.mode == "Dark",
), ),
); ),
}, );
},
),
Text(
"Businesses",
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.normal,
fontSize: 20,
), ),
Text( ),
"Businesses", ],
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.normal,
fontSize: 20,
),
),
],
),
); );
} }
Widget displayUserCount() { Widget displayUserCount() {
return SizedBox( return Row(
// width: 300, mainAxisAlignment: MainAxisAlignment.center,
child: Column( mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, children: [
mainAxisSize: MainAxisSize.min, FutureBuilder<int>(
children: [ future: _futureUserCount,
FutureBuilder<int>( builder: (context, snapshot) {
future: _futureUserCount, bool isLoading = true;
builder: (context, snapshot) { String userCount = "⚠️";
bool isLoading = true; if (snapshot.connectionState == ConnectionState.waiting) {
String userCount = "⚠️"; isLoading = true;
if (snapshot.connectionState == ConnectionState.waiting) { } else if (snapshot.connectionState == ConnectionState.done &&
isLoading = true; snapshot.hasError) {
} else if (snapshot.connectionState == ConnectionState.done && isLoading = false;
snapshot.hasError) { } else if (snapshot.connectionState == ConnectionState.done &&
isLoading = false; snapshot.hasData) {
} else if (snapshot.connectionState == ConnectionState.done && isLoading = false;
snapshot.hasData) { userCount = snapshot.data.toString();
isLoading = false; } else {
userCount = snapshot.data.toString(); isLoading = true;
} else { }
isLoading = true; return SizedBox(
} child: Text(
return SizedBox( userCount,
child: Text( style: TextStyle(
userCount, fontWeight: FontWeight.bold,
style: TextStyle( fontSize: 23,
fontWeight: FontWeight.bold,
fontSize: 23,
),
), ),
).redacted( ),
context: context, ).redacted(
redact: isLoading, context: context,
configuration: RedactedConfiguration( redact: isLoading,
defaultBorderRadius: BorderRadius.circular(5), configuration: RedactedConfiguration(
redactedColor: MihColors.getSecondaryColor( defaultBorderRadius: BorderRadius.circular(5),
MzansiInnovationHub.of(context)!.theme.mode == "Dark", redactedColor: MihColors.getSecondaryColor(
), MzansiInnovationHub.of(context)!.theme.mode == "Dark",
), ),
); ),
}, );
},
),
const SizedBox(width: 10),
Text(
"Users",
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.normal,
fontSize: 20,
), ),
Text( ),
"Users", ],
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.normal,
fontSize: 20,
),
),
],
),
); );
} }
@@ -675,29 +670,22 @@ class _MihInfoState extends State<MihInfo> {
), ),
), ),
// ===================== Divider // ===================== Divider
Padding( // Padding(
padding: EdgeInsets.symmetric( // padding: EdgeInsets.symmetric(
vertical: 10.0, // vertical: 10.0,
horizontal: 25, // horizontal: 25,
), // ),
child: Divider( // child: Divider(
thickness: 1, // thickness: 1,
color: MihColors.getGreenColor( // color: MihColors.getGreyColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"), // MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
), // ),
),
// const SizedBox(
// height: 10,
// ), // ),
Text( const SizedBox(
"The MIH Family", height: 10,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 25,
),
), ),
Wrap( Wrap(
alignment: WrapAlignment.spaceEvenly, alignment: WrapAlignment.spaceAround,
crossAxisAlignment: WrapCrossAlignment.center, crossAxisAlignment: WrapCrossAlignment.center,
spacing: 25, spacing: 25,
runSpacing: 10, runSpacing: 10,
@@ -706,6 +694,13 @@ class _MihInfoState extends State<MihInfo> {
displayBusinessCount(), displayBusinessCount(),
], ],
), ),
Text(
"The MIH Family",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 25,
),
),
// ===================== Divider // ===================== Divider
Padding( Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
@@ -714,7 +709,7 @@ class _MihInfoState extends State<MihInfo> {
), ),
child: Divider( child: Divider(
thickness: 1, thickness: 1,
color: MihColors.getGreenColor( color: MihColors.getGreyColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"), MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
), ),
), ),
@@ -835,7 +830,7 @@ class _MihInfoState extends State<MihInfo> {
), ),
child: Divider( child: Divider(
thickness: 1, thickness: 1,
color: MihColors.getGreenColor( color: MihColors.getGreyColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"), MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
), ),
), ),
@@ -858,7 +853,7 @@ class _MihInfoState extends State<MihInfo> {
), ),
child: Divider( child: Divider(
thickness: 1, thickness: 1,
color: MihColors.getGreenColor( color: MihColors.getGreyColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"), MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
), ),
), ),