exam_title.dart 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import 'package:flutter/material.dart';
  2. class ExamTitle extends StatelessWidget {
  3. const ExamTitle({
  4. super.key,
  5. required this.titleType,
  6. this.label,
  7. this.required,
  8. });
  9. final String? label;
  10. final String titleType;
  11. final bool? required;
  12. @override
  13. Widget build(BuildContext context) {
  14. return Container(
  15. padding: const EdgeInsets.only(
  16. top: 20,
  17. left: 30,
  18. bottom: 10,
  19. ),
  20. child: RichText(
  21. text: TextSpan(
  22. text: '',
  23. children: [
  24. if (required ?? false)
  25. TextSpan(
  26. text: "*",
  27. style: const TextStyle(color: Colors.red, fontSize: 20),
  28. ),
  29. TextSpan(
  30. text: label ?? '',
  31. style: TextStyle(
  32. fontSize: 24,
  33. color: Colors.black,
  34. fontFamily: "NotoSansSC",
  35. fontFamilyFallback: const ["NotoSansSC"],
  36. ),
  37. ),
  38. TextSpan(
  39. text: titleType,
  40. style: const TextStyle(fontSize: 25, color: Colors.grey),
  41. ),
  42. ],
  43. ),
  44. ),
  45. );
  46. }
  47. }