first commit

This commit is contained in:
2025-03-03 20:59:42 +03:00
commit 273e68557a
1099 changed files with 17880 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
// 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,
),
);
}
}