Skip to content

Commit

Permalink
Added Capitalize method.
Browse files Browse the repository at this point in the history
  • Loading branch information
shinayser committed Mar 27, 2019
1 parent 86422d5 commit f99b15b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion lib/utils/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,11 @@ void repeat(int amount, ValueChanged<int> 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);
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: shinayser_essentials_flutter
description: A new Flutter project.
version: 1.4.1
version: 1.5.0
author:
homepage:

Expand Down

0 comments on commit f99b15b

Please sign in to comment.