Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2.  
  3. /// Custom Text with a default font Monospace and a default font size.
  4. class CustomText extends Text {
  5. /// Custom Text Constructor extend of Text constructor.
  6. CustomText(this.dataCustom, {this.styleCustom, this.textAlignCustom})
  7. : super(dataCustom,
  8. style: styleCustom.copyWith(fontFamily: 'Monospace', fontSize: 12));
  9.  
  10. /// The text to display.
  11. ///
  12. /// This will be null if a [textSpan] is provided instead.
  13. final String dataCustom;
  14.  
  15. /// If non-null, the style to use for this text.
  16. ///
  17. /// If the style's "inherit" property is true, the style will be merged with
  18. /// the closest enclosing [DefaultTextStyle]. Otherwise, the style will
  19. /// replace the closest enclosing [DefaultTextStyle].
  20. final TextStyle styleCustom;
  21.  
  22. /// How the text should be aligned horizontally.
  23. final TextAlign textAlignCustom;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement