Hey @mightytechno , I am just learning Flutter. So maybe this is not so good. But Android Studio was complaining that there was no return value:
info: This function has a return type of 'Color', but doesn't end with a return statement.
So I wrote like this:
Color colorConvert(String color) { color = color.replaceAll("#", ""); var converted; if (color.length == 6) { converted = Color(int.parse("0xFF" + color)); } else if (color.length == 8) { converted = Color(int.parse("0x" + color)); } return converted; }
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey @mightytechno ,
I am just learning Flutter. So maybe this is not so good.
But Android Studio was complaining that there was no return value:
So I wrote like this: