master #81
@ -18,6 +18,7 @@ import 'package:flutter/widgets.dart';
|
|||||||
import 'package:wyatt_ui_components/src/core/utils/text_wrapper.dart';
|
import 'package:wyatt_ui_components/src/core/utils/text_wrapper.dart';
|
||||||
|
|
||||||
extension StringExtension on String? {
|
extension StringExtension on String? {
|
||||||
TextWrapper? wrap({TextStyle? style}) =>
|
TextWrapper? wrap({TextStyle? style, List<Color>? gradient}) => this != null
|
||||||
this != null ? TextWrapper(this!, style: style) : null;
|
? TextWrapper(this!, style: style, gradient: gradient)
|
||||||
|
: null;
|
||||||
}
|
}
|
||||||
|
@ -17,10 +17,15 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class TextWrapper {
|
class TextWrapper {
|
||||||
const TextWrapper(this.text, {this.style});
|
const TextWrapper(
|
||||||
|
this.text, {
|
||||||
|
this.style,
|
||||||
|
this.gradient,
|
||||||
|
});
|
||||||
|
|
||||||
factory TextWrapper.text(String text) => TextWrapper(text);
|
factory TextWrapper.text(String text) => TextWrapper(text);
|
||||||
|
|
||||||
final String text;
|
final String text;
|
||||||
final TextStyle? style;
|
final TextStyle? style;
|
||||||
|
final List<Color>? gradient;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user