text ext add height

null_safety
小赖 4 years ago
parent 0f0ef3a018
commit 588b9b3b4c

@ -21,6 +21,11 @@ extension TextExtension on Text {
); );
} }
Text height(double height) => Text(
this.data,
style: this.style?.heightX(height) ?? TextStyle().heightX(height),
);
Text get white => Text get white =>
Text(this.data, style: this.style?.white ?? TextStyle().white); Text(this.data, style: this.style?.white ?? TextStyle().white);

@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:ansu_ui/styles/as_colors.dart'; import 'package:ansu_ui/styles/as_colors.dart';
extension TextStyleExtension on TextStyle { extension TextStyleExtension on TextStyle {
///Bold text ///Bold text
TextStyle get bold => this.copyWith(fontWeight: FontWeight.bold); TextStyle get bold => this.copyWith(fontWeight: FontWeight.bold);
@ -22,4 +21,6 @@ extension TextStyleExtension on TextStyle {
///FontWeight:w300 ///FontWeight:w300
TextStyle get light => this.copyWith(fontWeight: FontWeight.w300); TextStyle get light => this.copyWith(fontWeight: FontWeight.w300);
TextStyle heightX(double height) => this.copyWith(height: height);
} }

Loading…
Cancel
Save