cofounderella/lib/components/text_with_bold.dart

43 lines
956 B
Dart
Raw Normal View History

import 'package:flutter/material.dart';
class TextWithBold extends StatelessWidget {
final String? leadingText;
final String boldText;
final String? trailingText;
final double? leadingSize;
final double? boldSize;
final double? trailingSize;
const TextWithBold({
super.key,
this.leadingText,
required this.boldText,
this.trailingText,
this.leadingSize,
this.boldSize,
this.trailingSize,
});
@override
Widget build(BuildContext context) {
return Text.rich(
TextSpan(
children: [
TextSpan(
text: leadingText,
style: TextStyle(fontSize: leadingSize),
),
TextSpan(
text: boldText,
style: TextStyle(fontWeight: FontWeight.bold, fontSize: boldSize),
),
TextSpan(
text: trailingText,
style: TextStyle(fontSize: trailingSize),
),
],
),
);
}
}