Skip to content

armgit / ente

Public Imported from GitHub
0

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

strict_top_level_inference tranche 1: import-free annotations

Manav Rathi12035d205a01
diff --git a/mobile/apps/auth/lib/ui/components/buttons/button_widget.dart b/mobile/apps/auth/lib/ui/components/buttons/button_widget.dart
index 6577621fb2..ca233b825d 100644
--- a/mobile/apps/auth/lib/ui/components/buttons/button_widget.dart
+++ b/mobile/apps/auth/lib/ui/components/buttons/button_widget.dart
@@ -518,7 +518,7 @@ class _ButtonChildWidgetState extends State<ButtonChildWidget> {
}
}
- void _onTapDown(details) {
+ void _onTapDown(TapDownDetails details) {
setState(() {
buttonColor =
widget.buttonStyle.pressedButtonColor ??
@@ -535,7 +535,7 @@ class _ButtonChildWidgetState extends State<ButtonChildWidget> {
});
}
- void _onTapUp(details) {
+ void _onTapUp(TapUpDetails details) {
Future.delayed(
const Duration(milliseconds: 84),
() => setState(() {
diff --git a/mobile/apps/auth/lib/ui/components/buttons/icon_button_widget.dart b/mobile/apps/auth/lib/ui/components/buttons/icon_button_widget.dart
index d8680d7150..4f94ae6ef2 100644
--- a/mobile/apps/auth/lib/ui/components/buttons/icon_button_widget.dart
+++ b/mobile/apps/auth/lib/ui/components/buttons/icon_button_widget.dart
@@ -88,7 +88,7 @@ class _IconButtonWidgetState extends State<IconButtonWidget> {
);
}
- void _onTapDown(details) {
+ void _onTapDown(TapDownDetails details) {
final colorTheme = getEnteColorScheme(context);
setState(() {
iconStateColor =
@@ -99,7 +99,7 @@ class _IconButtonWidgetState extends State<IconButtonWidget> {
});
}
- void _onTapUp(details) {
+ void _onTapUp(TapUpDetails details) {
Future.delayed(const Duration(milliseconds: 100), () {
setState(() {
iconStateColor = null;
diff --git a/mobile/apps/auth/lib/ui/components/menu_item_widget.dart b/mobile/apps/auth/lib/ui/components/menu_item_widget.dart
index 988dc8d83b..a3965c5389 100644
--- a/mobile/apps/auth/lib/ui/components/menu_item_widget.dart
+++ b/mobile/apps/auth/lib/ui/components/menu_item_widget.dart
@@ -243,7 +243,7 @@ class _MenuItemWidgetState extends State<MenuItemWidget> {
}
}
- void _onTapDown(details) {
+ void _onTapDown(TapDownDetails details) {
if (executionStateNotifier.value == ExecutionState.inProgress ||
executionStateNotifier.value == ExecutionState.successful) {
return;
@@ -263,7 +263,7 @@ class _MenuItemWidgetState extends State<MenuItemWidget> {
return widget.onDoubleTap != null || widget.onTap != null;
}
- void _onTapUp(details) {
+ void _onTapUp(TapUpDetails details) {
if (executionStateNotifier.value == ExecutionState.inProgress ||
executionStateNotifier.value == ExecutionState.successful) {
return;
diff --git a/mobile/apps/locker/lib/services/files/sync/models/file.dart b/mobile/apps/locker/lib/services/files/sync/models/file.dart
index c5e04975cb..15397bc601 100644
--- a/mobile/apps/locker/lib/services/files/sync/models/file.dart
+++ b/mobile/apps/locker/lib/services/files/sync/models/file.dart
@@ -33,7 +33,7 @@ class EnteFile {
MagicMetadata get magicMetadata =>
_mmd ?? MagicMetadata.fromEncodedJson(mMdEncodedJson ?? '{}');
- set magicMetadata(val) => _mmd = val;
+ set magicMetadata(MagicMetadata? val) => _mmd = val;
String? pubMmdEncodedJson;
int pubMmdVersion = 1;
@@ -42,7 +42,7 @@ class EnteFile {
PubMagicMetadata get pubMagicMetadata =>
_pubMmd ?? PubMagicMetadata.fromEncodedJson(pubMmdEncodedJson ?? '{}');
- set pubMagicMetadata(val) => _pubMmd = val;
+ set pubMagicMetadata(PubMagicMetadata? val) => _pubMmd = val;
static const kCurrentMetadataVersion = 2;
diff --git a/mobile/apps/photos/lib/models/file/file.dart b/mobile/apps/photos/lib/models/file/file.dart
index be55cf6e19..1c47ef93fc 100644
--- a/mobile/apps/photos/lib/models/file/file.dart
+++ b/mobile/apps/photos/lib/models/file/file.dart
@@ -49,7 +49,7 @@ class EnteFile {
MagicMetadata get magicMetadata =>
_mmd ?? MagicMetadata.fromEncodedJson(mMdEncodedJson ?? '{}');
- set magicMetadata(val) => _mmd = val;
+ set magicMetadata(MagicMetadata? val) => _mmd = val;
// public magic metadata is shared if during file/album sharing
String? pubMmdEncodedJson;
@@ -59,7 +59,7 @@ class EnteFile {
PubMagicMetadata? get pubMagicMetadata =>
_pubMmd ?? PubMagicMetadata.fromEncodedJson(pubMmdEncodedJson ?? '{}');
- set pubMagicMetadata(val) => _pubMmd = val;
+ set pubMagicMetadata(PubMagicMetadata? val) => _pubMmd = val;
// in Version 1, live photo hash is stored as zip's hash.
// in V2: LivePhoto hash is stored as imgHash:vidHash
diff --git a/mobile/apps/photos/lib/services/machine_learning/face_ml/face_detection/detection.dart b/mobile/apps/photos/lib/services/machine_learning/face_ml/face_detection/detection.dart
index 9bc76aeb06..ff1b6ac679 100644
--- a/mobile/apps/photos/lib/services/machine_learning/face_ml/face_detection/detection.dart
+++ b/mobile/apps/photos/lib/services/machine_learning/face_ml/face_detection/detection.dart
@@ -24,8 +24,8 @@ abstract class Detection {
const Detection.empty() : score = 0;
- get width;
- get height;
+ double get width;
+ double get height;
@override
String toString();
diff --git a/mobile/apps/photos/lib/ui/components/blur_menu_item_widget.dart b/mobile/apps/photos/lib/ui/components/blur_menu_item_widget.dart
index 85bc341e0e..39715894df 100644
--- a/mobile/apps/photos/lib/ui/components/blur_menu_item_widget.dart
+++ b/mobile/apps/photos/lib/ui/components/blur_menu_item_widget.dart
@@ -97,13 +97,13 @@ class _BlurMenuItemWidgetState extends State<BlurMenuItemWidget> {
);
}
- void _onTapDown(details) {
+ void _onTapDown(TapDownDetails details) {
setState(() {
menuItemColor = widget.pressedColor ?? widget.menuItemColor;
});
}
- void _onTapUp(details) {
+ void _onTapUp(TapUpDetails details) {
Future.delayed(
const Duration(milliseconds: 100),
() => setState(() {
diff --git a/mobile/apps/photos/lib/ui/components/buttons/button_widget.dart b/mobile/apps/photos/lib/ui/components/buttons/button_widget.dart
index c1cf2ab0c2..b303fb971d 100644
--- a/mobile/apps/photos/lib/ui/components/buttons/button_widget.dart
+++ b/mobile/apps/photos/lib/ui/components/buttons/button_widget.dart
@@ -547,7 +547,7 @@ class _ButtonChildWidgetState extends State<ButtonChildWidget> {
}
}
- void _onTapDown(details) {
+ void _onTapDown(TapDownDetails details) {
if (!mounted) return;
setState(() {
buttonColor =
@@ -565,7 +565,7 @@ class _ButtonChildWidgetState extends State<ButtonChildWidget> {
});
}
- void _onTapUp(details) {
+ void _onTapUp(TapUpDetails details) {
Future.delayed(const Duration(milliseconds: 84), () {
if (!mounted) return;
setState(() {
diff --git a/mobile/apps/photos/lib/ui/components/buttons/icon_button_widget.dart b/mobile/apps/photos/lib/ui/components/buttons/icon_button_widget.dart
index 88b6ace0c0..a03ca6b5bd 100644
--- a/mobile/apps/photos/lib/ui/components/buttons/icon_button_widget.dart
+++ b/mobile/apps/photos/lib/ui/components/buttons/icon_button_widget.dart
@@ -98,7 +98,7 @@ class _IconButtonWidgetState extends State<IconButtonWidget> {
);
}
- void _onTapDown(details) {
+ void _onTapDown(TapDownDetails details) {
final colorTheme = getEnteColorScheme(context);
setState(() {
iconStateColor =
@@ -109,7 +109,7 @@ class _IconButtonWidgetState extends State<IconButtonWidget> {
});
}
- void _onTapUp(details) {
+ void _onTapUp(TapUpDetails details) {
Future.delayed(const Duration(milliseconds: 100), () {
if (mounted) {
setState(() {
diff --git a/mobile/apps/photos/lib/ui/components/menu_item_widget/menu_item_widget.dart b/mobile/apps/photos/lib/ui/components/menu_item_widget/menu_item_widget.dart
index 94c2f3d83b..a18e82b887 100644
--- a/mobile/apps/photos/lib/ui/components/menu_item_widget/menu_item_widget.dart
+++ b/mobile/apps/photos/lib/ui/components/menu_item_widget/menu_item_widget.dart
@@ -256,7 +256,7 @@ class _MenuItemWidgetState extends State<MenuItemWidget> {
}
}
- void _onTapDown(details) {
+ void _onTapDown(TapDownDetails details) {
if (executionStateNotifier.value == ExecutionState.inProgress ||
executionStateNotifier.value == ExecutionState.successful) {
return;
@@ -278,7 +278,7 @@ class _MenuItemWidgetState extends State<MenuItemWidget> {
widget.onLongPress != null;
}
- void _onTapUp(details) {
+ void _onTapUp(TapUpDetails details) {
if (executionStateNotifier.value == ExecutionState.inProgress ||
executionStateNotifier.value == ExecutionState.successful) {
return;
diff --git a/mobile/apps/photos/lib/ui/components/menu_item_widget/menu_item_widget_new.dart b/mobile/apps/photos/lib/ui/components/menu_item_widget/menu_item_widget_new.dart
index eb3e87540d..9dcfcfe76e 100644
--- a/mobile/apps/photos/lib/ui/components/menu_item_widget/menu_item_widget_new.dart
+++ b/mobile/apps/photos/lib/ui/components/menu_item_widget/menu_item_widget_new.dart
@@ -270,7 +270,7 @@ class _MenuItemWidgetNewState extends State<MenuItemWidgetNew> {
}
}
- void _onTapDown(details) {
+ void _onTapDown(TapDownDetails details) {
if (executionStateNotifier.value == ExecutionState.inProgress ||
executionStateNotifier.value == ExecutionState.successful) {
return;
@@ -299,7 +299,7 @@ class _MenuItemWidgetNewState extends State<MenuItemWidgetNew> {
widget.onLongPress != null;
}
- void _onTapUp(details) {
+ void _onTapUp(TapUpDetails details) {
if (executionStateNotifier.value == ExecutionState.inProgress ||
executionStateNotifier.value == ExecutionState.successful) {
return;
diff --git a/mobile/packages/ente_pure_utils/lib/src/data_util.dart b/mobile/packages/ente_pure_utils/lib/src/data_util.dart
index 527a80c4fb..e8e81d72fa 100644
--- a/mobile/packages/ente_pure_utils/lib/src/data_util.dart
+++ b/mobile/packages/ente_pure_utils/lib/src/data_util.dart
@@ -58,7 +58,7 @@ int convertBytesToMBs(int bytes) {
}
//Eg: 1TB, 1.3TB, 4.9TB, 3TB
-num roundGBsToTBs(sizeInGBs) {
+num roundGBsToTBs(num sizeInGBs) {
final num sizeInTBs = num.parse((sizeInGBs / 1000).toStringAsFixed(1));
if (sizeInTBs % 1 == 0) {
return sizeInTBs.truncate();
diff --git a/mobile/packages/ui/lib/components/buttons/button_widget.dart b/mobile/packages/ui/lib/components/buttons/button_widget.dart
index d2dcc41aca..301d2c8648 100644
--- a/mobile/packages/ui/lib/components/buttons/button_widget.dart
+++ b/mobile/packages/ui/lib/components/buttons/button_widget.dart
@@ -518,7 +518,7 @@ class _ButtonChildWidgetState extends State<ButtonChildWidget> {
}
}
- void _onTapDown(details) {
+ void _onTapDown(TapDownDetails details) {
setState(() {
buttonColor =
widget.buttonStyle.pressedButtonColor ??
@@ -535,7 +535,7 @@ class _ButtonChildWidgetState extends State<ButtonChildWidget> {
});
}
- void _onTapUp(details) {
+ void _onTapUp(TapUpDetails details) {
Future.delayed(
const Duration(milliseconds: 84),
() => setState(() {
diff --git a/mobile/packages/ui/lib/components/buttons/icon_button_widget.dart b/mobile/packages/ui/lib/components/buttons/icon_button_widget.dart
index cd32678cd2..d4fc78fcd8 100644
--- a/mobile/packages/ui/lib/components/buttons/icon_button_widget.dart
+++ b/mobile/packages/ui/lib/components/buttons/icon_button_widget.dart
@@ -77,7 +77,7 @@ class _IconButtonWidgetState extends State<IconButtonWidget> {
);
}
- void _onTapDown(details) {
+ void _onTapDown(TapDownDetails details) {
final colorTheme = getEnteColorScheme(context);
setState(() {
iconStateColor =
@@ -88,7 +88,7 @@ class _IconButtonWidgetState extends State<IconButtonWidget> {
});
}
- void _onTapUp(details) {
+ void _onTapUp(TapUpDetails details) {
Future.delayed(const Duration(milliseconds: 100), () {
setState(() {
iconStateColor = null;
diff --git a/mobile/packages/ui/lib/components/menu_item_widget.dart b/mobile/packages/ui/lib/components/menu_item_widget.dart
index 85ecb6f2c5..1f1e869dec 100644
--- a/mobile/packages/ui/lib/components/menu_item_widget.dart
+++ b/mobile/packages/ui/lib/components/menu_item_widget.dart
@@ -246,7 +246,7 @@ class _MenuItemWidgetState extends State<MenuItemWidget> {
}
}
- void _onTapDown(details) {
+ void _onTapDown(TapDownDetails details) {
if (executionStateNotifier.value == ExecutionState.inProgress ||
executionStateNotifier.value == ExecutionState.successful) {
return;
@@ -268,7 +268,7 @@ class _MenuItemWidgetState extends State<MenuItemWidget> {
widget.onLongPress != null;
}
- void _onTapUp(details) {
+ void _onTapUp(TapUpDetails details) {
if (executionStateNotifier.value == ExecutionState.inProgress ||
executionStateNotifier.value == ExecutionState.successful) {
return;
diff --git a/mobile/packages/ui/lib/components/menu_item_widget_v2.dart b/mobile/packages/ui/lib/components/menu_item_widget_v2.dart
index e42af714e2..74caf8d644 100644
--- a/mobile/packages/ui/lib/components/menu_item_widget_v2.dart
+++ b/mobile/packages/ui/lib/components/menu_item_widget_v2.dart
@@ -269,7 +269,7 @@ class _MenuItemWidgetV2State extends State<MenuItemWidgetV2> {
}
}
- void _onTapDown(details) {
+ void _onTapDown(TapDownDetails details) {
if (executionStateNotifier.value == ExecutionState.inProgress ||
executionStateNotifier.value == ExecutionState.successful) {
return;
@@ -291,7 +291,7 @@ class _MenuItemWidgetV2State extends State<MenuItemWidgetV2> {
widget.onLongPress != null;
}
- void _onTapUp(details) {
+ void _onTapUp(TapUpDetails details) {
if (executionStateNotifier.value == ExecutionState.inProgress ||
executionStateNotifier.value == ExecutionState.successful) {
return;
diff --git a/mobile/packages/ui/lib/utils/toast_util.dart b/mobile/packages/ui/lib/utils/toast_util.dart
index 336956232e..fd5a90f667 100644
--- a/mobile/packages/ui/lib/utils/toast_util.dart
+++ b/mobile/packages/ui/lib/utils/toast_util.dart
@@ -47,6 +47,6 @@ void showToast(
}
}
-void showShortToast(context, String message) {
+void showShortToast(BuildContext context, String message) {
showToast(context, message, toastLength: Toast.LENGTH_SHORT);
}