From f99b15b110d174ed6af97c7c15db10813072c2da Mon Sep 17 00:00:00 2001 From: Daniel Oliveira Date: Wed, 27 Mar 2019 14:16:19 -0300 Subject: [PATCH] Added Capitalize method. --- lib/utils/utils.dart | 9 ++++++++- pubspec.yaml | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index 51bf64c..d7e0724 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -28,4 +28,11 @@ void repeat(int amount, ValueChanged callback) { } } -Color hexToColor(String code) => Color(int.parse(code.substring(1, 7), radix: 16) + 0xFF000000); +Color hexToColor(String code) { + if (code[0] == "#") + return Color(int.parse(code.substring(1, 7), radix: 16) + 0xFF000000); + else + return Color(int.parse(code, radix: 16) + 0xFF000000); +} + +String capitalize(String text) => text[0].toUpperCase() + text.substring(1); diff --git a/pubspec.yaml b/pubspec.yaml index 1b645b8..9a873e0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: shinayser_essentials_flutter description: A new Flutter project. -version: 1.4.1 +version: 1.5.0 author: homepage: