initial commit (migrated)
This commit is contained in:
commit
b594facb51
143 changed files with 11057 additions and 0 deletions
20
lib/utilities.dart
Normal file
20
lib/utilities.dart
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
|
||||
void showSnackbar(String message) {
|
||||
final scaffoldMessenger =
|
||||
GetIt.I<GlobalKey<ScaffoldMessengerState>>().currentState;
|
||||
scaffoldMessenger?.showSnackBar(SnackBar(content: Text(message)));
|
||||
}
|
||||
|
||||
Color getColorFromHexString(String hexString) {
|
||||
if (hexString.startsWith('#')) {
|
||||
hexString = hexString.substring(1);
|
||||
}
|
||||
|
||||
if (hexString.length == 6) {
|
||||
hexString = 'FF$hexString';
|
||||
}
|
||||
|
||||
return Color(int.parse(hexString, radix: 16) | 0xFF000000);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue