throw error for invalid color code

pull/13/head
li3317 4 years ago
parent bf44b9c78f
commit e54787eb23
  1. 3
      lib/widgets/text_line.dart

@ -221,8 +221,7 @@ class TextLine extends StatelessWidget {
} }
if (!s.startsWith('#')) { if (!s.startsWith('#')) {
// give a default color throw("Color code not supported");
return Colors.transparent;
} }
String hex = s.replaceFirst('#', ''); String hex = s.replaceFirst('#', '');

Loading…
Cancel
Save