diff --git a/lib/extension/text_extension.dart b/lib/extension/text_extension.dart new file mode 100644 index 0000000..b64c32a --- /dev/null +++ b/lib/extension/text_extension.dart @@ -0,0 +1,25 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +extension TextExtension on Text { + Text get bold { + return Text( + this.data, + style: this.style.copyWith(fontWeight: FontWeight.bold), + ); + } + + Text size(double size) { + return Text( + this.data, + style: this.style.copyWith(fontSize: size.w), + ); + } + + Text color(Color color) { + return Text( + this.data, + style: this.style.copyWith(color: color), + ); + } +}