refactor: asset grid

This commit is contained in:
shenlong-tanwen
2024-09-14 22:29:51 +05:30
parent 53974e7276
commit 6fce1ebb79
23 changed files with 796 additions and 113 deletions
@@ -20,6 +20,12 @@ extension BuildContextHelper on BuildContext {
/// Get the [EdgeInsets] of [MediaQuery]
EdgeInsets get viewInsets => MediaQuery.viewInsetsOf(this);
// Returns the current width from MediaQuery
double get width => mediaQuerySize.width;
// Returns the current height from MediaQuery
double get height => mediaQuerySize.height;
/// True if the current device is a Tablet
bool get isTablet => (mediaQuerySize.width >= 600);
@@ -0,0 +1,11 @@
import 'package:flutter/material.dart';
extension DarkenLightenExtension on Color {
Color lighten({double amount = 0.1}) {
return Color.alphaBlend(Colors.white.withOpacity(amount), this);
}
Color darken({double amount = 0.1}) {
return Color.alphaBlend(Colors.black.withOpacity(amount), this);
}
}
+2 -4
View File
@@ -70,10 +70,8 @@ class ImmichApiClient extends ApiClient with LogContext {
static dynamic _patchDto(dynamic value, String targetType) {
switch (targetType) {
case 'UserPreferencesResponseDto':
if (value is Map) {
if (value['rating'] == null) {
value['rating'] = RatingResponse().toJson();
}
if (value is Map && value['rating'] == null) {
value['rating'] = RatingResponse().toJson();
}
}
}
+1 -1
View File
@@ -19,7 +19,7 @@ class LogManager {
List<LogMessage> _msgBuffer = [];
Timer? _timer;
late StreamSubscription<LogRecord> _subscription;
late final StreamSubscription<LogRecord> _subscription;
void _onLogRecord(LogRecord record) {
// Only print in development