t static method

Widget t(
  1. String? s, {
  2. TextAlign textAlign = TextAlign.left,
  3. TextDecoration? textDecoration = TextDecoration.none,
  4. Color? color,
  5. Color? backgroundColor,
  6. double? dimen,
  7. String? fontFamily,
  8. EdgeInsets? margin,
  9. EdgeInsets? padding,
  10. Decoration? decoration,
  11. double? width,
  12. double? height,
  13. TemplateSize? templateSize,
  14. Alignment? gravityLayoutAlign,
  15. VoidCallback? onPressed,
  16. LevelDS levelDS = LevelDS.l1,
  17. int? maxLines,
  18. bool? selectedTextAllow,
})

"t" : means template

Implementation

static Widget t(String?  s ,  {
  TextAlign textAlign = TextAlign.left,
  TextDecoration? textDecoration = TextDecoration.none,
  Color? color  ,
  Color? backgroundColor  ,
  double? dimen ,
  String? fontFamily,
  EdgeInsets? margin,
  EdgeInsets? padding,

  Decoration? decoration, // must before use this use also width fixed and height
  double? width,
  double? height,

  TemplateSize? templateSize,
  Alignment? gravityLayoutAlign, //container alignment
  VoidCallback? onPressed,
  LevelDS levelDS = LevelDS.l1,

  //lines
  int? maxLines,

  //web allow select text by mounse
  bool? selectedTextAllow,

})  {

  double dime_ds = DesignSystemTools.getDimenDesignSystem_text(levelDS, dimen);
  Color color_ds = DesignSystemTools.getColorDesignSystem_text(levelDS, color);
 String font_ds = DesignSystemTools.getFontDesignSystem_text(levelDS, fontFamily );

 //Log.i( "string: " + s.toString() + " /dime_ds: " + dime_ds.toString() );

  //check found color
  if( backgroundColor != null ) {
    decoration = BoarderHelper.rounded( radiusSize: 0, colorBackground: backgroundColor);
  }

  //get text
  return BaseTextTemplate.normal(s, textAlign: textAlign,
      colorOpt: color_ds,textDecoration: textDecoration, dimenOpt: dime_ds, fontFamily: font_ds,
      margin: margin, padding: padding,
      selectedTextAllow: selectedTextAllow,
      decoration_background: decoration, templateSize: templateSize, align:  gravityLayoutAlign,
      onPressed: onPressed, width:  width, height:  height, maxLines: maxLines, dsLevel : levelDS);

}