cod_desc_dropdown_item.dart 728 B

1234567891011121314151617181920212223242526272829303132
  1. import 'package:flutter/material.dart';
  2. class CodDescDropdownItem extends StatelessWidget {
  3. final String? codice;
  4. final String? descrizione;
  5. const CodDescDropdownItem({
  6. super.key,
  7. required this.codice,
  8. required this.descrizione,
  9. });
  10. @override
  11. Widget build(BuildContext context) {
  12. final style = DefaultTextStyle.of(context).style;
  13. return RichText(
  14. text: TextSpan(
  15. children: [
  16. TextSpan(
  17. text: codice ?? '',
  18. style: style.copyWith(fontWeight: FontWeight.bold),
  19. ),
  20. TextSpan(
  21. text: ' ${descrizione ?? ''}',
  22. style: style,
  23. ),
  24. ],
  25. ),
  26. overflow: TextOverflow.ellipsis,
  27. );
  28. }
  29. }