feat(ui_components): add gradient attribut to text wrapper
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Malo Léon 2023-02-10 11:25:39 +01:00
parent 44b2b7c27d
commit 23b608ed10
2 changed files with 9 additions and 3 deletions

View File

@ -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;
}

View File

@ -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;
}