Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob] lint fixes (#5298)

Prateek Sunal5670de7e0130
diff --git a/mobile/lib/core/constants.dart b/mobile/lib/core/constants.dart
index 58f1fb6963..68247cd0f2 100644
--- a/mobile/lib/core/constants.dart
+++ b/mobile/lib/core/constants.dart
@@ -76,31 +76,31 @@ const maxPickAssetLimit = 50;
const iOSGroupID = "group.io.ente.frame.SlideshowWidget";
const blackThumbnailBase64 = '/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAEBAQEBAQEB'
- 'AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQ'
- 'EBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARC'
- 'ACWASwDAREAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUF'
- 'BAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk' +
- '6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztL' +
- 'W2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAA' +
- 'AAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVY' +
- 'nLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImK' +
- 'kpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oAD' +
- 'AMBAAIRAxEAPwD/AD/6ACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKA' +
- 'CgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACg' +
- 'AoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKAC' +
- 'gAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAo' +
- 'AKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACg' +
- 'AoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACg' +
- 'AoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKA' +
- 'CgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKA' +
- 'CgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoA' +
- 'KACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACg' +
- 'AoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAo' +
- 'AKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKA' +
- 'CgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAK' +
- 'ACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoA' +
- 'KACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAo' +
- 'AKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAo' +
+ 'AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQ'
+ 'EBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARC'
+ 'ACWASwDAREAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUF'
+ 'BAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk'
+ '6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztL'
+ 'W2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAA'
+ 'AAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVY'
+ 'nLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImK'
+ 'kpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oAD'
+ 'AMBAAIRAxEAPwD/AD/6ACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKA'
+ 'CgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACg'
+ 'AoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKAC'
+ 'gAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAo'
+ 'AKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACg'
+ 'AoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACg'
+ 'AoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKA'
+ 'CgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKA'
+ 'CgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoA'
+ 'KACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACg'
+ 'AoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAo'
+ 'AKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKA'
+ 'CgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAK'
+ 'ACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoA'
+ 'KACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAo'
+ 'AKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAo'
'AKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgD/9k=';
const localFileServer =
diff --git a/mobile/lib/core/error-reporting/super_logging.dart b/mobile/lib/core/error-reporting/super_logging.dart
index 643f0d149e..31cd3d9137 100644
--- a/mobile/lib/core/error-reporting/super_logging.dart
+++ b/mobile/lib/core/error-reporting/super_logging.dart
@@ -329,7 +329,10 @@ class SuperLogging {
static var logChunkSize = 800;
static void printLog(String text) {
- text.chunked(logChunkSize).forEach(print);
+ if (kDebugMode) {
+ // ignore: avoid_print
+ text.chunked(logChunkSize).forEach(print);
+ }
}
/// A queue to be consumed by [setupSentry].
@@ -401,7 +404,7 @@ class SuperLogging {
final date = config.dateFmt!.parse(basename(file.path));
dates[file as File] = date;
files.add(file);
- } on FormatException {}
+ } on FormatException catch (_) {}
}
final nowTime = DateTime.now();
@@ -421,7 +424,7 @@ class SuperLogging {
"deleting log file ${file.path}",
);
await file.delete();
- } catch (ignore) {}
+ } catch (_) {}
}
}
diff --git a/mobile/lib/db/collections_db.dart b/mobile/lib/db/collections_db.dart
index c73b9a8e35..9dba8dea72 100644
--- a/mobile/lib/db/collections_db.dart
+++ b/mobile/lib/db/collections_db.dart
@@ -254,6 +254,7 @@ class CollectionsDB {
row[columnOwner] = collection.owner.toJson();
row[columnEncryptedKey] = collection.encryptedKey;
row[columnKeyDecryptionNonce] = collection.keyDecryptionNonce;
+ // ignore: deprecated_member_use_from_same_package
row[columnName] = collection.name;
row[columnEncryptedName] = collection.encryptedName;
row[columnNameDecryptionNonce] = collection.nameDecryptionNonce;
diff --git a/mobile/lib/events/local_photos_updated_event.dart b/mobile/lib/events/local_photos_updated_event.dart
index 0e08407fb9..0abdd774a0 100644
--- a/mobile/lib/events/local_photos_updated_event.dart
+++ b/mobile/lib/events/local_photos_updated_event.dart
@@ -1,9 +1,8 @@
import 'package:photos/events/files_updated_event.dart';
class LocalPhotosUpdatedEvent extends FilesUpdatedEvent {
- LocalPhotosUpdatedEvent(updatedFiles, {type, required source})
+ LocalPhotosUpdatedEvent(super.updatedFiles, {type, required source})
: super(
- updatedFiles,
type: type ?? EventType.addedOrUpdated,
source: source ?? "",
);
diff --git a/mobile/lib/extensions/user_extension.dart b/mobile/lib/extensions/user_extension.dart
index d28e222a7e..20a36030b3 100644
--- a/mobile/lib/extensions/user_extension.dart
+++ b/mobile/lib/extensions/user_extension.dart
@@ -6,6 +6,7 @@ extension UserExtension on User {
String? get displayName =>
PersonService.instance.emailToPartialPersonDataMapCache[email]
?[PersonService.kNameKey] ??
+ // ignore: deprecated_member_use_from_same_package
((name?.isEmpty ?? true) ? null : name);
String? get linkedPersonID =>
diff --git a/mobile/lib/models/api/collection/user.dart b/mobile/lib/models/api/collection/user.dart
index 179756d8c1..30785b0504 100644
--- a/mobile/lib/models/api/collection/user.dart
+++ b/mobile/lib/models/api/collection/user.dart
@@ -23,7 +23,8 @@ class User {
role != null && role?.toUpperCase() == 'COLLABORATOR';
Map<String, dynamic> toMap() {
- return {'id': id, 'email': email, 'name': name, 'role': role};
+ // ignore: deprecated_member_use_from_same_package
+ return {'id': id, 'email': email, 'name': name, "role": role};
}
static fromMap(Map<String, dynamic>? map) {
diff --git a/mobile/lib/models/collection/collection.dart b/mobile/lib/models/collection/collection.dart
index c62c9432d5..fc00570e68 100644
--- a/mobile/lib/models/collection/collection.dart
+++ b/mobile/lib/models/collection/collection.dart
@@ -60,10 +60,12 @@ class Collection {
set sharedMagicMetadata(ShareeMagicMetadata? val) => _sharedMmd = val;
+ // ignore: deprecated_member_use_from_same_package
String get displayName => decryptedName ?? name ?? "Unnamed Album";
// set the value for both name and decryptedName till we finish migration
void setName(String newName) {
+ // ignore: deprecated_member_use_from_same_package
name = newName;
decryptedName = newName;
}
@@ -204,6 +206,7 @@ class Collection {
owner ?? this.owner,
encryptedKey ?? this.encryptedKey,
keyDecryptionNonce ?? this.keyDecryptionNonce,
+ // ignore: deprecated_member_use_from_same_package
name ?? this.name,
encryptedName ?? this.encryptedName,
nameDecryptionNonce ?? this.nameDecryptionNonce,
diff --git a/mobile/lib/services/collections_service.dart b/mobile/lib/services/collections_service.dart
index 7ee743f5ee..979a05a935 100644
--- a/mobile/lib/services/collections_service.dart
+++ b/mobile/lib/services/collections_service.dart
@@ -91,6 +91,7 @@ class CollectionsService {
for (final collection in collections) {
// using deprecated method because the path is stored in encrypted
// format in the DB
+ // ignore: deprecated_member_use_from_same_package
_cacheCollectionAttributes(collection);
}
Bus.instance.on<CollectionUpdatedEvent>().listen((event) {
diff --git a/mobile/lib/services/machine_learning/face_ml/feedback/cluster_feedback.dart b/mobile/lib/services/machine_learning/face_ml/feedback/cluster_feedback.dart
index 09f2066c52..8742970e33 100644
--- a/mobile/lib/services/machine_learning/face_ml/feedback/cluster_feedback.dart
+++ b/mobile/lib/services/machine_learning/face_ml/feedback/cluster_feedback.dart
@@ -616,8 +616,7 @@ class ClusterFeedbackService<T> {
await mlDataDB.getFaceEmbeddingsForCluster(clusterID);
personEmbeddingsProto.addAll(embeddings);
}
- final List<Uint8List> sampledEmbeddingsProto =
- _randomSampleWithoutReplacement(
+ final sampledEmbeddingsProto = _randomSampleWithoutReplacement(
personEmbeddingsProto,
sampleSize,
);
@@ -848,8 +847,8 @@ class ClusterFeedbackService<T> {
);
}
- List<T> _randomSampleWithoutReplacement<T>(
- Iterable<T> embeddings,
+ List<S> _randomSampleWithoutReplacement<S>(
+ Iterable<S> embeddings,
int sampleSize,
) {
final random = Random();
@@ -860,13 +859,13 @@ class ClusterFeedbackService<T> {
// If sampleSize is more than half the list size, shuffle and take first sampleSize elements
if (sampleSize > embeddings.length / 2) {
- final List<T> shuffled = List<T>.from(embeddings)..shuffle(random);
+ final List<S> shuffled = List<S>.from(embeddings)..shuffle(random);
return shuffled.take(sampleSize).toList(growable: false);
}
// Otherwise, use the set-based method for efficiency
final selectedIndices = <int>{};
- final sampledEmbeddings = <T>[];
+ final sampledEmbeddings = <S>[];
while (sampledEmbeddings.length < sampleSize) {
final int index = random.nextInt(embeddings.length);
if (!selectedIndices.contains(index)) {
diff --git a/mobile/lib/services/sync/local_sync_service.dart b/mobile/lib/services/sync/local_sync_service.dart
index d101b99338..69e7a09850 100644
--- a/mobile/lib/services/sync/local_sync_service.dart
+++ b/mobile/lib/services/sync/local_sync_service.dart
@@ -209,7 +209,7 @@ class LocalSyncService {
if (hasAnyMappingChanged || hasUnsyncedFiles) {
Bus.instance.fire(
LocalPhotosUpdatedEvent(
- localDiffResult.uniqueLocalFiles,
+ localDiffResult.uniqueLocalFiles ?? [],
source: "syncAllChange",
),
);
diff --git a/mobile/lib/services/video_memory_service.dart b/mobile/lib/services/video_memory_service.dart
index 9bab841ad2..c8e69ac0a9 100644
--- a/mobile/lib/services/video_memory_service.dart
+++ b/mobile/lib/services/video_memory_service.dart
@@ -216,7 +216,7 @@ String _buildFFmpegCommand(
command.write(
'[$i:v]scale=$scaledWidth:$scaledHeight:force_original_aspect_ratio=decrease,'
'pad=$screenWidth:$screenHeight:(ow-iw)/2:(oh-ih)/2,'
- 'zoompan=z=\'zoom+0.001\':x=\'iw/2-(iw/zoom/2)\':y=\'ih/2-(ih/zoom/2)\':d=150:s=${screenWidth}x${screenHeight}:fps=60[v$i];',
+ 'zoompan=z=\'zoom+0.001\':x=\'iw/2-(iw/zoom/2)\':y=\'ih/2-(ih/zoom/2)\':d=150:s=${screenWidth}x$screenHeight:fps=60[v$i];',
);
}
diff --git a/mobile/lib/ui/cast/auto.dart b/mobile/lib/ui/cast/auto.dart
index bb1fc465b6..e5039c6c95 100644
--- a/mobile/lib/ui/cast/auto.dart
+++ b/mobile/lib/ui/cast/auto.dart
@@ -12,10 +12,10 @@ class AutoCastDialog extends StatefulWidget {
// async method that takes string as input
// and returns void
final void Function(String) onConnect;
- AutoCastDialog(
+ const AutoCastDialog(
this.onConnect, {
super.key,
- }) {}
+ });
@override
State<AutoCastDialog> createState() => _AutoCastDialogState();
diff --git a/mobile/lib/ui/common/progress_dialog.dart b/mobile/lib/ui/common/progress_dialog.dart
index b6f2efbcb6..f4b5ad2681 100644
--- a/mobile/lib/ui/common/progress_dialog.dart
+++ b/mobile/lib/ui/common/progress_dialog.dart
@@ -202,6 +202,7 @@ class _Body extends StatefulWidget {
@override
State<StatefulWidget> createState() {
+ // ignore: no_logic_in_create_state
return _dialog;
}
}
diff --git a/mobile/lib/ui/components/bottom_action_bar/expanded_menu_widget.dart b/mobile/lib/ui/components/bottom_action_bar/expanded_menu_widget.dart
index e8d0002060..4f491cdffd 100644
--- a/mobile/lib/ui/components/bottom_action_bar/expanded_menu_widget.dart
+++ b/mobile/lib/ui/components/bottom_action_bar/expanded_menu_widget.dart
@@ -11,10 +11,13 @@ class ExpandedMenuWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
- double textScaleFactor = MediaQuery.of(context).textScaleFactor;
- textScaleFactor < 1.0 ? textScaleFactor = 1.0 : null;
+ final textScaler = MediaQuery.of(context).textScaler;
//20 is height of font and 28 is total whitespace (top+bottom)
- final double itemHeight = (20.0 * textScaleFactor) + 28.0;
+ var scaledHeight = textScaler.scale(20);
+ if (scaledHeight < 20) {
+ scaledHeight = 20;
+ }
+ final double itemHeight = scaledHeight + 28.0;
const double whiteSpaceBetweenSections = 16.0;
const double dividerHeightBetweenItems = 1.0;
double numberOfDividers = 0.0;
diff --git a/mobile/lib/ui/components/notification_widget.dart b/mobile/lib/ui/components/notification_widget.dart
index aeaf71e70c..152f9044d3 100644
--- a/mobile/lib/ui/components/notification_widget.dart
+++ b/mobile/lib/ui/components/notification_widget.dart
@@ -43,7 +43,7 @@ class NotificationWidget extends StatelessWidget {
Widget build(BuildContext context) {
final colorScheme = getEnteColorScheme(context);
EnteTextTheme textTheme = getEnteTextTheme(context);
- TextStyle _mainTextStyle = mainTextStyle ?? darkTextTheme.bodyBold;
+ TextStyle mainTextStyle = this.mainTextStyle ?? darkTextTheme.bodyBold;
TextStyle subTextStyle = darkTextTheme.miniMuted;
LinearGradient? backgroundGradient;
Color? backgroundColor;
@@ -56,7 +56,7 @@ class NotificationWidget extends StatelessWidget {
case NotificationType.banner:
textTheme = getEnteTextTheme(context);
backgroundColor = colorScheme.backgroundElevated2;
- _mainTextStyle = textTheme.bodyBold;
+ mainTextStyle = textTheme.bodyBold;
subTextStyle = textTheme.miniMuted;
strokeColorScheme = colorScheme;
boxShadow = [
@@ -86,7 +86,7 @@ class NotificationWidget extends StatelessWidget {
break;
case NotificationType.notice:
backgroundColor = colorScheme.backgroundElevated2;
- _mainTextStyle = textTheme.bodyBold;
+ mainTextStyle = textTheme.bodyBold;
subTextStyle = textTheme.miniMuted;
strokeColorScheme = colorScheme;
boxShadow = Theme.of(context).colorScheme.enteTheme.shadowMenu;
@@ -147,7 +147,7 @@ class NotificationWidget extends StatelessWidget {
children: [
Text(
text,
- style: _mainTextStyle,
+ style: mainTextStyle,
textAlign: TextAlign.left,
),
subText != null
diff --git a/mobile/lib/ui/huge_listview/draggable_scrollbar.dart b/mobile/lib/ui/huge_listview/draggable_scrollbar.dart
index 0c54170f54..4c9186fc26 100644
--- a/mobile/lib/ui/huge_listview/draggable_scrollbar.dart
+++ b/mobile/lib/ui/huge_listview/draggable_scrollbar.dart
@@ -179,8 +179,8 @@ class DraggableScrollbarState extends State<DraggableScrollbar>
setState(() => isDragging = false);
}
- void keyHandler(RawKeyEvent value) {
- if (value.runtimeType == RawKeyDownEvent) {
+ void keyHandler(KeyEvent value) {
+ if (value.runtimeType == KeyDownEvent) {
if (value.logicalKey == LogicalKeyboardKey.arrowDown) {
onDragUpdate(
DragUpdateDetails(
diff --git a/mobile/lib/ui/map/tile/layers.dart b/mobile/lib/ui/map/tile/layers.dart
index 7c1a5a1846..2597dddea2 100644
--- a/mobile/lib/ui/map/tile/layers.dart
+++ b/mobile/lib/ui/map/tile/layers.dart
@@ -102,7 +102,6 @@ class MapBoxTilesLayer extends StatelessWidget {
fallbackUrl: 'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
subdomains: const ['a', 'b', 'c'],
backgroundColor: Colors.transparent,
-
userAgentPackageName: _userAgent,
tileProvider: CachedNetworkTileProvider(),
additionalOptions: const {
diff --git a/mobile/lib/ui/payment/payment_web_page.dart b/mobile/lib/ui/payment/payment_web_page.dart
index a19536a59d..23b1b66a74 100644
--- a/mobile/lib/ui/payment/payment_web_page.dart
+++ b/mobile/lib/ui/payment/payment_web_page.dart
@@ -54,7 +54,7 @@ class _PaymentWebPageState extends State<PaymentWebPage> {
}
return PopScope(
canPop: false,
- onPopInvoked: (didPop) async {
+ onPopInvokedWithResult: (didPop, _) async {
if (didPop) return;
final shouldPop = await _buildPageExitWidget(context);
if (shouldPop) {
diff --git a/mobile/lib/ui/payment/subscription_common_widgets.dart b/mobile/lib/ui/payment/subscription_common_widgets.dart
index faa4ebd1ac..d8ebfdfbcc 100644
--- a/mobile/lib/ui/payment/subscription_common_widgets.dart
+++ b/mobile/lib/ui/payment/subscription_common_widgets.dart
@@ -117,7 +117,7 @@ class ValidityWidget extends StatelessWidget {
),
const SizedBox(height: 8),
if (addOnBonus.isNotEmpty)
- ...addOnBonus.map((bonus) => AddOnBonusValidity(bonus)).toList(),
+ ...addOnBonus.map((bonus) => AddOnBonusValidity(bonus)),
],
),
);
diff --git a/mobile/lib/ui/tabs/home_widget.dart b/mobile/lib/ui/tabs/home_widget.dart
index f4849b0136..dff167fb3e 100644
--- a/mobile/lib/ui/tabs/home_widget.dart
+++ b/mobile/lib/ui/tabs/home_widget.dart
@@ -581,7 +581,7 @@ class _HomeWidgetState extends State<HomeWidget> {
return UserDetailsStateWidget(
child: PopScope(
canPop: false,
- onPopInvoked: (didPop) async {
+ onPopInvokedWithResult: (didPop, _) async {
if (didPop) return;
if (_selectedTabIndex == 0) {
if (_selectedFiles.files.isNotEmpty) {
diff --git a/mobile/lib/ui/tools/editor/image_editor_page.dart b/mobile/lib/ui/tools/editor/image_editor_page.dart
index 686044d21c..15f9e32041 100644
--- a/mobile/lib/ui/tools/editor/image_editor_page.dart
+++ b/mobile/lib/ui/tools/editor/image_editor_page.dart
@@ -66,7 +66,7 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
Widget build(BuildContext context) {
return PopScope(
canPop: false,
- onPopInvoked: (didPop) async {
+ onPopInvokedWithResult: (didPop, _) async {
if (_hasBeenEdited()) {
await _showExitConfirmationDialog(context);
} else {
@@ -358,11 +358,11 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
//Disabling notifications for assets changing to insert the file into
//files db before triggering a sync.
await PhotoManager.stopChangeNotify();
- final AssetEntity? newAsset =
+ final AssetEntity newAsset =
await (PhotoManager.editor.saveImage(result, filename: fileName));
final newFile = await ente.EnteFile.fromAsset(
widget.originalFile.deviceFolder ?? '',
- newAsset!,
+ newAsset,
);
newFile.creationTime = widget.originalFile.creationTime;
diff --git a/mobile/lib/ui/tools/editor/video_editor_page.dart b/mobile/lib/ui/tools/editor/video_editor_page.dart
index 5abf738ad9..121f2aea35 100644
--- a/mobile/lib/ui/tools/editor/video_editor_page.dart
+++ b/mobile/lib/ui/tools/editor/video_editor_page.dart
@@ -99,7 +99,7 @@ class _VideoEditorPageState extends State<VideoEditorPage> {
Widget build(BuildContext context) {
return PopScope(
canPop: false,
- onPopInvoked: (didPop) {
+ onPopInvokedWithResult: (didPop, _) {
if (!didPop) {
if (_isExporting.value) {
return;
diff --git a/mobile/lib/ui/viewer/actions/file_selection_overlay_bar.dart b/mobile/lib/ui/viewer/actions/file_selection_overlay_bar.dart
index 4b78c5adf9..e21c161888 100644
--- a/mobile/lib/ui/viewer/actions/file_selection_overlay_bar.dart
+++ b/mobile/lib/ui/viewer/actions/file_selection_overlay_bar.dart
@@ -98,7 +98,7 @@ class _FileSelectionOverlayBarState extends State<FileSelectionOverlayBar> {
? _body()
: PopScope(
canPop: false,
- onPopInvoked: (didPop) {
+ onPopInvokedWithResult: (didPop, _) {
if (!didPop) {
if (widget.selectedFiles.files.isEmpty) {
Navigator.of(context).pop();
diff --git a/mobile/lib/ui/viewer/file/detail_page.dart b/mobile/lib/ui/viewer/file/detail_page.dart
index 82c9eb14a0..9ee0fa222f 100644
--- a/mobile/lib/ui/viewer/file/detail_page.dart
+++ b/mobile/lib/ui/viewer/file/detail_page.dart
@@ -139,7 +139,7 @@ class _DetailPageState extends State<DetailPage> {
return InheritedDetailPageState(
child: PopScope(
canPop: !isGuestView,
- onPopInvoked: (didPop) async {
+ onPopInvokedWithResult: (didPop, _) async {
if (isGuestView) {
final authenticated = await _requestAuthentication();
if (authenticated) {
diff --git a/mobile/lib/ui/viewer/file/panorama_viewer_screen.dart b/mobile/lib/ui/viewer/file/panorama_viewer_screen.dart
index e47c86c344..855faa66e0 100644
--- a/mobile/lib/ui/viewer/file/panorama_viewer_screen.dart
+++ b/mobile/lib/ui/viewer/file/panorama_viewer_screen.dart
@@ -3,6 +3,7 @@ import "dart:io";
import "package:flutter/material.dart";
import "package:flutter/services.dart";
+// ignore: implementation_imports
import "package:motion_photos/src/xmp_extractor.dart";
import "package:panorama/panorama.dart";
import "package:photos/generated/l10n.dart";
diff --git a/mobile/lib/ui/viewer/location/update_location_data_widget.dart b/mobile/lib/ui/viewer/location/update_location_data_widget.dart
index 16414270d1..48f19fc1b8 100644
--- a/mobile/lib/ui/viewer/location/update_location_data_widget.dart
+++ b/mobile/lib/ui/viewer/location/update_location_data_widget.dart
@@ -107,7 +107,7 @@ class _UpdateLocationDataWidgetState extends State<UpdateLocationDataWidget> {
return locationInDMS != null
? ConstrainedBox(
constraints: BoxConstraints(
- minWidth: 80 * MediaQuery.textScaleFactorOf(context),
+ minWidth: MediaQuery.textScalerOf(context).scale(80),
),
child: Column(
children: [
diff --git a/mobile/lib/utils/exif_util.dart b/mobile/lib/utils/exif_util.dart
index a94e02bece..4ceb76d001 100644
--- a/mobile/lib/utils/exif_util.dart
+++ b/mobile/lib/utils/exif_util.dart
@@ -10,6 +10,7 @@ import "package:ffmpeg_kit_flutter_full_gpl/media_information_session.dart";
import "package:flutter/foundation.dart";
import 'package:intl/intl.dart';
import 'package:logging/logging.dart';
+// ignore: implementation_imports
import "package:motion_photos/src/xmp_extractor.dart";
import "package:photos/models/ffmpeg/ffprobe_props.dart";
import 'package:photos/models/file/file.dart';
diff --git a/mobile/lib/utils/ffprobe_util.dart b/mobile/lib/utils/ffprobe_util.dart
index ae49b295de..040ef69258 100644
--- a/mobile/lib/utils/ffprobe_util.dart
+++ b/mobile/lib/utils/ffprobe_util.dart
@@ -49,7 +49,7 @@ class FFProbeUtil {
final streams = props[streamsKey];
if (streams is List) {
- streams.forEach((stream) {
+ for (var stream in streams) {
if (stream is Map) {
_normalizeGroup(stream);
@@ -88,7 +88,7 @@ class FFProbeUtil {
stream[FFProbeKeys.streamType] = MediaStreamTypes.metadata;
}
}
- });
+ }
}
return props;
}
@@ -114,7 +114,7 @@ class FFProbeUtil {
stream.addAll(tags);
}
- <String>{
+ for (var key in <String>{
FFProbeKeys.codecProfileId,
FFProbeKeys.rFrameRate,
'bits_per_sample',
@@ -125,7 +125,7 @@ class FFProbeUtil {
'start_pts',
'start_time',
'vendor_id',
- }.forEach((key) {
+ }) {
final value = stream[key];
switch (value) {
case final num v:
@@ -140,6 +140,6 @@ class FFProbeUtil {
stream.remove(key);
}
}
- });
+ }
}
}
diff --git a/mobile/lib/utils/panorama_util.dart b/mobile/lib/utils/panorama_util.dart
index cb6ba57006..3a583c2809 100644
--- a/mobile/lib/utils/panorama_util.dart
+++ b/mobile/lib/utils/panorama_util.dart
@@ -1,3 +1,4 @@
+// ignore: implementation_imports
import "package:motion_photos/src/xmp_extractor.dart";
import "package:photos/models/file/extensions/file_props.dart";
import "package:photos/models/file/file.dart";
diff --git a/mobile/plugins/ente_cast_normal/lib/src/service.dart b/mobile/plugins/ente_cast_normal/lib/src/service.dart
index 8a1f2aaf16..97fe624fd9 100644
--- a/mobile/plugins/ente_cast_normal/lib/src/service.dart
+++ b/mobile/plugins/ente_cast_normal/lib/src/service.dart
@@ -2,6 +2,7 @@ import "dart:developer" as dev;
import "package:cast/cast.dart";
import "package:ente_cast/ente_cast.dart";
+import "package:flutter/foundation.dart";
import "package:flutter/material.dart";
class CastServiceImpl extends CastService {
@@ -35,7 +36,9 @@ class CastServiceImpl extends CastService {
},
);
} else {
- print('receive message: $message');
+ if (kDebugMode) {
+ print('receive message: $message');
+ }
}
}
});
diff --git a/mobile/pubspec.lock b/mobile/pubspec.lock
index a1ef8a618b..2e6ab58e41 100644
--- a/mobile/pubspec.lock
+++ b/mobile/pubspec.lock
@@ -789,7 +789,7 @@ packages:
source: hosted
version: "0.6.0"
flutter_driver:
- dependency: transitive
+ dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
@@ -2160,7 +2160,7 @@ packages:
source: hosted
version: "3.1.0"
provider:
- dependency: "direct main"
+ dependency: transitive
description:
name: provider
sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c
diff --git a/mobile/pubspec.yaml b/mobile/pubspec.yaml
index a9fd578036..36f5497497 100644
--- a/mobile/pubspec.yaml
+++ b/mobile/pubspec.yaml
@@ -167,7 +167,6 @@ dependencies:
url: https://github.com/ente-io/privacy_screen.git
ref: pb/FIX-obsolete-android-plugin
protobuf: ^3.1.0
- provider: ^6.0.0
quiver: ^3.0.1
receive_sharing_intent: # update source if there is any update
git:
@@ -258,6 +257,8 @@ flutter_intl:
dev_dependencies:
build_runner: ^2.4.7
+ flutter_driver:
+ sdk: flutter
flutter_lints: ^3.0.1
flutter_test:
sdk: flutter