pharmacy_mobile/lib/widgets/text_widget.dart
2025-02-03 11:00:42 +08:00

25 lines
767 B
Dart

import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
class TextWidget extends StatelessWidget {
final String text;
final double? size;
final double? opacity;
final bool? bold;
final bool? footer;
const TextWidget({super.key, required this.text, this.size, this.opacity, this.bold, this.footer});
@override
Widget build(BuildContext context) {
final textStyle = TextStyle(
color: Color.fromRGBO(255, 255, 255, opacity ?? 1),
fontSize: size ?? 28,
fontWeight: bold == true ? FontWeight.bold : FontWeight.normal,
);
return footer == true
? Text(text, style: GoogleFonts.inter(textStyle: textStyle))
: Text(text, style: GoogleFonts.outfit(textStyle: textStyle));
}
}