// Flutter imports: import 'package:flutter/material.dart' show Color; /// /// Расширение для работы со строками /// extension MString on String { /// /// Слово с заглавной буквы /// String capitalyze() { final String str = toLowerCase(); final String first = str.substring(0, 1); return '${first.toUpperCase()}${str.substring(1)}'; } /// /// Парсинг hex string в color /// Color get toColor { String res = replaceFirst('#', ''); return Color( int.parse( res.length == 8 ? res : (res.length == 6 ? 'FF$res' : res), radix: 16, ), ); } }