feat: add shake detection functionality (#36)

* feat: add shake detection functionality and integrate vibration support

* feat: add shake detector settings page
This commit is contained in:
Dr.Blank 2024-09-28 01:27:56 -04:00 committed by GitHub
parent 2e3b1de529
commit b229c4f2f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 1423 additions and 158 deletions

View file

@ -0,0 +1,25 @@
extension TitleCase on Enum {
String get properName {
final name = toString().split('.').last;
return name[0].toUpperCase() + name.substring(1);
}
String get titleCase {
return name
.replaceAllMapped(RegExp(r'([A-Z])'), (match) => ' ${match.group(0)}')
.trim();
}
String get pascalCase {
// capitalize the first letter of each word
return name
.replaceAllMapped(
RegExp(r'([A-Z])'),
(match) => ' ${match.group(0)}',
)
.trim()
.split(' ')
.map((word) => word[0].toUpperCase() + word.substring(1))
.join(' ');
}
}