mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-04 03:27:09 -05:00 
			
		
		
		
	* feat(mobile): remote asset & exif sync * add visibility and update constraints * chore: generate drifts * update ids to be strings * clear remote entities on logout * reset sqlite button --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
		
			
				
	
	
		
			32 lines
		
	
	
		
			726 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			726 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
extension StringExtension on String {
 | 
						|
  String capitalize() {
 | 
						|
    return split(" ")
 | 
						|
        .map(
 | 
						|
          (str) => str.isEmpty ? str : str[0].toUpperCase() + str.substring(1),
 | 
						|
        )
 | 
						|
        .join(" ");
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
extension DurationExtension on String {
 | 
						|
  /// Parses and returns the string of format HH:MM:SS as a duration object else null
 | 
						|
  Duration? toDuration() {
 | 
						|
    try {
 | 
						|
      final parts = split(':')
 | 
						|
          .map((e) => double.parse(e).toInt())
 | 
						|
          .toList(growable: false);
 | 
						|
      return Duration(hours: parts[0], minutes: parts[1], seconds: parts[2]);
 | 
						|
    } catch (e) {
 | 
						|
      return null;
 | 
						|
    }
 | 
						|
  }
 | 
						|
 | 
						|
  double toDouble() {
 | 
						|
    return double.parse(this);
 | 
						|
  }
 | 
						|
 | 
						|
  int toInt() {
 | 
						|
    return int.parse(this);
 | 
						|
  }
 | 
						|
}
 |