feat(ui_components): add gradient attribut to text wrapper
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
44b2b7c27d
commit
23b608ed10
@ -18,6 +18,7 @@ import 'package:flutter/widgets.dart';
|
||||
import 'package:wyatt_ui_components/src/core/utils/text_wrapper.dart';
|
||||
|
||||
extension StringExtension on String? {
|
||||
TextWrapper? wrap({TextStyle? style}) =>
|
||||
this != null ? TextWrapper(this!, style: style) : null;
|
||||
TextWrapper? wrap({TextStyle? style, List<Color>? gradient}) => this != null
|
||||
? TextWrapper(this!, style: style, gradient: gradient)
|
||||
: null;
|
||||
}
|
||||
|
@ -17,10 +17,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TextWrapper {
|
||||
const TextWrapper(this.text, {this.style});
|
||||
const TextWrapper(
|
||||
this.text, {
|
||||
this.style,
|
||||
this.gradient,
|
||||
});
|
||||
|
||||
factory TextWrapper.text(String text) => TextWrapper(text);
|
||||
|
||||
final String text;
|
||||
final TextStyle? style;
|
||||
final List<Color>? gradient;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user