Initial commit: family safety frontend project setup
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
class AppConstants {
|
||||
static const String appName = 'Family Safety';
|
||||
static const String defaultMapsApiKey = 'YOUR_MAPS_API_KEY';
|
||||
|
||||
// Default coordinates (Moscow)
|
||||
static const double defaultLatitude = 55.7558;
|
||||
static const double defaultLongitude = 37.6173;
|
||||
|
||||
// Share link expiration (5 minutes in seconds)
|
||||
static const int shareExpirationSeconds = 300;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
class StringUtil {
|
||||
static bool isValidEmail(String email) {
|
||||
final regExp = RegExp(r'^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)*\.(\w+)$');
|
||||
return regExp.hasMatch(email);
|
||||
}
|
||||
|
||||
static String truncate(String text, int maxLength) {
|
||||
if (text.length <= maxLength) return text;
|
||||
return '${text.substring(0, maxLength)}...';
|
||||
}
|
||||
|
||||
static String formatDateTime(String dateTime) {
|
||||
try {
|
||||
final date = DateTime.parse(dateTime);
|
||||
return '${date.day}/${date.month}/${date.year} '
|
||||
'${date.hour}:${date.minute.toString().padLeft(2, '0')}';
|
||||
} catch (e) {
|
||||
return dateTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user