feat(ui_kit): add multicolor support in linear gradient helper

This commit is contained in:
Hugo Pointcheval 2023-02-14 12:50:17 +01:00
parent 4695cf0618
commit 82eeba4d7d
Signed by: hugo
GPG Key ID: 3AAC487E131E00BC

View File

@ -15,8 +15,12 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
class LinearGradientHelper {
static LinearGradient? fromNullableColors(List<Color>? colors) =>
colors != null ? LinearGradient(colors: colors) : null;
static LinearGradient? fromMultiColor(MultiColor multiColor) =>
multiColor.isGradient ? LinearGradient(colors: multiColor.colors) : null;
}