diff --git a/lib/app.dart b/lib/app.dart index 2583f473e..95a045d34 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -24,7 +24,7 @@ final lightThemeData = ThemeData( iconTheme: IconThemeData(color: Colors.black), primaryIconTheme: IconThemeData(color: Colors.red, opacity: 1.0, size: 50.0), colorScheme: ColorScheme.light( - primary: Colors.black, secondary: Color.fromARGB(255, 163, 163, 163)), + primary: Colors.black, secondary: Color.fromARGB(255, 163, 163, 163),), accentColor: Color.fromRGBO(0, 0, 0, 0.6), buttonColor: Color.fromRGBO(45, 194, 98, 1.0), outlinedButtonTheme: buildOutlinedButtonThemeData( @@ -34,7 +34,7 @@ final lightThemeData = ThemeData( fgEnabled: Colors.white, ), elevatedButtonTheme: buildElevatedButtonThemeData( - onPrimary: Colors.white, primary: Colors.black), + onPrimary: Colors.white, primary: Colors.black,), toggleableActiveColor: Colors.green[400], scaffoldBackgroundColor: Colors.white, backgroundColor: Colors.white, @@ -48,18 +48,18 @@ final lightThemeData = ThemeData( textTheme: _buildTextTheme(Colors.black), primaryTextTheme: TextTheme().copyWith( bodyText2: TextStyle(color: Colors.yellow), - bodyText1: TextStyle(color: Colors.orange)), + bodyText1: TextStyle(color: Colors.orange),), cardColor: Color.fromRGBO(250, 250, 250, 1.0), dialogTheme: DialogTheme().copyWith( backgroundColor: Color.fromRGBO(250, 250, 250, 1.0), // titleTextStyle: TextStyle( - color: Colors.black, fontSize: 24, fontWeight: FontWeight.w600), + color: Colors.black, fontSize: 24, fontWeight: FontWeight.w600,), contentTextStyle: TextStyle( fontFamily: 'Inter-Medium', color: Colors.black, fontSize: 16, - fontWeight: FontWeight.w500), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8))), + fontWeight: FontWeight.w500,), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),), inputDecorationTheme: InputDecorationTheme().copyWith( focusedBorder: UnderlineInputBorder( borderSide: BorderSide( @@ -104,9 +104,9 @@ final darkThemeData = ThemeData( bgDisabled: Colors.grey.shade500, bgEnabled: Colors.white, fgDisabled: Colors.white, - fgEnabled: Colors.black), + fgEnabled: Colors.black,), elevatedButtonTheme: buildElevatedButtonThemeData( - onPrimary: Colors.black, primary: Colors.white), + onPrimary: Colors.black, primary: Colors.white,), scaffoldBackgroundColor: Colors.black, backgroundColor: Colors.black, appBarTheme: AppBarTheme().copyWith( diff --git a/lib/core/cache/thumbnail_cache.dart b/lib/core/cache/thumbnail_cache.dart index 59fbf64ca..64026ff64 100644 --- a/lib/core/cache/thumbnail_cache.dart +++ b/lib/core/cache/thumbnail_cache.dart @@ -10,7 +10,7 @@ class ThumbnailLruCache { static Uint8List get(File photo, [int size]) { return _map.get(photo.generatedID.toString() + "_" + - (size != null ? size.toString() : kThumbnailLargeSize.toString())); + (size != null ? size.toString() : kThumbnailLargeSize.toString()),); } static void put( @@ -22,13 +22,13 @@ class ThumbnailLruCache { photo.generatedID.toString() + "_" + (size != null ? size.toString() : kThumbnailLargeSize.toString()), - imageData); + imageData,); } static void clearCache(File file) { _map.remove( - file.generatedID.toString() + "_" + kThumbnailLargeSize.toString()); + file.generatedID.toString() + "_" + kThumbnailLargeSize.toString(),); _map.remove( - file.generatedID.toString() + "_" + kThumbnailSmallSize.toString()); + file.generatedID.toString() + "_" + kThumbnailSmallSize.toString(),); } } diff --git a/lib/core/configuration.dart b/lib/core/configuration.dart index b16528d4f..3c183459d 100644 --- a/lib/core/configuration.dart +++ b/lib/core/configuration.dart @@ -188,7 +188,7 @@ class Configuration { Sodium.bin2base64(encryptedRecoveryKey.nonce), ); final privateAttributes = PrivateKeyAttributes(Sodium.bin2base64(masterKey), - Sodium.bin2hex(recoveryKey), Sodium.bin2base64(keyPair.sk)); + Sodium.bin2hex(recoveryKey), Sodium.bin2base64(keyPair.sk),); return KeyGenResult(attributes, privateAttributes); } @@ -218,7 +218,7 @@ class Configuration { } Future decryptAndSaveSecrets( - String password, KeyAttributes attributes) async { + String password, KeyAttributes attributes,) async { final kek = await CryptoUtil.deriveKey( utf8.encode(password), Sodium.base642bin(attributes.kekSalt), @@ -228,7 +228,7 @@ class Configuration { Uint8List key; try { key = CryptoUtil.decryptSync(Sodium.base642bin(attributes.encryptedKey), - kek, Sodium.base642bin(attributes.keyDecryptionNonce)); + kek, Sodium.base642bin(attributes.keyDecryptionNonce),); } catch (e) { throw Exception("Incorrect password"); } @@ -236,14 +236,14 @@ class Configuration { final secretKey = CryptoUtil.decryptSync( Sodium.base642bin(attributes.encryptedSecretKey), key, - Sodium.base642bin(attributes.secretKeyDecryptionNonce)); + Sodium.base642bin(attributes.secretKeyDecryptionNonce),); await setSecretKey(Sodium.bin2base64(secretKey)); final token = CryptoUtil.openSealSync( Sodium.base642bin(getEncryptedToken()), Sodium.base642bin(attributes.publicKey), - secretKey); + secretKey,); await setToken( - Sodium.bin2base64(token, variant: Sodium.base64VariantUrlsafe)); + Sodium.bin2base64(token, variant: Sodium.base64VariantUrlsafe),); } Future createNewRecoveryKey() async { @@ -272,7 +272,7 @@ class Configuration { if (recoveryKey.contains(' ')) { if (recoveryKey.split(' ').length != kMnemonicKeyWordCount) { throw AssertionError( - 'recovery code should have $kMnemonicKeyWordCount words'); + 'recovery code should have $kMnemonicKeyWordCount words',); } recoveryKey = bip39.mnemonicToEntropy(recoveryKey); } @@ -282,7 +282,7 @@ class Configuration { masterKey = await CryptoUtil.decrypt( Sodium.base642bin(attributes.masterKeyEncryptedWithRecoveryKey), Sodium.hex2bin(recoveryKey), - Sodium.base642bin(attributes.masterKeyDecryptionNonce)); + Sodium.base642bin(attributes.masterKeyDecryptionNonce),); } catch (e) { _logger.severe(e); rethrow; @@ -291,14 +291,14 @@ class Configuration { final secretKey = CryptoUtil.decryptSync( Sodium.base642bin(attributes.encryptedSecretKey), masterKey, - Sodium.base642bin(attributes.secretKeyDecryptionNonce)); + Sodium.base642bin(attributes.secretKeyDecryptionNonce),); await setSecretKey(Sodium.bin2base64(secretKey)); final token = CryptoUtil.openSealSync( Sodium.base642bin(getEncryptedToken()), Sodium.base642bin(attributes.publicKey), - secretKey); + secretKey,); await setToken( - Sodium.bin2base64(token, variant: Sodium.base64VariantUrlsafe)); + Sodium.bin2base64(token, variant: Sodium.base64VariantUrlsafe),); } String getHttpEndpoint() { @@ -430,7 +430,7 @@ class Configuration { return CryptoUtil.decryptSync( Sodium.base642bin(keyAttributes.recoveryKeyEncryptedWithMasterKey), getKey(), - Sodium.base642bin(keyAttributes.recoveryKeyDecryptionNonce)); + Sodium.base642bin(keyAttributes.recoveryKeyDecryptionNonce),); } String getDocumentsDirectory() { @@ -551,7 +551,7 @@ class Configuration { iOptions: _secureStorageOptionsIOS, ); await _preferences.setBool( - hasMigratedSecureStorageToFirstUnlockKey, true); + hasMigratedSecureStorageToFirstUnlockKey, true,); } } diff --git a/lib/core/error-reporting/tunneled_transport.dart b/lib/core/error-reporting/tunneled_transport.dart index da9737600..72b04939c 100644 --- a/lib/core/error-reporting/tunneled_transport.dart +++ b/lib/core/error-reporting/tunneled_transport.dart @@ -63,7 +63,7 @@ class TunneledTransport implements Transport { } Future _createStreamedRequest( - SentryEnvelope envelope) async { + SentryEnvelope envelope,) async { final streamedRequest = StreamedRequest('POST', _tunnel); envelope .envelopeStream(_options) @@ -88,7 +88,7 @@ class _CredentialBuilder { _clock = clock; factory _CredentialBuilder( - Dsn dsn, String sdkIdentifier, ClockProvider clock) { + Dsn dsn, String sdkIdentifier, ClockProvider clock,) { final authHeader = _buildAuthHeader( publicKey: dsn.publicKey, secretKey: dsn.secretKey, diff --git a/lib/core/network.dart b/lib/core/network.dart index 854a0dbd4..90a1a58b7 100644 --- a/lib/core/network.dart +++ b/lib/core/network.dart @@ -21,7 +21,7 @@ class Network { HttpHeaders.userAgentHeader: FkUserAgent.userAgent, 'X-Client-Version': packageInfo.version, 'X-Client-Package': packageInfo.packageName, - })); + },),); _dio.interceptors.add(RequestIdInterceptor()); _dio.interceptors.add(_alice.getDioInterceptor()); } diff --git a/lib/db/collections_db.dart b/lib/db/collections_db.dart index c4397a9cf..d909b5642 100644 --- a/lib/db/collections_db.dart +++ b/lib/db/collections_db.dart @@ -44,7 +44,7 @@ class CollectionsDB { ]; final dbConfig = MigrationConfig( - initializationScript: intitialScript, migrationScripts: migrationScripts); + initializationScript: intitialScript, migrationScripts: migrationScripts,); CollectionsDB._privateConstructor(); @@ -158,7 +158,7 @@ class CollectionsDB { var batch = db.batch(); for (final collection in collections) { batch.insert(table, _getRowForCollection(collection), - conflictAlgorithm: ConflictAlgorithm.replace); + conflictAlgorithm: ConflictAlgorithm.replace,); } return await batch.commit(); } @@ -240,11 +240,11 @@ class CollectionsDB { version: row[columnVersion], ), List.from((json.decode(row[columnSharees]) as List) - .map((x) => User.fromMap(x))), + .map((x) => User.fromMap(x)),), row[columnPublicURLs] == null ? [] : List.from((json.decode(row[columnPublicURLs]) as List) - .map((x) => PublicURL.fromMap(x))), + .map((x) => PublicURL.fromMap(x)),), int.parse(row[columnUpdationTime]), // default to False is columnIsDeleted is not set isDeleted: (row[columnIsDeleted] ?? _sqlBoolFalse) == _sqlBoolTrue, diff --git a/lib/db/file_migration_db.dart b/lib/db/file_migration_db.dart index 9f7ad0bf9..477b438b4 100644 --- a/lib/db/file_migration_db.dart +++ b/lib/db/file_migration_db.dart @@ -19,7 +19,7 @@ class FilesMigrationDB { $columnLocalID TEXT NOT NULL, UNIQUE($columnLocalID) ); - '''); + ''',); } FilesMigrationDB._privateConstructor(); @@ -74,9 +74,9 @@ class FilesMigrationDB { final endTime = DateTime.now(); final duration = Duration( microseconds: - endTime.microsecondsSinceEpoch - startTime.microsecondsSinceEpoch); + endTime.microsecondsSinceEpoch - startTime.microsecondsSinceEpoch,); _logger.info("Batch insert of ${fileLocalIDs.length} " - "took ${duration.inMilliseconds} ms."); + "took ${duration.inMilliseconds} ms.",); } Future deleteByLocalIDs(List localIDs) async { diff --git a/lib/db/files_db.dart b/lib/db/files_db.dart index 5483412b7..7f7bc8444 100644 --- a/lib/db/files_db.dart +++ b/lib/db/files_db.dart @@ -77,7 +77,7 @@ class FilesDB { final dbConfig = MigrationConfig( initializationScript: initializationScript, - migrationScripts: migrationScripts); + migrationScripts: migrationScripts,); // make this a singleton class FilesDB._privateConstructor(); @@ -320,12 +320,12 @@ class FilesDB { final endTime = DateTime.now(); final duration = Duration( microseconds: - endTime.microsecondsSinceEpoch - startTime.microsecondsSinceEpoch); + endTime.microsecondsSinceEpoch - startTime.microsecondsSinceEpoch,); _logger.info("Batch insert of " + files.length.toString() + " took " + duration.inMilliseconds.toString() + - "ms."); + "ms.",); } Future insert(File file) async { @@ -340,7 +340,7 @@ class FilesDB { Future getFile(int generatedID) async { final db = await instance.database; final results = await db.query(table, - where: '$columnGeneratedID = ?', whereArgs: [generatedID]); + where: '$columnGeneratedID = ?', whereArgs: [generatedID],); if (results.isEmpty) { return null; } @@ -402,7 +402,7 @@ class FilesDB { {int limit, bool asc, int visibility = kVisibilityVisible, - Set ignoredCollectionIDs}) async { + Set ignoredCollectionIDs,}) async { final db = await instance.database; final order = (asc ?? false ? 'ASC' : 'DESC'); final results = await db.query( @@ -423,7 +423,7 @@ class FilesDB { Future getAllLocalAndUploadedFiles( int startTime, int endTime, int ownerID, - {int limit, bool asc, Set ignoredCollectionIDs}) async { + {int limit, bool asc, Set ignoredCollectionIDs,}) async { final db = await instance.database; final order = (asc ?? false ? 'ASC' : 'DESC'); final results = await db.query( @@ -444,7 +444,7 @@ class FilesDB { Future getImportantFiles( int startTime, int endTime, int ownerID, List paths, - {int limit, bool asc, Set ignoredCollectionIDs}) async { + {int limit, bool asc, Set ignoredCollectionIDs,}) async { final db = await instance.database; String inParam = ""; for (final path in paths) { @@ -469,7 +469,7 @@ class FilesDB { } List _deduplicatedAndFilterIgnoredFiles( - List files, Set ignoredCollectionIDs) { + List files, Set ignoredCollectionIDs,) { final uploadedFileIDs = {}; final List deduplicatedFiles = []; for (final file in files) { @@ -489,7 +489,7 @@ class FilesDB { Future getFilesInCollection( int collectionID, int startTime, int endTime, - {int limit, bool asc}) async { + {int limit, bool asc,}) async { final db = await instance.database; final order = (asc ?? false ? 'ASC' : 'DESC'); final results = await db.query( @@ -507,7 +507,7 @@ class FilesDB { } Future getFilesInPath(String path, int startTime, int endTime, - {int limit, bool asc}) async { + {int limit, bool asc,}) async { final db = await instance.database; final order = (asc ?? false ? 'ASC' : 'DESC'); final results = await db.query( @@ -547,7 +547,7 @@ class FilesDB { } Future> getFilesCreatedWithinDurations( - List> durations) async { + List> durations,) async { final db = await instance.database; String whereClause = ""; for (int index = 0; index < durations.length; index++) { @@ -569,7 +569,7 @@ class FilesDB { } Future> getFilesToBeUploadedWithinFolders( - Set folders) async { + Set folders,) async { if (folders.isEmpty) { return []; } @@ -607,7 +607,7 @@ class FilesDB { files.removeWhere((e) => e.collectionID == null || e.localID == null || - e.uploadedFileID != null); + e.uploadedFileID != null,); return files; } @@ -805,7 +805,7 @@ class FilesDB { UPDATE $table SET $columnLocalID = NULL WHERE $columnLocalID IN ($inParam); - '''); + ''',); } Future> getLocalFiles(List localIDs) async { @@ -846,7 +846,7 @@ class FilesDB { } Future deleteFilesFromCollection( - int collectionID, List uploadedFileIDs) async { + int collectionID, List uploadedFileIDs,) async { final db = await instance.database; return db.delete( table, @@ -859,14 +859,14 @@ class FilesDB { Future collectionFileCount(int collectionID) async { final db = await instance.database; var count = Sqflite.firstIntValue(await db.rawQuery( - 'SELECT COUNT(*) FROM $table where $columnCollectionID = $collectionID')); + 'SELECT COUNT(*) FROM $table where $columnCollectionID = $collectionID',),); return count; } Future fileCountWithVisibility(int visibility, int ownerID) async { final db = await instance.database; var count = Sqflite.firstIntValue(await db.rawQuery( - 'SELECT COUNT(*) FROM $table where $columnMMdVisibility = $visibility AND $columnOwnerID = $ownerID')); + 'SELECT COUNT(*) FROM $table where $columnMMdVisibility = $visibility AND $columnOwnerID = $ownerID',),); return count; } @@ -903,7 +903,7 @@ class FilesDB { ) latest_files ON $table.$columnDeviceFolder = latest_files.$columnDeviceFolder AND $table.$columnCreationTime = latest_files.max_creation_time; - '''); + ''',); final files = _convertToFiles(rows); // TODO: Do this de-duplication within the SQL Query final folderMap = {}; @@ -932,7 +932,7 @@ class FilesDB { ) latest_files ON $table.$columnCollectionID = latest_files.$columnCollectionID AND $table.$columnCreationTime = latest_files.max_creation_time; - '''); + ''',); final files = _convertToFiles(rows); // TODO: Do this de-duplication within the SQL Query final collectionMap = {}; @@ -970,7 +970,7 @@ class FilesDB { FROM $table WHERE $columnLocalID IS NOT NULL GROUP BY $columnDeviceFolder - '''); + ''',); final result = {}; for (final row in rows) { result[row[columnDeviceFolder]] = row["count"]; @@ -1010,11 +1010,11 @@ class FilesDB { SET $columnUpdationTime = NULL WHERE $columnLocalID IN ($inParam) AND ($columnLatitude IS NULL OR $columnLongitude IS NULL OR $columnLongitude = 0.0 or $columnLongitude = 0.0); - '''); + ''',); } Future doesFileExistInCollection( - int uploadedFileID, int collectionID) async { + int uploadedFileID, int collectionID,) async { final db = await instance.database; final rows = await db.query( table, diff --git a/lib/db/ignored_files_db.dart b/lib/db/ignored_files_db.dart index 2f3103777..753190a09 100644 --- a/lib/db/ignored_files_db.dart +++ b/lib/db/ignored_files_db.dart @@ -32,7 +32,7 @@ class IgnoredFilesDB { ); CREATE INDEX IF NOT EXISTS local_id_index ON $tableName($columnLocalID); CREATE INDEX IF NOT EXISTS device_folder_index ON $tableName($columnDeviceFolder); - '''); + ''',); } IgnoredFilesDB._privateConstructor(); @@ -86,9 +86,9 @@ class IgnoredFilesDB { final endTime = DateTime.now(); final duration = Duration( microseconds: - endTime.microsecondsSinceEpoch - startTime.microsecondsSinceEpoch); + endTime.microsecondsSinceEpoch - startTime.microsecondsSinceEpoch,); _logger.info("Batch insert of ${ignoredFiles.length} " - "took ${duration.inMilliseconds} ms."); + "took ${duration.inMilliseconds} ms.",); } Future> getAll() async { @@ -103,7 +103,7 @@ class IgnoredFilesDB { IgnoredFile _getIgnoredFileFromRow(Map row) { return IgnoredFile(row[columnLocalID], row[columnTitle], - row[columnDeviceFolder], row[columnReason]); + row[columnDeviceFolder], row[columnReason],); } Map _getRowForIgnoredFile(IgnoredFile ignoredFile) { diff --git a/lib/db/memories_db.dart b/lib/db/memories_db.dart index ebe1a841a..55a4b3830 100644 --- a/lib/db/memories_db.dart +++ b/lib/db/memories_db.dart @@ -40,7 +40,7 @@ class MemoriesDB { $columnFileID INTEGER PRIMARY KEY NOT NULL, $columnSeenTime TEXT NOT NULL ) - '''); + ''',); } Future clearTable() async { @@ -60,7 +60,7 @@ class MemoriesDB { Future markMemoryAsSeen(Memory memory, int timestamp) async { final db = await instance.database; return await db.insert(table, _getRowForSeenMemory(memory, timestamp), - conflictAlgorithm: ConflictAlgorithm.replace); + conflictAlgorithm: ConflictAlgorithm.replace,); } Future> getSeenTimes() async { diff --git a/lib/db/public_keys_db.dart b/lib/db/public_keys_db.dart index 5d61b266a..5c452c892 100644 --- a/lib/db/public_keys_db.dart +++ b/lib/db/public_keys_db.dart @@ -41,7 +41,7 @@ class PublicKeysDB { $columnEmail TEXT PRIMARY KEY NOT NULL, $columnPublicKey TEXT NOT NULL ) - '''); + ''',); } Future clearTable() async { @@ -52,7 +52,7 @@ class PublicKeysDB { Future setKey(PublicKey key) async { final db = await instance.database; return db.insert(table, _getRow(key), - conflictAlgorithm: ConflictAlgorithm.replace); + conflictAlgorithm: ConflictAlgorithm.replace,); } Future> searchByEmail(String email) async { @@ -61,7 +61,7 @@ class PublicKeysDB { table, where: '$columnEmail LIKE ?', whereArgs: ['%$email%'], - )); + ),); } Map _getRow(PublicKey key) { diff --git a/lib/db/trash_db.dart b/lib/db/trash_db.dart index ce6fafb29..80ab634f6 100644 --- a/lib/db/trash_db.dart +++ b/lib/db/trash_db.dart @@ -65,7 +65,7 @@ class TrashDB { CREATE INDEX IF NOT EXISTS creation_time_index ON $tableName($columnCreationTime); CREATE INDEX IF NOT EXISTS delete_by_time_index ON $tableName($columnTrashDeleteBy); CREATE INDEX IF NOT EXISTS updated_at_time_index ON $tableName($columnTrashUpdatedAt); - '''); + ''',); } TrashDB._privateConstructor(); @@ -102,7 +102,7 @@ class TrashDB { Future getRecentlyTrashedFile() async { final db = await instance.database; var rows = await db.query(tableName, - orderBy: '$columnTrashDeleteBy DESC', limit: 1); + orderBy: '$columnTrashDeleteBy DESC', limit: 1,); if (rows == null || rows.isEmpty) { return null; } @@ -112,7 +112,7 @@ class TrashDB { Future count() async { final db = await instance.database; var count = Sqflite.firstIntValue( - await db.rawQuery('SELECT COUNT(*) FROM $tableName')); + await db.rawQuery('SELECT COUNT(*) FROM $tableName'),); return count; } @@ -138,12 +138,12 @@ class TrashDB { final endTime = DateTime.now(); final duration = Duration( microseconds: - endTime.microsecondsSinceEpoch - startTime.microsecondsSinceEpoch); + endTime.microsecondsSinceEpoch - startTime.microsecondsSinceEpoch,); _logger.info("Batch insert of " + trashFiles.length.toString() + " took " + duration.inMilliseconds.toString() + - "ms."); + "ms.",); } Future insert(TrashFile trash) async { @@ -174,7 +174,7 @@ class TrashDB { } Future getTrashedFiles(int startTime, int endTime, - {int limit, bool asc}) async { + {int limit, bool asc,}) async { final db = await instance.database; final order = (asc ?? false ? 'ASC' : 'DESC'); final results = await db.query( diff --git a/lib/db/upload_locks_db.dart b/lib/db/upload_locks_db.dart index 5e4314acd..9ae8139a5 100644 --- a/lib/db/upload_locks_db.dart +++ b/lib/db/upload_locks_db.dart @@ -40,7 +40,7 @@ class UploadLocksDB { $_columnOwner TEXT NOT NULL, $_columnTime TEXT NOT NULL ) - '''); + ''',); } Future clearTable() async { diff --git a/lib/ente_theme_data.dart b/lib/ente_theme_data.dart index 4d569ad32..6f9de7d51 100644 --- a/lib/ente_theme_data.dart +++ b/lib/ente_theme_data.dart @@ -33,7 +33,7 @@ extension CustomColorScheme on ColorScheme { ButtonStyle get optionalActionButtonStyle => buildElevatedButtonThemeData( onPrimary: Color(0xFF777777), primary: Color(0xFFF0F0F0), - elevation: 0) + elevation: 0,) .style; Color get recoveryKeyBoxColor => brightness == Brightness.light @@ -65,11 +65,11 @@ extension CustomColorScheme on ColorScheme { ? DatePickerTheme( backgroundColor: Colors.white, itemStyle: TextStyle(color: Colors.black), - cancelStyle: TextStyle(color: Colors.black)) + cancelStyle: TextStyle(color: Colors.black),) : DatePickerTheme( backgroundColor: Colors.black, itemStyle: TextStyle(color: Colors.white), - cancelStyle: TextStyle(color: Colors.white)); + cancelStyle: TextStyle(color: Colors.white),); Color get stepProgressUnselectedColor => brightness == Brightness.light ? Color.fromRGBO(196, 196, 196, 0.6) @@ -124,7 +124,7 @@ extension CustomColorScheme on ColorScheme { } OutlinedButtonThemeData buildOutlinedButtonThemeData( - {Color bgDisabled, Color bgEnabled, Color fgDisabled, Color fgEnabled}) { + {Color bgDisabled, Color bgEnabled, Color fgDisabled, Color fgEnabled,}) { return OutlinedButtonThemeData( style: OutlinedButton.styleFrom( shape: RoundedRectangleBorder( @@ -162,7 +162,7 @@ OutlinedButtonThemeData buildOutlinedButtonThemeData( ElevatedButtonThemeData buildElevatedButtonThemeData( {@required Color onPrimary, // text button color @required Color primary, - double elevation = 2 // background color of button + double elevation = 2, // background color of button }) { return ElevatedButtonThemeData( style: ElevatedButton.styleFrom( @@ -179,7 +179,7 @@ ElevatedButtonThemeData buildElevatedButtonThemeData( shape: const RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(8)), ), - )); + ),); } TextStyle gradientButtonTextTheme() { diff --git a/lib/main.dart b/lib/main.dart index 3d1a00da0..58e4aa4e0 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -64,7 +64,7 @@ Future _runInForeground() async { enabled: Configuration.instance.shouldShowLockScreen(), lightTheme: lightThemeData, darkTheme: darkThemeData, - )); + ),); }); } @@ -77,7 +77,7 @@ Future _runBackgroundTask(String taskId) async { _runWithLogs(() async { _logger.info("run background task"); _runInBackground(taskId); - }, prefix: "[bg]"); + }, prefix: "[bg]",); } } @@ -139,7 +139,7 @@ Future _init(bool isBackground, {String via = ''}) async { if (Platform.isIOS) { PushService.instance.init().then((_) { FirebaseMessaging.onBackgroundMessage( - _firebaseMessagingBackgroundHandler); + _firebaseMessagingBackgroundHandler,); }); } FeatureFlagService.instance.init(); @@ -168,14 +168,14 @@ Future _runWithLogs(Function() function, {String prefix = ""}) async { tunnel: kSentryTunnel, enableInDebugMode: true, prefix: prefix, - )); + ),); } Future _scheduleHeartBeat(bool isBackground) async { final prefs = await SharedPreferences.getInstance(); await prefs.setInt( isBackground ? kLastBGTaskHeartBeatTime : kLastFGTaskHeartBeatTime, - DateTime.now().microsecondsSinceEpoch); + DateTime.now().microsecondsSinceEpoch,); Future.delayed(kHeartBeatFrequency, () async { _scheduleHeartBeat(isBackground); }); @@ -209,7 +209,7 @@ Future _isRunningInForeground() async { Future _killBGTask([String taskId]) async { await UploadLocksDB.instance.releaseLocksAcquiredByOwnerBefore( - ProcessType.background.toString(), DateTime.now().microsecondsSinceEpoch); + ProcessType.background.toString(), DateTime.now().microsecondsSinceEpoch,); final prefs = await SharedPreferences.getInstance(); prefs.remove(kLastBGTaskHeartBeatTime); if (taskId != null) { @@ -222,7 +222,7 @@ Future _firebaseMessagingBackgroundHandler(RemoteMessage message) async { bool isInForeground = AppLifecycleService.instance.isForeground; if (_isProcessRunning) { _logger.info( - "Background push received when app is alive and runningInFS: $isRunningInFG inForeground: $isInForeground"); + "Background push received when app is alive and runningInFS: $isRunningInFG inForeground: $isInForeground",); if (PushService.shouldSync(message)) { await _sync('firebaseBgSyncActiveProcess'); } @@ -237,7 +237,7 @@ Future _firebaseMessagingBackgroundHandler(RemoteMessage message) async { if (PushService.shouldSync(message)) { await _sync('firebaseBgSyncNoActiveProcess'); } - }, prefix: "[fbg]"); + }, prefix: "[fbg]",); } } diff --git a/lib/models/billing_plan.dart b/lib/models/billing_plan.dart index b0e6aba63..22571f549 100644 --- a/lib/models/billing_plan.dart +++ b/lib/models/billing_plan.dart @@ -33,7 +33,7 @@ class BillingPlans { return BillingPlans( plans: List.from( - map['plans']?.map((x) => BillingPlan.fromMap(x))), + map['plans']?.map((x) => BillingPlan.fromMap(x)),), freePlan: FreePlan.fromMap(map['freePlan']), ); } diff --git a/lib/models/collection.dart b/lib/models/collection.dart index eb39acee1..41d50ac70 100644 --- a/lib/models/collection.dart +++ b/lib/models/collection.dart @@ -83,7 +83,7 @@ class Collection { int updationTime, bool isDeleted, String mMdEncodedJson, - int mMdVersion}) { + int mMdVersion,}) { Collection result = Collection( id ?? this.id, owner ?? this.owner, @@ -131,7 +131,7 @@ class Collection { (map['publicURLs'] == null || map['publicURLs'].length == 0) ? [] : List.from( - map['publicURLs'].map((x) => PublicURL.fromMap(x))); + map['publicURLs'].map((x) => PublicURL.fromMap(x)),); return Collection( map['id'], User.fromMap(map['owner']), @@ -343,7 +343,7 @@ class PublicURL { this.deviceLimit, this.validTill, this.enableDownload, - this.passwordEnabled}); + this.passwordEnabled,}); Map toMap() { return { diff --git a/lib/models/duplicate_files.dart b/lib/models/duplicate_files.dart index 743d511fa..09ccfd611 100644 --- a/lib/models/duplicate_files.dart +++ b/lib/models/duplicate_files.dart @@ -9,7 +9,7 @@ class DuplicateFilesResponse { factory DuplicateFilesResponse.fromMap(Map map) { return DuplicateFilesResponse( List.from( - map['duplicates']?.map((x) => DuplicateItems.fromMap(x))), + map['duplicates']?.map((x) => DuplicateItems.fromMap(x)),), ); } diff --git a/lib/models/file.dart b/lib/models/file.dart index d03e2fc06..682068ae6 100644 --- a/lib/models/file.dart +++ b/lib/models/file.dart @@ -75,7 +75,7 @@ class File { .replaceAll("IMG_", "") .replaceAll("VID_", "") .replaceAll("DCIM_", "") - .replaceAll("_", " ")); + .replaceAll("_", " "),); file.creationTime = parsedDateTime.microsecondsSinceEpoch; } catch (e) { file.creationTime = asset.modifiedDateTime.microsecondsSinceEpoch; diff --git a/lib/models/ignored_file.dart b/lib/models/ignored_file.dart index 17525b6d9..20be74c1b 100644 --- a/lib/models/ignored_file.dart +++ b/lib/models/ignored_file.dart @@ -23,6 +23,6 @@ class IgnoredFile { } return IgnoredFile(trashFile.localID, trashFile.title, - trashFile.deviceFolder, kIgnoreReasonTrash); + trashFile.deviceFolder, kIgnoreReasonTrash,); } } diff --git a/lib/models/subscription.dart b/lib/models/subscription.dart index 76879ec4a..816e3552f 100644 --- a/lib/models/subscription.dart +++ b/lib/models/subscription.dart @@ -135,7 +135,7 @@ class Attributes { Attributes({ this.isCancelled, - this.customerID}); + this.customerID,}); Attributes.fromJson(dynamic json) { isCancelled = json["isCancelled"]; diff --git a/lib/models/user_details.dart b/lib/models/user_details.dart index ec7621a0b..ed7a37dca 100644 --- a/lib/models/user_details.dart +++ b/lib/models/user_details.dart @@ -43,7 +43,7 @@ class UserDetails { isPartOfFamily() ? (familyData.storage - familyData.getTotalUsage()) : (subscription.storage - (usage)), - 0); + 0,); } int getTotalStorage() { @@ -118,7 +118,7 @@ class FamilyData { } assert(map['members'] != null && map['members'].length >= 0); final members = List.from( - map['members'].map((x) => FamilyMember.fromMap(x))); + map['members'].map((x) => FamilyMember.fromMap(x)),); return FamilyData( members, map['storage'] as int, diff --git a/lib/services/billing_service.dart b/lib/services/billing_service.dart index 7e5f24b9d..d7ecac4ad 100644 --- a/lib/services/billing_service.dart +++ b/lib/services/billing_service.dart @@ -12,10 +12,10 @@ import 'package:photos/models/subscription.dart'; const kWebPaymentRedirectUrl = "https://payments.ente.io/frameRedirect"; const kWebPaymentBaseEndpoint = String.fromEnvironment("web-payment", - defaultValue: "https://payments.ente.io"); + defaultValue: "https://payments.ente.io",); const kFamilyPlanManagementUrl = String.fromEnvironment("web-family", - defaultValue: "https://family.ente.io"); + defaultValue: "https://family.ente.io",); class BillingService { BillingService._privateConstructor(); @@ -43,7 +43,7 @@ class BillingService { for (final purchase in purchases) { if (purchase.status == PurchaseStatus.purchased) { verifySubscription(purchase.productID, - purchase.verificationData.serverVerificationData) + purchase.verificationData.serverVerificationData,) .then((response) { if (response != null) { InAppPurchaseConnection.instance.completePurchase(purchase); @@ -167,7 +167,7 @@ class BillingService { } Future getStripeCustomerPortalUrl( - {String endpoint = kWebPaymentRedirectUrl}) async { + {String endpoint = kWebPaymentRedirectUrl,}) async { try { final response = await _dio.get( _config.getHttpEndpoint() + "/billing/stripe/customer-portal", diff --git a/lib/services/collections_service.dart b/lib/services/collections_service.dart index 709d3c69c..63b660def 100644 --- a/lib/services/collections_service.dart +++ b/lib/services/collections_service.dart @@ -192,7 +192,7 @@ class CollectionsService { Future share(int collectionID, String email, String publicKey) async { final encryptedKey = CryptoUtil.sealSync( - getCollectionKey(collectionID), Sodium.base642bin(publicKey)); + getCollectionKey(collectionID), Sodium.base642bin(publicKey),); try { await _dio.post( Configuration.instance.getHttpEndpoint() + "/collections/share", @@ -202,7 +202,7 @@ class CollectionsService { "encryptedKey": Sodium.bin2base64(encryptedKey), }, options: Options( - headers: {"X-Auth-Token": Configuration.instance.getToken()}), + headers: {"X-Auth-Token": Configuration.instance.getToken()},), ); } on DioError catch (e) { if (e.response.statusCode == 402) { @@ -222,7 +222,7 @@ class CollectionsService { "email": email, }, options: Options( - headers: {"X-Auth-Token": Configuration.instance.getToken()}), + headers: {"X-Auth-Token": Configuration.instance.getToken()},), ); _collectionIDToCollections[collectionID] .sharees @@ -254,19 +254,19 @@ class CollectionsService { final encryptedKey = Sodium.base642bin(collection.encryptedKey); if (collection.owner.id == _config.getUserID()) { return CryptoUtil.decryptSync(encryptedKey, _config.getKey(), - Sodium.base642bin(collection.keyDecryptionNonce)); + Sodium.base642bin(collection.keyDecryptionNonce),); } else { return CryptoUtil.openSealSync( encryptedKey, Sodium.base642bin(_config.getKeyAttributes().publicKey), - _config.getSecretKey()); + _config.getSecretKey(),); } } Future rename(Collection collection, String newName) async { try { final encryptedName = CryptoUtil.encryptSync( - utf8.encode(newName), getCollectionKey(collection.id)); + utf8.encode(newName), getCollectionKey(collection.id),); await _dio.post( Configuration.instance.getHttpEndpoint() + "/collections/rename", data: { @@ -275,7 +275,7 @@ class CollectionsService { "nameDecryptionNonce": Sodium.bin2base64(encryptedName.nonce) }, options: Options( - headers: {"X-Auth-Token": Configuration.instance.getToken()}), + headers: {"X-Auth-Token": Configuration.instance.getToken()},), ); // trigger sync to fetch the latest name from server sync(); @@ -286,7 +286,7 @@ class CollectionsService { } Future updateMagicMetadata( - Collection collection, Map newMetadataUpdate) async { + Collection collection, Map newMetadataUpdate,) async { final int ownerID = Configuration.instance.getUserID(); try { if (collection.owner.id != ownerID) { @@ -307,7 +307,7 @@ class CollectionsService { final key = getCollectionKey(collection.id); final encryptedMMd = await CryptoUtil.encryptChaCha( - utf8.encode(jsonEncode(jsonToUpdate)), key); + utf8.encode(jsonEncode(jsonToUpdate)), key,); // for required field, the json validator on golang doesn't treat 0 as valid // value. Instead of changing version to ptr, decided to start version with 1. int currentVersion = max(collection.mMdVersion, 1); @@ -325,7 +325,7 @@ class CollectionsService { "/collections/magic-metadata", data: params, options: Options( - headers: {"X-Auth-Token": Configuration.instance.getToken()}), + headers: {"X-Auth-Token": Configuration.instance.getToken()},), ); collection.mMdVersion = currentVersion + 1; _cacheCollectionAttributes(collection); @@ -351,7 +351,7 @@ class CollectionsService { "collectionID": collection.id, }, options: Options( - headers: {"X-Auth-Token": Configuration.instance.getToken()}), + headers: {"X-Auth-Token": Configuration.instance.getToken()},), ); collection.publicURLs?.add(PublicURL.fromMap(response.data["result"])); await _db.insert(List.from([collection])); @@ -369,14 +369,14 @@ class CollectionsService { } Future updateShareUrl( - Collection collection, Map prop) async { + Collection collection, Map prop,) async { prop.putIfAbsent('collectionID', () => collection.id); try { final response = await _dio.put( Configuration.instance.getHttpEndpoint() + "/collections/share-url", data: json.encode(prop), options: Options( - headers: {"X-Auth-Token": Configuration.instance.getToken()}), + headers: {"X-Auth-Token": Configuration.instance.getToken()},), ); // remove existing url information collection.publicURLs?.clear(); @@ -426,7 +426,7 @@ class CollectionsService { "source": AppLifecycleService.instance.isForeground ? "fg" : "bg", }, options: Options( - headers: {"X-Auth-Token": Configuration.instance.getToken()}), + headers: {"X-Auth-Token": Configuration.instance.getToken()},), ); final List collections = []; if (response != null) { @@ -438,11 +438,11 @@ class CollectionsService { final utfEncodedMmd = await CryptoUtil.decryptChaCha( Sodium.base642bin(collectionData['magicMetadata']['data']), decryptionKey, - Sodium.base642bin(collectionData['magicMetadata']['header'])); + Sodium.base642bin(collectionData['magicMetadata']['header']),); collection.mMdEncodedJson = utf8.decode(utfEncodedMmd); collection.mMdVersion = collectionData['magicMetadata']['version']; collection.magicMetadata = CollectionMagicMetadata.fromEncodedJson( - collection.mMdEncodedJson); + collection.mMdEncodedJson,); } collections.add(collection); } @@ -477,7 +477,7 @@ class CollectionsService { null, null, null, - )); + ),); return collection; } @@ -487,7 +487,7 @@ class CollectionsService { final response = await _dio.get( Configuration.instance.getHttpEndpoint() + "/collections/$collectionID", options: Options( - headers: {"X-Auth-Token": Configuration.instance.getToken()}), + headers: {"X-Auth-Token": Configuration.instance.getToken()},), ); assert(response != null && response.data != null); final collectionData = response.data["collection"]; @@ -497,7 +497,7 @@ class CollectionsService { final utfEncodedMmd = await CryptoUtil.decryptChaCha( Sodium.base642bin(collectionData['magicMetadata']['data']), decryptionKey, - Sodium.base642bin(collectionData['magicMetadata']['header'])); + Sodium.base642bin(collectionData['magicMetadata']['header']),); collection.mMdEncodedJson = utf8.decode(utfEncodedMmd); collection.mMdVersion = collectionData['magicMetadata']['version']; collection.magicMetadata = @@ -540,21 +540,21 @@ class CollectionsService { null, null, null, - )); + ),); return collection; } Future addToCollection(int collectionID, List files) async { final containsUploadedFile = files.firstWhere( (element) => element.uploadedFileID != null, - orElse: () => null) != + orElse: () => null,) != null; if (containsUploadedFile) { final existingFileIDsInCollection = await FilesDB.instance.getUploadedFileIDs(collectionID); files.removeWhere((element) => element.uploadedFileID != null && - existingFileIDsInCollection.contains(element.uploadedFileID)); + existingFileIDsInCollection.contains(element.uploadedFileID),); } if (files.isEmpty || !containsUploadedFile) { _logger.info("nothing to add to the collection"); @@ -575,8 +575,8 @@ class CollectionsService { params["files"] = []; } params["files"].add(CollectionFileItem( - file.uploadedFileID, file.encryptedKey, file.keyDecryptionNonce) - .toMap()); + file.uploadedFileID, file.encryptedKey, file.keyDecryptionNonce,) + .toMap(),); } try { @@ -584,7 +584,7 @@ class CollectionsService { Configuration.instance.getHttpEndpoint() + "/collections/add-files", data: params, options: Options( - headers: {"X-Auth-Token": Configuration.instance.getToken()}), + headers: {"X-Auth-Token": Configuration.instance.getToken()},), ); await _filesDB.insertMultiple(files); Bus.instance.fire(CollectionUpdatedEvent(collectionID, files)); @@ -606,15 +606,15 @@ class CollectionsService { file.encryptedKey = Sodium.bin2base64(encryptedKeyData.encryptedData); file.keyDecryptionNonce = Sodium.bin2base64(encryptedKeyData.nonce); params["files"].add(CollectionFileItem( - file.uploadedFileID, file.encryptedKey, file.keyDecryptionNonce) - .toMap()); + file.uploadedFileID, file.encryptedKey, file.keyDecryptionNonce,) + .toMap(),); } try { await _dio.post( Configuration.instance.getHttpEndpoint() + "/collections/restore-files", data: params, options: Options( - headers: {"X-Auth-Token": Configuration.instance.getToken()}), + headers: {"X-Auth-Token": Configuration.instance.getToken()},), ); await _filesDB.insertMultiple(files); await TrashDB.instance @@ -641,7 +641,7 @@ class CollectionsService { } Future move( - int toCollectionID, int fromCollectionID, List files) async { + int toCollectionID, int fromCollectionID, List files,) async { _validateMoveRequest(toCollectionID, fromCollectionID, files); files.removeWhere((element) => element.uploadedFileID == null); if (files.isEmpty) { @@ -661,8 +661,8 @@ class CollectionsService { file.encryptedKey = Sodium.bin2base64(encryptedKeyData.encryptedData); file.keyDecryptionNonce = Sodium.bin2base64(encryptedKeyData.nonce); params["files"].add(CollectionFileItem( - file.uploadedFileID, file.encryptedKey, file.keyDecryptionNonce) - .toMap()); + file.uploadedFileID, file.encryptedKey, file.keyDecryptionNonce,) + .toMap(),); } await _dio.post( Configuration.instance.getHttpEndpoint() + "/collections/move-files", @@ -673,20 +673,20 @@ class CollectionsService { // remove files from old collection await _filesDB.removeFromCollection( - fromCollectionID, files.map((e) => e.uploadedFileID).toList()); + fromCollectionID, files.map((e) => e.uploadedFileID).toList(),); Bus.instance.fire(CollectionUpdatedEvent(fromCollectionID, files, - type: EventType.deletedFromRemote)); + type: EventType.deletedFromRemote,),); // insert new files in the toCollection which are not part of the toCollection final existingUploadedIDs = await FilesDB.instance.getUploadedFileIDs(toCollectionID); files.removeWhere( - (element) => existingUploadedIDs.contains(element.uploadedFileID)); + (element) => existingUploadedIDs.contains(element.uploadedFileID),); await _filesDB.insertMultiple(files); Bus.instance.fire(CollectionUpdatedEvent(toCollectionID, files)); } void _validateMoveRequest( - int toCollectionID, int fromCollectionID, List files) { + int toCollectionID, int fromCollectionID, List files,) { if (toCollectionID == fromCollectionID) { throw AssertionError("can't move to same album"); } @@ -757,7 +757,7 @@ class CollectionsService { return utf8.decode(CryptoUtil.decryptSync( Sodium.base642bin(collection.attributes.encryptedPath), key, - Sodium.base642bin(collection.attributes.pathDecryptionNonce))); + Sodium.base642bin(collection.attributes.pathDecryptionNonce),),); } bool hasSyncedCollections() { @@ -772,11 +772,11 @@ class CollectionsService { final result = CryptoUtil.decryptSync( Sodium.base642bin(collection.encryptedName), _getDecryptedKey(collection), - Sodium.base642bin(collection.nameDecryptionNonce)); + Sodium.base642bin(collection.nameDecryptionNonce),); name = utf8.decode(result); } catch (e, s) { _logger.severe( - "failed to decrypt collection name: ${collection.id}", e, s); + "failed to decrypt collection name: ${collection.id}", e, s,); name = "Unknown Album"; } return collection.copyWith(name: name); @@ -830,7 +830,7 @@ class AddFilesRequest { return AddFilesRequest( map['collectionID'], List.from( - map['files']?.map((x) => CollectionFileItem.fromMap(x))), + map['files']?.map((x) => CollectionFileItem.fromMap(x)),), ); } diff --git a/lib/services/deduplication_service.dart b/lib/services/deduplication_service.dart index 4fef9ea82..c5262dfc3 100644 --- a/lib/services/deduplication_service.dart +++ b/lib/services/deduplication_service.dart @@ -56,7 +56,7 @@ class DeduplicationService { InvalidStateError("Could not find " + missingFileIDs.length.toString() + " files in local DB: " + - missingFileIDs.toString())); + missingFileIDs.toString(),),); } return result; } catch (e) { diff --git a/lib/services/favorites_service.dart b/lib/services/favorites_service.dart index a41e44847..1397c4235 100644 --- a/lib/services/favorites_service.dart +++ b/lib/services/favorites_service.dart @@ -37,7 +37,7 @@ class FavoritesService { return false; } return _filesDB.doesFileExistInCollection( - file.uploadedFileID, collection.id); + file.uploadedFileID, collection.id,); } Future addToFavorites(File file) async { @@ -98,7 +98,7 @@ class FavoritesService { null, null, null, - )); + ),); _cachedFavoritesCollectionID = collection.id; return collection.id; } diff --git a/lib/services/feature_flag_service.dart b/lib/services/feature_flag_service.dart index 47289cae4..9a762f226 100644 --- a/lib/services/feature_flag_service.dart +++ b/lib/services/feature_flag_service.dart @@ -104,7 +104,7 @@ class FeatureFlags { disableCFWorker: FFDefault.disableCFWorker, disableUrlSharing: FFDefault.disableUrlSharing, enableStripe: FFDefault.enableStripe, - enableMissingLocationMigration: FFDefault.enableMissingLocationMigration); + enableMissingLocationMigration: FFDefault.enableMissingLocationMigration,); final bool disableCFWorker; final bool disableUrlSharing; @@ -115,7 +115,7 @@ class FeatureFlags { {@required this.disableCFWorker, @required this.disableUrlSharing, @required this.enableStripe, - @required this.enableMissingLocationMigration}); + @required this.enableMissingLocationMigration,}); Map toMap() { return { diff --git a/lib/services/file_magic_service.dart b/lib/services/file_magic_service.dart index 2f74e749d..61f0a54a5 100644 --- a/lib/services/file_magic_service.dart +++ b/lib/services/file_magic_service.dart @@ -44,7 +44,7 @@ class FileMagicService { } Future updatePublicMagicMetadata( - List files, Map newMetadataUpdate) async { + List files, Map newMetadataUpdate,) async { final params = {}; params['metadataList'] = []; final int ownerID = Configuration.instance.getUserID(); @@ -52,7 +52,7 @@ class FileMagicService { for (final file in files) { if (file.uploadedFileID == null) { throw AssertionError( - "operation is only supported on backed up files"); + "operation is only supported on backed up files",); } else if (file.ownerID != ownerID) { throw AssertionError("cannot modify memories not owned by you"); } @@ -70,7 +70,7 @@ class FileMagicService { final fileKey = decryptFileKey(file); final encryptedMMd = await CryptoUtil.encryptChaCha( - utf8.encode(jsonEncode(jsonToUpdate)), fileKey); + utf8.encode(jsonEncode(jsonToUpdate)), fileKey,); params['metadataList'].add(UpdateMagicMetadataRequest( id: file.uploadedFileID, magicMetadata: MetadataRequest( @@ -78,7 +78,7 @@ class FileMagicService { count: jsonToUpdate.length, data: Sodium.bin2base64(encryptedMMd.encryptedData), header: Sodium.bin2base64(encryptedMMd.header), - ))); + ),),); file.pubMmdVersion = file.pubMmdVersion + 1; } @@ -87,7 +87,7 @@ class FileMagicService { "/files/public-magic-metadata", data: params, options: Options( - headers: {"X-Auth-Token": Configuration.instance.getToken()}), + headers: {"X-Auth-Token": Configuration.instance.getToken()},), ); // update the state of the selected file. Same file in other collection // should be eventually synced after remote sync has completed @@ -105,7 +105,7 @@ class FileMagicService { } Future _updateMagicData( - List files, Map newMetadataUpdate) async { + List files, Map newMetadataUpdate,) async { final params = {}; params['metadataList'] = []; final int ownerID = Configuration.instance.getUserID(); @@ -113,7 +113,7 @@ class FileMagicService { for (final file in files) { if (file.uploadedFileID == null) { throw AssertionError( - "operation is only supported on backed up files"); + "operation is only supported on backed up files",); } else if (file.ownerID != ownerID) { throw AssertionError("cannot modify memories not owned by you"); } @@ -131,7 +131,7 @@ class FileMagicService { final fileKey = decryptFileKey(file); final encryptedMMd = await CryptoUtil.encryptChaCha( - utf8.encode(jsonEncode(jsonToUpdate)), fileKey); + utf8.encode(jsonEncode(jsonToUpdate)), fileKey,); params['metadataList'].add(UpdateMagicMetadataRequest( id: file.uploadedFileID, magicMetadata: MetadataRequest( @@ -139,7 +139,7 @@ class FileMagicService { count: jsonToUpdate.length, data: Sodium.bin2base64(encryptedMMd.encryptedData), header: Sodium.bin2base64(encryptedMMd.header), - ))); + ),),); file.mMdVersion = file.mMdVersion + 1; } @@ -147,7 +147,7 @@ class FileMagicService { Configuration.instance.getHttpEndpoint() + "/files/magic-metadata", data: params, options: Options( - headers: {"X-Auth-Token": Configuration.instance.getToken()}), + headers: {"X-Auth-Token": Configuration.instance.getToken()},), ); // update the state of the selected file. Same file in other collection // should be eventually synced after remote sync has completed @@ -176,7 +176,7 @@ class UpdateMagicMetadataRequest { id: json['id'], magicMetadata: json['magicMetadata'] != null ? MetadataRequest.fromJson(json['magicMetadata']) - : null); + : null,); } Map toJson() { diff --git a/lib/services/file_migration_service.dart b/lib/services/file_migration_service.dart index 0851f3085..e4f32d1b3 100644 --- a/lib/services/file_migration_service.dart +++ b/lib/services/file_migration_service.dart @@ -81,13 +81,13 @@ class FileMigrationService { final eTime = DateTime.now().microsecondsSinceEpoch; final d = Duration(microseconds: eTime - sTime); _logger.info( - 'filesWithMissingLocation migration completed in ${d.inSeconds.toString()} seconds'); + 'filesWithMissingLocation migration completed in ${d.inSeconds.toString()} seconds',); } await _markLocationMigrationAsCompleted(); } Future _checkAndMarkFilesForReUpload( - List localIDsToProcess) async { + List localIDsToProcess,) async { _logger.info("files to process ${localIDsToProcess.length}"); var localIDsWithLocation = []; for (var localID in localIDsToProcess) { @@ -101,7 +101,7 @@ class FileMigrationService { if ((latLng.longitude ?? 0.0) != 0.0 || (latLng.longitude ?? 0.0) != 0.0) { _logger.finest( - 'found lat/long ${latLng.longitude}/${latLng.longitude} for ${assetEntity.title} ${assetEntity.relativePath} with id : $localID'); + 'found lat/long ${latLng.longitude}/${latLng.longitude} for ${assetEntity.title} ${assetEntity.relativePath} with id : $localID',); hasLocation = true; } } catch (e, s) { @@ -127,7 +127,7 @@ class FileMigrationService { final eTime = DateTime.now().microsecondsSinceEpoch; final d = Duration(microseconds: eTime - sTime); _logger.info( - 'importing completed, total files count ${fileLocalIDs.length} and took ${d.inSeconds.toString()} seconds'); + 'importing completed, total files count ${fileLocalIDs.length} and took ${d.inSeconds.toString()} seconds',); _prefs.setBool(isLocalImportDone, true); } } diff --git a/lib/services/ignored_files_service.dart b/lib/services/ignored_files_service.dart index 47f6df609..06bd5baef 100644 --- a/lib/services/ignored_files_service.dart +++ b/lib/services/ignored_files_service.dart @@ -28,7 +28,7 @@ class IgnoredFilesService { existingIDs.addAll(ignoredFiles .map((e) => _idForIgnoredFile(e)) .where((id) => id != null) - .toSet()); + .toSet(),); return _db.insertMultiple(ignoredFiles); } @@ -56,7 +56,7 @@ class IgnoredFilesService { String _idForIgnoredFile(IgnoredFile ignoredFile) { return _getIgnoreID( - ignoredFile.localID, ignoredFile.deviceFolder, ignoredFile.title); + ignoredFile.localID, ignoredFile.deviceFolder, ignoredFile.title,); } // _computeIgnoreID will return null if don't have sufficient information diff --git a/lib/services/local_sync_service.dart b/lib/services/local_sync_service.dart index 53ea703ec..cc3283f1a 100644 --- a/lib/services/local_sync_service.dart +++ b/lib/services/local_sync_service.dart @@ -56,7 +56,7 @@ class LocalSyncService { final permissionState = await PhotoManager.requestPermissionExtend(); if (permissionState != PermissionState.authorized) { _logger.severe("sync requested with invalid permission", - permissionState.toString()); + permissionState.toString(),); return; } } @@ -67,7 +67,7 @@ class LocalSyncService { _existingSync = Completer(); final existingLocalFileIDs = await _db.getExistingLocalFileIDs(); _logger.info( - existingLocalFileIDs.length.toString() + " localIDs were discovered"); + existingLocalFileIDs.length.toString() + " localIDs were discovered",); final editedFileIDs = getEditedFileIDs().toSet(); final downloadedFileIDs = getDownloadedFileIDs().toSet(); final syncStartTime = DateTime.now().microsecondsSinceEpoch; @@ -131,7 +131,7 @@ class LocalSyncService { localAssets.length.toString() + " assets and took " + d.inMilliseconds.toString() + - "ms"); + "ms",); final existingIDs = await _db.getExistingLocalFileIDs(); final invalidIDs = getInvalidFileIDs().toSet(); final unsyncedFiles = @@ -139,7 +139,7 @@ class LocalSyncService { if (unsyncedFiles.isNotEmpty) { await _db.insertMultiple(unsyncedFiles); _logger.info( - "Inserted " + unsyncedFiles.length.toString() + " unsynced files."); + "Inserted " + unsyncedFiles.length.toString() + " unsynced files.",); _updatePathsToBackup(unsyncedFiles); Bus.instance.fire(LocalPhotosUpdatedEvent(unsyncedFiles)); return true; @@ -221,7 +221,7 @@ class LocalSyncService { _logger.info("Loading photos from " + DateTime.fromMicrosecondsSinceEpoch(fromTime).toString() + " to " + - DateTime.fromMicrosecondsSinceEpoch(toTime).toString()); + DateTime.fromMicrosecondsSinceEpoch(toTime).toString(),); final files = await getDeviceFiles(fromTime, toTime, _computer); if (files.isNotEmpty) { _logger.info("Fetched " + files.length.toString() + " files."); @@ -233,7 +233,7 @@ class LocalSyncService { .removeWhere((file) => downloadedFileIDs.contains(file.localID)); if (updatedFiles.isNotEmpty) { _logger.info( - updatedFiles.length.toString() + " local files were updated."); + updatedFiles.length.toString() + " local files were updated.",); } for (final file in updatedFiles) { await _db.updateUploadedFile( diff --git a/lib/services/memories_service.dart b/lib/services/memories_service.dart index 01d57b8a7..34efd7f29 100644 --- a/lib/services/memories_service.dart +++ b/lib/services/memories_service.dart @@ -30,7 +30,7 @@ class MemoriesService extends ChangeNotifier { // Intention of delay is to give more CPU cycles to other tasks Future.delayed(const Duration(seconds: 5), () { _memoriesDB.clearMemoriesSeenBeforeTime( - DateTime.now().microsecondsSinceEpoch - (7 * kMicroSecondsInDay)); + DateTime.now().microsecondsSinceEpoch - (7 * kMicroSecondsInDay),); }); } @@ -56,7 +56,7 @@ class MemoriesService extends ChangeNotifier { final present = presentTime.subtract(Duration( hours: presentTime.hour, minutes: presentTime.minute, - seconds: presentTime.second)); + seconds: presentTime.second,),); final List> durations = []; for (var yearAgo = 1; yearAgo <= yearsBefore; yearAgo++) { final date = _getDate(present, yearAgo); @@ -94,7 +94,7 @@ class MemoriesService extends ChangeNotifier { Future markMemoryAsSeen(Memory memory) async { memory.markSeen(); await _memoriesDB.markMemoryAsSeen( - memory, DateTime.now().microsecondsSinceEpoch); + memory, DateTime.now().microsecondsSinceEpoch,); notifyListeners(); } } diff --git a/lib/services/notification_service.dart b/lib/services/notification_service.dart index 7d8ea2d35..b822b394c 100644 --- a/lib/services/notification_service.dart +++ b/lib/services/notification_service.dart @@ -21,7 +21,7 @@ class NotificationService { android: initializationSettingsAndroid, ); await _flutterLocalNotificationsPlugin.initialize(initializationSettings, - onSelectNotification: selectNotification); + onSelectNotification: selectNotification,); } Future selectNotification(String payload) async {} @@ -42,6 +42,6 @@ class NotificationService { const NotificationDetails platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics); await _flutterLocalNotificationsPlugin.show( - 0, title, message, platformChannelSpecifics); + 0, title, message, platformChannelSpecifics,); } } diff --git a/lib/services/push_service.dart b/lib/services/push_service.dart index 5c645cc7d..03a5c0ccf 100644 --- a/lib/services/push_service.dart +++ b/lib/services/push_service.dart @@ -61,7 +61,7 @@ class PushService { await _setPushTokenOnServer(fcmToken, apnsToken); await _prefs.setString(kFCMPushToken, fcmToken); await _prefs.setInt( - kLastFCMTokenUpdationTime, DateTime.now().microsecondsSinceEpoch); + kLastFCMTokenUpdationTime, DateTime.now().microsecondsSinceEpoch,); _logger.info("Push token updated on server"); } catch (e) { _logger.severe("Could not set push token", e, StackTrace.current); @@ -88,7 +88,7 @@ class PushService { _logger.info("Message data: ${message.data}"); if (message.notification != null) { _logger.info( - "Message also contained a notification: ${message.notification}"); + "Message also contained a notification: ${message.notification}",); } if (shouldSync(message)) { SyncService.instance.sync(); diff --git a/lib/services/remote_sync_service.dart b/lib/services/remote_sync_service.dart index c3efb6757..48e9e94fa 100644 --- a/lib/services/remote_sync_service.dart +++ b/lib/services/remote_sync_service.dart @@ -147,7 +147,7 @@ class RemoteSyncService { } for (final c in updatedCollections) { await _syncCollectionDiff( - c.id, _collectionsService.getCollectionSyncTime(c.id)); + c.id, _collectionsService.getCollectionSyncTime(c.id),); await _collectionsService.setCollectionSyncTime(c.id, c.updationTime); } } @@ -157,7 +157,7 @@ class RemoteSyncService { final collections = _collectionsService.getActiveCollections(); for (final c in collections) { await _syncCollectionDiff(c.id, - min(_collectionsService.getCollectionSyncTime(c.id), sinceTime)); + min(_collectionsService.getCollectionSyncTime(c.id), sinceTime),); await _collectionsService.setCollectionSyncTime(c.id, c.updationTime); } } @@ -171,16 +171,16 @@ class RemoteSyncService { (await FilesDB.instance.getFilesFromIDs(fileIDs)).values.toList(); await FilesDB.instance.deleteFilesFromCollection(collectionID, fileIDs); Bus.instance.fire(CollectionUpdatedEvent(collectionID, deletedFiles, - type: EventType.deletedFromRemote)); + type: EventType.deletedFromRemote,),); Bus.instance.fire(LocalPhotosUpdatedEvent(deletedFiles, - type: EventType.deletedFromRemote)); + type: EventType.deletedFromRemote,),); } if (diff.updatedFiles.isNotEmpty) { await _storeDiff(diff.updatedFiles, collectionID); _logger.info("Updated " + diff.updatedFiles.length.toString() + " files in collection " + - collectionID.toString()); + collectionID.toString(),); Bus.instance.fire(LocalPhotosUpdatedEvent(diff.updatedFiles)); Bus.instance .fire(CollectionUpdatedEvent(collectionID, diff.updatedFiles)); @@ -188,11 +188,11 @@ class RemoteSyncService { if (diff.latestUpdatedAtTime > 0) { await _collectionsService.setCollectionSyncTime( - collectionID, diff.latestUpdatedAtTime); + collectionID, diff.latestUpdatedAtTime,); } if (diff.hasMore) { return await _syncCollectionDiff(collectionID, - _collectionsService.getCollectionSyncTime(collectionID)); + _collectionsService.getCollectionSyncTime(collectionID),); } } @@ -214,10 +214,10 @@ class RemoteSyncService { final int prevCount = filesToBeUploaded.length; final ignoredIDs = await IgnoredFilesService.instance.ignoredIDs; filesToBeUploaded.removeWhere((file) => - IgnoredFilesService.instance.shouldSkipUpload(ignoredIDs, file)); + IgnoredFilesService.instance.shouldSkipUpload(ignoredIDs, file),); if (prevCount != filesToBeUploaded.length) { _logger.info((prevCount - filesToBeUploaded.length).toString() + - " files were ignored for upload"); + " files were ignored for upload",); } } if (filesToBeUploaded.isEmpty) { @@ -227,7 +227,7 @@ class RemoteSyncService { } _sortByTimeAndType(filesToBeUploaded); _logger.info( - filesToBeUploaded.length.toString() + " new files to be uploaded."); + filesToBeUploaded.length.toString() + " new files to be uploaded.",); return filesToBeUploaded; } @@ -322,11 +322,11 @@ class RemoteSyncService { _logger.info( "Incorrect sync status", InvalidSyncStatusError("Tried to report $_completedUploads as " - "uploaded out of $toBeUploadedInThisSession")); + "uploaded out of $toBeUploadedInThisSession",),); return; } Bus.instance.fire(SyncStatusUpdate(SyncStatus.in_progress, - completed: _completedUploads, total: toBeUploadedInThisSession)); + completed: _completedUploads, total: toBeUploadedInThisSession,),); } Future _storeDiff(List diff, int collectionID) async { @@ -367,12 +367,12 @@ class RemoteSyncService { e.localID != null && e.localID == file.localID, orElse: () => existingFiles.firstWhere((e) => e.localID != null, - orElse: () => null)); + orElse: () => null,),); if (fileWithLocalID != null) { // File should ideally have the same localID if (file.localID != null && file.localID != fileWithLocalID.localID) { _logger.severe( - "unexpected mismatch in localIDs remote: ${file.toString()} and existing: ${fileWithLocalID.toString()}"); + "unexpected mismatch in localIDs remote: ${file.toString()} and existing: ${fileWithLocalID.toString()}",); } file.localID = fileWithLocalID.localID; } else { @@ -385,7 +385,7 @@ class RemoteSyncService { if (file.modificationTime != existingFiles[0].modificationTime) { // File was updated since the app was uninstalled _logger.info("Updated since last installation: " + - file.uploadedFileID.toString()); + file.uploadedFileID.toString(),); file.modificationTime = existingFiles[0].modificationTime; file.updationTime = null; updated++; diff --git a/lib/services/sync_service.dart b/lib/services/sync_service.dart index 7d8dfb04a..8398fc5c2 100644 --- a/lib/services/sync_service.dart +++ b/lib/services/sync_service.dart @@ -91,18 +91,18 @@ class SyncService { } on WiFiUnavailableError { _logger.warning("Not uploading over mobile data"); Bus.instance.fire( - SyncStatusUpdate(SyncStatus.paused, reason: "waiting for WiFi...")); + SyncStatusUpdate(SyncStatus.paused, reason: "waiting for WiFi..."),); } on SyncStopRequestedError { _syncStopRequested = false; Bus.instance.fire( - SyncStatusUpdate(SyncStatus.completed_backup, wasStopped: true)); + SyncStatusUpdate(SyncStatus.completed_backup, wasStopped: true),); } on NoActiveSubscriptionError { Bus.instance.fire(SyncStatusUpdate(SyncStatus.error, - error: NoActiveSubscriptionError())); + error: NoActiveSubscriptionError(),),); } on StorageLimitExceededError { _showStorageLimitExceededNotification(); Bus.instance.fire(SyncStatusUpdate(SyncStatus.error, - error: StorageLimitExceededError())); + error: StorageLimitExceededError(),),); } on UnauthorizedError { _logger.info("Logging user out"); Bus.instance.fire(TriggerLogoutEvent()); @@ -113,7 +113,7 @@ class SyncService { e.type == DioErrorType.receiveTimeout || e.type == DioErrorType.other) { Bus.instance.fire(SyncStatusUpdate(SyncStatus.paused, - reason: "waiting for network...")); + reason: "waiting for network...",),); _logger.severe("unable to connect", e, StackTrace.current); return false; } @@ -157,13 +157,13 @@ class SyncService { void onFoldersSet(Set paths) { _uploader.removeFromQueueWhere((file) { return !paths.contains(file.deviceFolder); - }, UserCancelledUploadError()); + }, UserCancelledUploadError(),); } void onVideoBackupPaused() { _uploader.removeFromQueueWhere((file) { return file.fileType == FileType.video; - }, UserCancelledUploadError()); + }, UserCancelledUploadError(),); } Future deleteFilesOnServer(List fileIDs) async { @@ -224,7 +224,7 @@ class SyncService { if ((now - lastNotificationShownTime) > kMicroSecondsInDay) { await _prefs.setInt(kLastStorageLimitExceededNotificationPushTime, now); NotificationService.instance.showNotification( - "storage limit exceeded", "sorry, we had to pause your backups"); + "storage limit exceeded", "sorry, we had to pause your backups",); } } } diff --git a/lib/services/trash_sync_service.dart b/lib/services/trash_sync_service.dart index 091d7a1b6..f9d5010cb 100644 --- a/lib/services/trash_sync_service.dart +++ b/lib/services/trash_sync_service.dart @@ -113,7 +113,7 @@ class TrashSyncService { } Future> _trashFiles( - Map requestData) async { + Map requestData,) async { return _dio.post( Configuration.instance.getHttpEndpoint() + "/files/trash", options: Options( diff --git a/lib/services/update_service.dart b/lib/services/update_service.dart index 5d2186e8c..f8fe19d8d 100644 --- a/lib/services/update_service.dart +++ b/lib/services/update_service.dart @@ -69,7 +69,7 @@ class UpdateService { hasBeen3DaysSinceLastNotification && _latestVersion.shouldNotify) { NotificationService.instance.showNotification( - "update available", "click to install our best version yet"); + "update available", "click to install our best version yet",); await _prefs.setInt(kUpdateAvailableShownTimeKey, now); } else { _logger.info("Debouncing notification"); diff --git a/lib/services/user_service.dart b/lib/services/user_service.dart index 781561ac6..5e4c7741c 100644 --- a/lib/services/user_service.dart +++ b/lib/services/user_service.dart @@ -61,7 +61,7 @@ class UserService { builder: (BuildContext context) { return OTTVerificationPage(email, isChangeEmail: isChangeEmail, - isCreateAccountScreen: isCreateAccountScreen); + isCreateAccountScreen: isCreateAccountScreen,); }, ), ); @@ -151,7 +151,7 @@ class UserService { ), queryParameters: { "token": token, - }); + },); } on DioError catch (e) { _logger.info(e); rethrow; @@ -165,7 +165,7 @@ class UserService { headers: { "X-Auth-Token": _config.getToken(), }, - )); + ),); } on DioError catch (e) { _logger.warning('failed to leave family plan', e); rethrow; @@ -182,7 +182,7 @@ class UserService { headers: { "X-Auth-Token": _config.getToken(), }, - )); + ),); if (response != null && response.statusCode == 200) { await Configuration.instance.logout(); await dialog.hide(); @@ -240,11 +240,11 @@ class UserService { await dialog.hide(); if (e.response != null && e.response.statusCode == 410) { await showErrorDialog( - context, "Oops", "Your verification code has expired"); + context, "Oops", "Your verification code has expired",); Navigator.of(context).pop(); } else { showErrorDialog(context, "Incorrect code", - "Sorry, the code you've entered is incorrect"); + "Sorry, the code you've entered is incorrect",); } } catch (e) { await dialog.hide(); @@ -288,7 +288,7 @@ class UserService { showErrorDialog(context, "Oops", "This email is already in use"); } else { showErrorDialog(context, "Incorrect code", - "Authentication failed, please try again"); + "Authentication failed, please try again",); } } catch (e) { await dialog.hide(); @@ -371,7 +371,7 @@ class UserService { } Future verifyTwoFactor( - BuildContext context, String sessionID, String code) async { + BuildContext context, String sessionID, String code,) async { final dialog = createProgressDialog(context, "Authenticating..."); await dialog.show(); try { @@ -410,13 +410,13 @@ class UserService { ); } else { showErrorDialog(context, "Incorrect code", - "Authentication failed, please try again"); + "Authentication failed, please try again",); } } catch (e) { await dialog.hide(); _logger.severe(e); showErrorDialog( - context, "Oops", "Authentication failed, please try again"); + context, "Oops", "Authentication failed, please try again",); } } @@ -437,7 +437,7 @@ class UserService { return TwoFactorRecoveryPage( sessionID, response.data["encryptedSecret"], - response.data["secretDecryptionNonce"]); + response.data["secretDecryptionNonce"],); }, ), (route) => route.isFirst, @@ -457,12 +457,12 @@ class UserService { ); } else { showErrorDialog( - context, "Oops", "Something went wrong, please try again"); + context, "Oops", "Something went wrong, please try again",); } } catch (e) { _logger.severe(e); showErrorDialog( - context, "Oops", "Something went wrong, please try again"); + context, "Oops", "Something went wrong, please try again",); } finally { await dialog.hide(); } @@ -482,11 +482,11 @@ class UserService { secret = Sodium.bin2base64(await CryptoUtil.decrypt( Sodium.base642bin(encryptedSecret), Sodium.hex2bin(recoveryKey.trim()), - Sodium.base642bin(secretDecryptionNonce))); + Sodium.base642bin(secretDecryptionNonce),),); } catch (e) { await dialog.hide(); showErrorDialog(context, "Incorrect recovery key", - "The recovery key you entered is incorrect"); + "The recovery key you entered is incorrect",); return; } try { @@ -523,12 +523,12 @@ class UserService { ); } else { showErrorDialog( - context, "Oops", "Something went wrong, please try again"); + context, "Oops", "Something went wrong, please try again",); } } catch (e) { _logger.severe(e); showErrorDialog( - context, "Oops", "Something went wrong, please try again"); + context, "Oops", "Something went wrong, please try again",); } finally { await dialog.hide(); } @@ -550,7 +550,7 @@ class UserService { routeToPage( context, TwoFactorSetupPage( - response.data["secretCode"], response.data["qrCode"])); + response.data["secretCode"], response.data["qrCode"],),); } catch (e, s) { await dialog.hide(); _logger.severe(e, s); @@ -559,7 +559,7 @@ class UserService { } Future enableTwoFactor( - BuildContext context, String secret, String code) async { + BuildContext context, String secret, String code,) async { Uint8List recoveryKey; try { recoveryKey = await getOrCreateRecoveryKey(context); @@ -597,12 +597,12 @@ class UserService { if (e is DioError) { if (e.response != null && e.response.statusCode == 401) { showErrorDialog(context, "Incorrect code", - "Please verify the code you have entered"); + "Please verify the code you have entered",); return false; } } showErrorDialog(context, "Something went wrong", - "Please contact support if the problem persists"); + "Please contact support if the problem persists",); } return false; } @@ -627,7 +627,7 @@ class UserService { await dialog.hide(); _logger.severe(e, s); showErrorDialog(context, "Something went wrong", - "Please contact support if the problem persists"); + "Please contact support if the problem persists",); } } @@ -716,7 +716,7 @@ class UserService { await Configuration.instance .setEncryptedToken(response.data["encryptedToken"]); await Configuration.instance.setKeyAttributes( - KeyAttributes.fromMap(response.data["keyAttributes"])); + KeyAttributes.fromMap(response.data["keyAttributes"]),); } else { await Configuration.instance.setToken(response.data["token"]); } diff --git a/lib/ui/app_lock.dart b/lib/ui/app_lock.dart index 74f1c63ad..d81afd345 100644 --- a/lib/ui/app_lock.dart +++ b/lib/ui/app_lock.dart @@ -106,11 +106,11 @@ class _AppLockState extends State with WidgetsBindingObserver { switch (settings.name) { case '/lock-screen': return PageRouteBuilder( - pageBuilder: (_, __, ___) => this._lockScreen); + pageBuilder: (_, __, ___) => this._lockScreen,); case '/unlocked': return PageRouteBuilder( pageBuilder: (_, __, ___) => - this.widget.builder(settings.arguments)); + this.widget.builder(settings.arguments),); } return PageRouteBuilder(pageBuilder: (_, __, ___) => this._lockScreen); }, diff --git a/lib/ui/app_update_dialog.dart b/lib/ui/app_update_dialog.dart index 30b16db13..bed648988 100644 --- a/lib/ui/app_update_dialog.dart +++ b/lib/ui/app_update_dialog.dart @@ -22,7 +22,7 @@ class _AppUpdateDialogState extends State { changelog.add(Padding( padding: const EdgeInsets.fromLTRB(8, 4, 0, 4), child: Text("- " + log, style: Theme.of(context).textTheme.caption), - )); + ),); } final content = Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -39,7 +39,7 @@ class _AppUpdateDialogState extends State { Text("Changelog", style: TextStyle( fontSize: 18, - )), + ),), Padding(padding: EdgeInsets.all(4)), Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -81,7 +81,7 @@ class _AppUpdateDialogState extends State { child: AlertDialog( title: Text(shouldForceUpdate ? "Critical update available" - : "Update available"), + : "Update available",), content: content, ), ); @@ -139,7 +139,7 @@ class _ApkDownloaderDialogState extends State { setState(() { _downloadProgress = count / widget.versionInfo.size; }); - }); + },); Navigator.of(context, rootNavigator: true).pop('dialog'); OpenFile.open(_saveUrl); } catch (e) { diff --git a/lib/ui/archive_page.dart b/lib/ui/archive_page.dart index 284cd2528..1b19bb3f1 100644 --- a/lib/ui/archive_page.dart +++ b/lib/ui/archive_page.dart @@ -20,7 +20,7 @@ class ArchivePage extends StatelessWidget { {this.tagPrefix = "archived_page", this.appBarType = GalleryType.archive, this.overlayType = GalleryType.archive, - Key key}) + Key key,}) : super(key: key); @override @@ -29,13 +29,13 @@ class ArchivePage extends StatelessWidget { asyncLoader: (creationStartTime, creationEndTime, {limit, asc}) { return FilesDB.instance.getAllUploadedFiles(creationStartTime, creationEndTime, Configuration.instance.getUserID(), - visibility: kVisibilityArchive, limit: limit, asc: asc); + visibility: kVisibilityArchive, limit: limit, asc: asc,); }, reloadEvent: Bus.instance.on().where( (event) => event.updatedFiles.firstWhere( (element) => element.uploadedFileID != null, - orElse: () => null) != + orElse: () => null,) != null, ), removalEventTypes: const {EventType.unarchived}, @@ -44,7 +44,7 @@ class ArchivePage extends StatelessWidget { (event) => event.updatedFiles.firstWhere( (element) => element.uploadedFileID != null, - orElse: () => null) != + orElse: () => null,) != null, ), ], diff --git a/lib/ui/backup_folder_selection_page.dart b/lib/ui/backup_folder_selection_page.dart index b0e552169..168a9eca7 100644 --- a/lib/ui/backup_folder_selection_page.dart +++ b/lib/ui/backup_folder_selection_page.dart @@ -133,7 +133,7 @@ class _BackupFolderSelectionPageState extends State { .compareTo(second.deviceFolder.toLowerCase()); }); setState(() {}); - }), + },), Expanded(child: _getFolders()), Hero( tag: "select_folders", @@ -144,10 +144,10 @@ class _BackupFolderSelectionPageState extends State { color: Theme.of(context).backgroundColor, blurRadius: 24, offset: Offset(0, -8), - spreadRadius: 4) - ]), + spreadRadius: 4,) + ],), padding: EdgeInsets.only( - left: 20, right: 20, bottom: Platform.isIOS ? 60 : 32), + left: 20, right: 20, bottom: Platform.isIOS ? 60 : 32,), child: OutlinedButton( child: Text(widget.buttonText), onPressed: _selectedFolders.isEmpty @@ -239,11 +239,11 @@ class _BackupFolderSelectionPageState extends State { ? LinearGradient(colors: const [ Color(0xFF00DD4D), Color(0xFF43BA6C) - ]) //same for both themes + ],) //same for both themes : LinearGradient(colors: [ Theme.of(context).colorScheme.boxUnSelectColor, Theme.of(context).colorScheme.boxUnSelectColor - ])), + ],),), padding: EdgeInsets.fromLTRB(8, 4, 4, 4), child: InkWell( child: Row( @@ -356,8 +356,8 @@ class _BackupFolderSelectionPageState extends State { Icons.local_police, color: Colors.white, ) - : null), - ]), + : null,), + ],), height: 88, width: 88, ), diff --git a/lib/ui/billing_questions_widget.dart b/lib/ui/billing_questions_widget.dart index 816007667..658bd5871 100644 --- a/lib/ui/billing_questions_widget.dart +++ b/lib/ui/billing_questions_widget.dart @@ -35,13 +35,13 @@ class BillingQuestionsWidget extends StatelessWidget { fontWeight: FontWeight.bold, ), ), - )); + ),); for (final faq in snapshot.data) { faqs.add(FaqWidget(faq: faq)); } faqs.add(Padding( padding: EdgeInsets.all(16), - )); + ),); return SingleChildScrollView( child: Column( children: faqs, diff --git a/lib/ui/change_email_dialog.dart b/lib/ui/change_email_dialog.dart index 7c2a3d876..037830c0f 100644 --- a/lib/ui/change_email_dialog.dart +++ b/lib/ui/change_email_dialog.dart @@ -65,7 +65,7 @@ class _ChangeEmailDialogState extends State { onPressed: () { if (!isValidEmail(_email)) { showErrorDialog(context, "Invalid email address", - "Please enter a valid email address."); + "Please enter a valid email address.",); return; } UserService.instance.getOtt(context, _email, isChangeEmail: true); diff --git a/lib/ui/collection_page.dart b/lib/ui/collection_page.dart index d997627b6..39563e2f4 100644 --- a/lib/ui/collection_page.dart +++ b/lib/ui/collection_page.dart @@ -21,7 +21,7 @@ class CollectionPage extends StatelessWidget { {this.tagPrefix = "collection", this.appBarType = GalleryType.owned_collection, this.overlayType = GalleryType.owned_collection, - Key key}) + Key key,}) : super(key: key); @override @@ -31,7 +31,7 @@ class CollectionPage extends StatelessWidget { asyncLoader: (creationStartTime, creationEndTime, {limit, asc}) { return FilesDB.instance.getFilesInCollection( c.collection.id, creationStartTime, creationEndTime, - limit: limit, asc: asc); + limit: limit, asc: asc,); }, reloadEvent: Bus.instance .on() diff --git a/lib/ui/collections_gallery_widget.dart b/lib/ui/collections_gallery_widget.dart index e3d462e92..aed36be79 100644 --- a/lib/ui/collections_gallery_widget.dart +++ b/lib/ui/collections_gallery_widget.dart @@ -101,7 +101,7 @@ class _CollectionsGalleryWidgetState extends State folders.add(DeviceFolder(file.deviceFolder, file.deviceFolder, file)); } folders.sort((first, second) => - second.thumbnail.creationTime.compareTo(first.thumbnail.creationTime)); + second.thumbnail.creationTime.compareTo(first.thumbnail.creationTime),); final List collectionsWithThumbnail = []; final latestCollectionFiles = @@ -137,7 +137,7 @@ class _CollectionsGalleryWidgetState extends State .subtitle1 .copyWith( color: - Theme.of(context).textTheme.subtitle1.color.withOpacity(0.5)); + Theme.of(context).textTheme.subtitle1.color.withOpacity(0.5),); Size size = MediaQuery.of(context).size; int albumsCountInOneRow = max(size.width ~/ 220.0, 2); final double sideOfThumbnail = (size.width / 2) - @@ -156,7 +156,7 @@ class _CollectionsGalleryWidgetState extends State padding: const EdgeInsets.all(22), child: nothingToSeeHere( textColor: - Theme.of(context).colorScheme.defaultTextColor), + Theme.of(context).colorScheme.defaultTextColor,), ) : Padding( padding: const EdgeInsets.symmetric(horizontal: 8), @@ -168,7 +168,7 @@ class _CollectionsGalleryWidgetState extends State ? nothingToSeeHere( textColor: Theme.of(context) .colorScheme - .defaultTextColor) + .defaultTextColor,) : ListView.builder( shrinkWrap: true, scrollDirection: Axis.horizontal, @@ -203,7 +203,7 @@ class _CollectionsGalleryWidgetState extends State // to disable GridView's scrolling itemBuilder: (context, index) { return _buildCollection( - context, items.collections, index); + context, items.collections, index,); }, itemCount: items.collections.length + 1, // To include the + button @@ -213,11 +213,11 @@ class _CollectionsGalleryWidgetState extends State crossAxisSpacing: crossAxisSpacingOfGrid, childAspectRatio: sideOfThumbnail / (sideOfThumbnail + - 24)), //24 is height of album title + 24),), //24 is height of album title ), ) : nothingToSeeHere( - textColor: Theme.of(context).colorScheme.defaultTextColor), + textColor: Theme.of(context).colorScheme.defaultTextColor,), const SizedBox(height: 10), const Divider(), const Padding(padding: EdgeInsets.all(8)), @@ -265,12 +265,12 @@ class _CollectionsGalleryWidgetState extends State text: "Trash", style: Theme.of(context) .textTheme - .subtitle1), + .subtitle1,), TextSpan(text: " \u2022 "), TextSpan( - text: snapshot.data.toString()), + text: snapshot.data.toString(),), //need to query in db and bring this value - ])); + ],),); } else { return RichText( text: TextSpan( @@ -280,9 +280,9 @@ class _CollectionsGalleryWidgetState extends State text: "Trash", style: Theme.of(context) .textTheme - .subtitle1), + .subtitle1,), //need to query in db and bring this value - ])); + ],),); } }, ), @@ -336,7 +336,7 @@ class _CollectionsGalleryWidgetState extends State future: FilesDB.instance .fileCountWithVisibility( kVisibilityArchive, - Configuration.instance.getUserID()), + Configuration.instance.getUserID(),), builder: (context, snapshot) { if (snapshot.hasData && snapshot.data > 0) { return RichText( @@ -347,12 +347,12 @@ class _CollectionsGalleryWidgetState extends State text: "Hidden", style: Theme.of(context) .textTheme - .subtitle1), + .subtitle1,), TextSpan(text: " \u2022 "), TextSpan( - text: snapshot.data.toString()), + text: snapshot.data.toString(),), //need to query in db and bring this value - ])); + ],),); } else { return RichText( text: TextSpan( @@ -362,9 +362,9 @@ class _CollectionsGalleryWidgetState extends State text: "Hidden", style: Theme.of(context) .textTheme - .subtitle1), + .subtitle1,), //need to query in db and bring this value - ])); + ],),); } }, ), @@ -411,7 +411,7 @@ class _CollectionsGalleryWidgetState extends State return Text(text, style: Theme.of(context).textTheme.subtitle1.copyWith( fontSize: 14, - color: Theme.of(context).iconTheme.color.withOpacity(0.7))); + color: Theme.of(context).iconTheme.color.withOpacity(0.7),),); } return Padding( @@ -461,7 +461,7 @@ class _CollectionsGalleryWidgetState extends State } Widget _buildCollection(BuildContext context, - List collections, int index) { + List collections, int index,) { if (index < collections.length) { final c = collections[index]; return CollectionItem(c); @@ -476,7 +476,7 @@ class _CollectionsGalleryWidgetState extends State blurRadius: 2, spreadRadius: 0, offset: Offset(0, 0), - color: Theme.of(context).iconTheme.color.withOpacity(0.3)) + color: Theme.of(context).iconTheme.color.withOpacity(0.3),) ], borderRadius: BorderRadius.circular(4), ), @@ -488,7 +488,7 @@ class _CollectionsGalleryWidgetState extends State onTap: () async { await showToast(context, "long press to select photos and click + to create an album", - toastLength: Toast.LENGTH_LONG); + toastLength: Toast.LENGTH_LONG,); Bus.instance .fire(TabChangedEvent(0, TabChangedEventSource.collections_page)); }, @@ -568,7 +568,7 @@ class DeviceFolderIcon extends StatelessWidget { shouldShowSyncStatus: false, key: Key("device_folder:" + folder.path + - folder.thumbnail.tag()), + folder.thumbnail.tag(),), ), isBackedUp ? Container() : kUnsyncedIconOverlay, ], @@ -631,9 +631,9 @@ class CollectionItem extends StatelessWidget { key: Key( "collection" + c.thumbnail.tag(), ), - )), + ),), height: sideOfThumbnail, - width: sideOfThumbnail), + width: sideOfThumbnail,), ), SizedBox(height: 4), Row( @@ -654,12 +654,12 @@ class CollectionItem extends StatelessWidget { text: TextSpan( style: albumTitleTextStyle.copyWith( color: - albumTitleTextStyle.color.withOpacity(0.5)), + albumTitleTextStyle.color.withOpacity(0.5),), children: [ TextSpan(text: " \u2022 "), TextSpan(text: snapshot.data.toString()), //need to query in db and bring this value - ])); + ],),); } else { return Container(); } diff --git a/lib/ui/common/bottomShadow.dart b/lib/ui/common/bottomShadow.dart index 42af573b4..ce6e49fdf 100644 --- a/lib/ui/common/bottomShadow.dart +++ b/lib/ui/common/bottomShadow.dart @@ -19,7 +19,7 @@ class BottomShadowWidget extends StatelessWidget { : shadowColor, spreadRadius: 42, blurRadius: 42, - offset: Offset(0, offsetDy) // changes position of shadow + offset: Offset(0, offsetDy), // changes position of shadow ), ], ), diff --git a/lib/ui/common/dynamicFAB.dart b/lib/ui/common/dynamicFAB.dart index 6575a7942..6a5439eda 100644 --- a/lib/ui/common/dynamicFAB.dart +++ b/lib/ui/common/dynamicFAB.dart @@ -14,7 +14,7 @@ class DynamicFAB extends StatelessWidget { this.isKeypadOpen, this.buttonText, this.isFormValid, - this.onPressedFunction}) + this.onPressedFunction,}) : super(key: key); @override @@ -52,7 +52,7 @@ class DynamicFAB extends StatelessWidget { ? onPressedFunction : () { FocusScope.of(context).unfocus(); - } //keypad down here + }, //keypad down here ), ], ), diff --git a/lib/ui/common/onlyOuterShadow.dart b/lib/ui/common/onlyOuterShadow.dart index fea9b32db..f489552f4 100644 --- a/lib/ui/common/onlyOuterShadow.dart +++ b/lib/ui/common/onlyOuterShadow.dart @@ -13,7 +13,7 @@ class onlyOuterShadow extends BoxShadow { color: color, offset: offset, blurRadius: blurRadius, - spreadRadius: spreadRadius); + spreadRadius: spreadRadius,); @override Paint toPaint() { @@ -23,7 +23,7 @@ class onlyOuterShadow extends BoxShadow { assert(() { if (debugDisableShadows) result.maskFilter = null; return true; - }()); + }(),); return result; } } diff --git a/lib/ui/common/report_bug_popup.dart b/lib/ui/common/report_bug_popup.dart index cf8c3199a..ed1b39e2c 100644 --- a/lib/ui/common/report_bug_popup.dart +++ b/lib/ui/common/report_bug_popup.dart @@ -20,7 +20,7 @@ PopupMenuButton reportBugPopupMenu(BuildContext context) { onSelected: (value) async { if (value == 1) { await sendLogs(context, "Contact support", "support@ente.io", - postShare: () {}); + postShare: () {},); } }, ); diff --git a/lib/ui/create_collection_page.dart b/lib/ui/create_collection_page.dart index 94b78807f..1c30bd3d3 100644 --- a/lib/ui/create_collection_page.dart +++ b/lib/ui/create_collection_page.dart @@ -44,7 +44,7 @@ class CreateCollectionPage extends StatefulWidget { final CollectionActionType actionType; const CreateCollectionPage(this.selectedFiles, this.sharedFiles, - {Key key, this.actionType = CollectionActionType.addFiles}) + {Key key, this.actionType = CollectionActionType.addFiles,}) : super(key: key); @override @@ -78,7 +78,7 @@ class _CreateCollectionPageState extends State { Expanded( child: Padding( padding: const EdgeInsets.only( - top: 30, bottom: 12, left: 40, right: 40), + top: 30, bottom: 12, left: 40, right: 40,), child: GradientButton( child: Row( mainAxisAlignment: MainAxisAlignment.center, @@ -185,7 +185,7 @@ class _CreateCollectionPageState extends State { context, widget.actionType == CollectionActionType.addFiles ? "Added successfully to " + item.collection.name - : "Moved successfully to " + item.collection.name); + : "Moved successfully to " + item.collection.name,); _navigateToCollection(item.collection); } }, @@ -243,10 +243,10 @@ class _CreateCollectionPageState extends State { if (await _runCollectionAction(collection.id)) { if (widget.actionType == CollectionActionType.restoreFiles) { showShortToast( - context, 'Restored files to album ' + _albumName); + context, 'Restored files to album ' + _albumName,); } else { showShortToast( - context, "Album '" + _albumName + "' created."); + context, "Album '" + _albumName + "' created.",); } _navigateToCollection(collection); } @@ -272,7 +272,7 @@ class _CreateCollectionPageState extends State { type: PageTransitionType.bottomToTop, child: CollectionPage( CollectionWithThumbnail(collection, null), - ))); + ),),); } Future _runCollectionAction(int collectionID) async { @@ -293,7 +293,7 @@ class _CreateCollectionPageState extends State { try { int fromCollectionID = widget.selectedFiles.files?.first?.collectionID; await CollectionsService.instance.move(toCollectionID, fromCollectionID, - widget.selectedFiles.files?.toList()); + widget.selectedFiles.files?.toList(),); RemoteSyncService.instance.sync(silently: true); widget.selectedFiles?.clearAll(); await dialog.hide(); @@ -340,7 +340,7 @@ class _CreateCollectionPageState extends State { final List filesPendingUpload = []; if (widget.sharedFiles != null) { filesPendingUpload.addAll(await convertIncomingSharedMediaToFile( - widget.sharedFiles, collectionID)); + widget.sharedFiles, collectionID,),); } else { final List filesPendingUpload = []; for (final file in widget.selectedFiles.files) { diff --git a/lib/ui/deduplicate_page.dart b/lib/ui/deduplicate_page.dart index fa5658158..c93971be8 100644 --- a/lib/ui/deduplicate_page.dart +++ b/lib/ui/deduplicate_page.dart @@ -127,14 +127,14 @@ class _DeduplicatePageState extends State { padding: EdgeInsets.only(top: 32), child: nothingToSeeHere( textColor: - Theme.of(context).colorScheme.defaultTextColor), + Theme.of(context).colorScheme.defaultTextColor,), ); } } return Padding( padding: const EdgeInsets.only(top: 10, bottom: 10), child: _getGridView(_duplicates[index - kHeaderRowCount], - index - kHeaderRowCount), + index - kHeaderRowCount,), ); }, itemCount: _duplicates.length + kHeaderRowCount, @@ -156,7 +156,7 @@ class _DeduplicatePageState extends State { "Following files were clubbed based on their sizes" + ((_shouldClubByCaptureTime ? " and capture times." : ".") + ", please review and delete the items you believe are duplicates."), - style: Theme.of(context).textTheme.subtitle2), + style: Theme.of(context).textTheme.subtitle2,), Padding( padding: EdgeInsets.all(12), ), @@ -211,7 +211,7 @@ class _DeduplicatePageState extends State { text, style: Theme.of(context).textTheme.subtitle1.copyWith( fontSize: 14, - color: Theme.of(context).iconTheme.color.withOpacity(0.7)), + color: Theme.of(context).iconTheme.color.withOpacity(0.7),), ); } @@ -389,7 +389,7 @@ class _DeduplicatePageState extends State { ), ), _selectedFiles.contains(file) ? kDeleteIconOverlay : Container(), - ]), + ],), ), ); } diff --git a/lib/ui/detail_page.dart b/lib/ui/detail_page.dart index 0cf4e4a08..5008bf150 100644 --- a/lib/ui/detail_page.dart +++ b/lib/ui/detail_page.dart @@ -97,7 +97,7 @@ class _DetailPageState extends State { (_selectedIndex + 1).toString() + " / " + _files.length.toString() + - " files ."); + " files .",); _appBarKey = GlobalKey(); _bottomBarKey = GlobalKey(); return Scaffold( @@ -201,7 +201,7 @@ class _DetailPageState extends State { _files[_selectedIndex].creationTime + 1, DateTime.now().microsecondsSinceEpoch, limit: kLoadLimit, - asc: true); + asc: true,); setState(() { // Returned result could be a subtype of File // ignore: unnecessary_cast @@ -219,7 +219,7 @@ class _DetailPageState extends State { if (_selectedIndex == _files.length - 1 && !_hasLoadedTillEnd) { final result = await widget.config.asyncLoader( kGalleryLoadStartTime, _files[_selectedIndex].creationTime - 1, - limit: kLoadLimit); + limit: kLoadLimit,); setState(() { if (!result.hasMore) { _hasLoadedTillEnd = true; @@ -248,13 +248,13 @@ class _DetailPageState extends State { if (_selectedIndex == totalFiles - 1) { // Deleted the last file await _pageController.previousPage( - duration: Duration(milliseconds: 200), curve: Curves.easeInOut); + duration: Duration(milliseconds: 200), curve: Curves.easeInOut,); setState(() { _files.remove(file); }); } else { await _pageController.nextPage( - duration: Duration(milliseconds: 200), curve: Curves.easeInOut); + duration: Duration(milliseconds: 200), curve: Curves.easeInOut,); setState(() { _selectedIndex--; _files.remove(file); @@ -266,9 +266,9 @@ class _DetailPageState extends State { if (file.uploadedFileID != null && file.ownerID != Configuration.instance.getUserID()) { _logger.severe("Attempt to edit unowned file", UnauthorizedEditError(), - StackTrace.current); + StackTrace.current,); showErrorDialog(context, "Sorry", - "We don't support editing photos and albums that you don't own yet"); + "We don't support editing photos and albums that you don't own yet",); return; } final dialog = createProgressDialog(context, "Please wait..."); diff --git a/lib/ui/device_folder_page.dart b/lib/ui/device_folder_page.dart index 78cfbc29f..0cd476b9b 100644 --- a/lib/ui/device_folder_page.dart +++ b/lib/ui/device_folder_page.dart @@ -25,7 +25,7 @@ class DeviceFolderPage extends StatelessWidget { asyncLoader: (creationStartTime, creationEndTime, {limit, asc}) { return FilesDB.instance.getFilesInPath( folder.path, creationStartTime, creationEndTime, - limit: limit, asc: asc); + limit: limit, asc: asc,); }, reloadEvent: Bus.instance.on(), removalEventTypes: const { @@ -99,7 +99,7 @@ class _BackupConfigurationHeaderWidgetState color: Theme.of(context) .colorScheme .defaultTextColor - .withOpacity(0.7)), + .withOpacity(0.7),), ), Switch( value: isBackedUp, diff --git a/lib/ui/editor/filtered_image.dart b/lib/ui/editor/filtered_image.dart index 867e8fb21..ddb7fda8a 100644 --- a/lib/ui/editor/filtered_image.dart +++ b/lib/ui/editor/filtered_image.dart @@ -21,16 +21,16 @@ class FilteredImage extends StatelessWidget { colorFilter: ColorFilter.matrix(ColorFilterGenerator.brightnessAdjustMatrix( value: brightness ?? 1, - )), + ),), child: ColorFiltered( colorFilter: ColorFilter.matrix(ColorFilterGenerator.saturationAdjustMatrix( value: saturation ?? 1, - )), + ),), child: ColorFiltered( colorFilter: ColorFilter.matrix(ColorFilterGenerator.hueAdjustMatrix( value: hue ?? 0, - )), + ),), child: child, ), ), diff --git a/lib/ui/email_entry_page.dart b/lib/ui/email_entry_page.dart index 0ee480ac0..f411fdfff 100644 --- a/lib/ui/email_entry_page.dart +++ b/lib/ui/email_entry_page.dart @@ -96,7 +96,7 @@ class _EmailEntryPageState extends State { roundedEdges: Radius.circular(10), unselectedColor: Theme.of(context).colorScheme.stepProgressUnselectedColor, - )), + ),), ); return Scaffold( appBar: appBar, @@ -137,7 +137,7 @@ class _EmailEntryPageState extends State { padding: const EdgeInsets.symmetric(vertical: 30, horizontal: 20), child: Text('Create new account', - style: Theme.of(context).textTheme.headline4), + style: Theme.of(context).textTheme.headline4,), ), Padding( padding: const EdgeInsets.fromLTRB(20, 0, 20, 0), @@ -152,7 +152,7 @@ class _EmailEntryPageState extends State { EdgeInsets.symmetric(horizontal: 16, vertical: 14), border: UnderlineInputBorder( borderSide: BorderSide.none, - borderRadius: BorderRadius.circular(6)), + borderRadius: BorderRadius.circular(6),), suffixIcon: _emailIsValid ? Icon( Icons.check, @@ -222,7 +222,7 @@ class _EmailEntryPageState extends State { : null, border: UnderlineInputBorder( borderSide: BorderSide.none, - borderRadius: BorderRadius.circular(6)), + borderRadius: BorderRadius.circular(6),), ), focusNode: _password1FocusNode, onChanged: (password) { @@ -285,7 +285,7 @@ class _EmailEntryPageState extends State { : null, border: UnderlineInputBorder( borderSide: BorderSide.none, - borderRadius: BorderRadius.circular(6)), + borderRadius: BorderRadius.circular(6),), ), focusNode: _password2FocusNode, onChanged: (cnfPassword) { @@ -354,7 +354,7 @@ class _EmailEntryPageState extends State { setState(() { _hasAgreedToTOS = value; }); - }), + },), Expanded( child: RichText( text: TextSpan( @@ -390,7 +390,7 @@ class _EmailEntryPageState extends State { MaterialPageRoute( builder: (BuildContext context) { return WebPage( - "Privacy", "https://ente.io/privacy"); + "Privacy", "https://ente.io/privacy",); }, ), ); @@ -448,7 +448,7 @@ class _EmailEntryPageState extends State { MaterialPageRoute( builder: (BuildContext context) { return WebPage( - "encryption", "https://ente.io/architecture"); + "encryption", "https://ente.io/architecture",); }, ), ); @@ -531,7 +531,7 @@ class PricingWidget extends StatelessWidget { " for " + freePlan.duration.toString() + " " + - freePlan.period), + freePlan.period,), GestureDetector( child: Row( mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/ui/expansion_card.dart b/lib/ui/expansion_card.dart index 01e149343..47690cbc6 100644 --- a/lib/ui/expansion_card.dart +++ b/lib/ui/expansion_card.dart @@ -192,7 +192,7 @@ class _ExpansionTileState extends State child: const Icon(Icons.expand_more), ), ), - )), + ),), ClipRect( child: Align( heightFactor: _heightFactor.value, diff --git a/lib/ui/extents_page_view.dart b/lib/ui/extents_page_view.dart index e97163599..1e83fc907 100644 --- a/lib/ui/extents_page_view.dart +++ b/lib/ui/extents_page_view.dart @@ -368,14 +368,14 @@ class _PageViewState extends State { description .add(EnumProperty('scrollDirection', widget.scrollDirection)); description.add( - FlagProperty('reverse', value: widget.reverse, ifTrue: 'reversed')); + FlagProperty('reverse', value: widget.reverse, ifTrue: 'reversed'),); description.add(DiagnosticsProperty( 'controller', widget.controller, - showName: false)); + showName: false,),); description.add(DiagnosticsProperty( 'physics', widget.physics, - showName: false)); + showName: false,),); description.add(FlagProperty('pageSnapping', - value: widget.pageSnapping, ifFalse: 'snapping disabled')); + value: widget.pageSnapping, ifFalse: 'snapping disabled',),); } } diff --git a/lib/ui/fading_app_bar.dart b/lib/ui/fading_app_bar.dart index a76eb56bc..6ccc00fc1 100644 --- a/lib/ui/fading_app_bar.dart +++ b/lib/ui/fading_app_bar.dart @@ -179,7 +179,7 @@ class FadingAppBarState extends State { _showDeleteSheet(widget.file); } }, - )); + ),); return AppBar( iconTheme: IconThemeData(color: Colors.white), //same for both themes actions: shouldShowActions ? actions : [], @@ -268,7 +268,7 @@ class FadingAppBarState extends State { ); if (dateWithTimeResult != null) { if (await editTime(context, List.of([widget.file]), - dateWithTimeResult.microsecondsSinceEpoch)) { + dateWithTimeResult.microsecondsSinceEpoch,)) { widget.file.creationTime = dateWithTimeResult.microsecondsSinceEpoch; setState(() {}); } @@ -286,7 +286,7 @@ class FadingAppBarState extends State { Navigator.of(context, rootNavigator: true).pop(); widget.onFileDeleted(file); }, - )); + ),); } else { // uploaded file which is present locally too actions.add(CupertinoActionSheetAction( @@ -298,7 +298,7 @@ class FadingAppBarState extends State { Navigator.of(context, rootNavigator: true).pop(); // TODO: Fix behavior when inside a device folder }, - )); + ),); actions.add(CupertinoActionSheetAction( child: Text("ente"), @@ -309,7 +309,7 @@ class FadingAppBarState extends State { Navigator.of(context, rootNavigator: true).pop(); // TODO: Fix behavior when inside a collection }, - )); + ),); actions.add(CupertinoActionSheetAction( child: Text("Everywhere"), @@ -319,7 +319,7 @@ class FadingAppBarState extends State { Navigator.of(context, rootNavigator: true).pop(); widget.onFileDeleted(file); }, - )); + ),); } final action = CupertinoActionSheet( title: Text("Delete file?"), diff --git a/lib/ui/fading_bottom_bar.dart b/lib/ui/fading_bottom_bar.dart index adf45201e..0504d5cbc 100644 --- a/lib/ui/fading_bottom_bar.dart +++ b/lib/ui/fading_bottom_bar.dart @@ -199,7 +199,7 @@ class FadingBottomBarState extends State { selectedFiles, null, actionType: CollectionActionType.restoreFiles, - ))); + ),),); }, ), ), diff --git a/lib/ui/file_info_dialog.dart b/lib/ui/file_info_dialog.dart index 51b6ce1e2..362ab54f6 100644 --- a/lib/ui/file_info_dialog.dart +++ b/lib/ui/file_info_dialog.dart @@ -134,7 +134,7 @@ class _FileInfoWidgetState extends State { Padding(padding: EdgeInsets.all(4)), Text( getFormattedTime( - DateTime.fromMicrosecondsSinceEpoch(file.updationTime)), + DateTime.fromMicrosecondsSinceEpoch(file.updationTime),), style: TextStyle(color: infoColor), ), ], @@ -386,7 +386,7 @@ class _FileInfoWidgetState extends State { Icon(Icons.center_focus_strong_outlined, color: infoColor), Padding(padding: EdgeInsets.all(4)), Text(focalLength.toString() + " mm", - style: TextStyle(color: infoColor)), + style: TextStyle(color: infoColor),), ], ), Padding(padding: EdgeInsets.all(6)), diff --git a/lib/ui/free_space_page.dart b/lib/ui/free_space_page.dart index 254ca433b..ad7683e4a 100644 --- a/lib/ui/free_space_page.dart +++ b/lib/ui/free_space_page.dart @@ -31,7 +31,7 @@ class _FreeSpacePageState extends State { Widget _getBody() { Logger("FreeSpacePage").info("Number of uploaded files: " + - widget.status.localIDs.length.toString()); + widget.status.localIDs.length.toString(),); Logger("FreeSpacePage") .info("Space consumed: " + widget.status.size.toString()); return _getWidget(widget.status); diff --git a/lib/ui/gallery.dart b/lib/ui/gallery.dart index 9573eae6b..e6020d202 100644 --- a/lib/ui/gallery.dart +++ b/lib/ui/gallery.dart @@ -83,7 +83,7 @@ class _GalleryState extends State { _logger.info("Force reload triggered"); final result = await _loadFiles(); _setFilesAndReload(result.files); - })); + }),); } } if (widget.initialFiles != null) { @@ -112,14 +112,14 @@ class _GalleryState extends State { final startTime = DateTime.now().microsecondsSinceEpoch; final result = await widget.asyncLoader( kGalleryLoadStartTime, DateTime.now().microsecondsSinceEpoch, - limit: limit); + limit: limit,); final endTime = DateTime.now().microsecondsSinceEpoch; final duration = Duration(microseconds: endTime - startTime); _logger.info("Time taken to load " + result.files.length.toString() + " files :" + duration.inMilliseconds.toString() + - "ms"); + "ms",); return result; } catch (e, s) { _logger.severe("failed to load files", e, s); @@ -180,8 +180,8 @@ class _GalleryState extends State { } children.add(Expanded( child: nothingToSeeHere( - textColor: Theme.of(context).colorScheme.defaultTextColor), - )); + textColor: Theme.of(context).colorScheme.defaultTextColor,), + ),); if (widget.footer != null) { children.add(widget.footer); } @@ -216,7 +216,7 @@ class _GalleryState extends State { }, labelTextBuilder: (int index) { return getMonthAndYear(DateTime.fromMicrosecondsSinceEpoch( - _collatedFiles[index][0].creationTime)); + _collatedFiles[index][0].creationTime,),); }, thumbBackgroundColor: Theme.of(context).colorScheme.galleryThumbBackgroundColor, @@ -234,7 +234,7 @@ class _GalleryState extends State { for (int index = 0; index < files.length; index++) { if (index > 0 && !_areFromSameDay( - files[index - 1].creationTime, files[index].creationTime)) { + files[index - 1].creationTime, files[index].creationTime,)) { final List collatedDailyFiles = []; collatedDailyFiles.addAll(dailyFiles); collatedFiles.add(collatedDailyFiles); diff --git a/lib/ui/gallery_app_bar_widget.dart b/lib/ui/gallery_app_bar_widget.dart index af0345e0f..3eb705fcc 100644 --- a/lib/ui/gallery_app_bar_widget.dart +++ b/lib/ui/gallery_app_bar_widget.dart @@ -181,10 +181,10 @@ class _GalleryAppBarWidgetState extends State { widget.collection, widget.collection.isArchived() ? kVisibilityVisible - : kVisibilityArchive); + : kVisibilityArchive,); } }, - )); + ),); } return actions; } @@ -200,7 +200,7 @@ class _GalleryAppBarWidgetState extends State { await CollectionsService.instance.getOrCreateForPath(widget.path); } else { throw Exception( - "Cannot create a collection of type" + widget.type.toString()); + "Cannot create a collection of type" + widget.type.toString(),); } } else { final sharees = diff --git a/lib/ui/gallery_overlay_widget.dart b/lib/ui/gallery_overlay_widget.dart index d37f1cab2..983db2294 100644 --- a/lib/ui/gallery_overlay_widget.dart +++ b/lib/ui/gallery_overlay_widget.dart @@ -28,7 +28,7 @@ class GalleryOverlayWidget extends StatefulWidget { final String path; final Collection collection; const GalleryOverlayWidget(this.type, this.selectedFiles, - {this.path, this.collection, Key key}) + {this.path, this.collection, Key key,}) : super(key: key); @override @@ -222,7 +222,7 @@ class _OverlayWidgetState extends State { child: CreateCollectionPage( widget.selectedFiles, null, - ))); + ),),); } Future _moveFiles() async { @@ -234,7 +234,7 @@ class _OverlayWidgetState extends State { widget.selectedFiles, null, actionType: CollectionActionType.moveFiles, - ))); + ),),); } List _getActions(BuildContext context) { @@ -278,7 +278,7 @@ class _OverlayWidgetState extends State { color: Theme.of(context).colorScheme.iconColor, icon: Icon(Platform.isAndroid ? Icons.arrow_forward - : CupertinoIcons.arrow_right), + : CupertinoIcons.arrow_right,), onPressed: () { _moveFiles(); }, @@ -361,10 +361,10 @@ class _OverlayWidgetState extends State { ), onPressed: () { _handleVisibilityChangeRequest( - context, showArchive ? kVisibilityArchive : kVisibilityVisible); + context, showArchive ? kVisibilityArchive : kVisibilityVisible,); }, ), - )); + ),); } return actions; } @@ -386,10 +386,10 @@ class _OverlayWidgetState extends State { widget.selectedFiles, null, actionType: CollectionActionType.restoreFiles, - ))); + ),),); }, ), - )); + ),); actions.add( Tooltip( message: "Delete permanently", @@ -400,7 +400,7 @@ class _OverlayWidgetState extends State { ), onPressed: () async { if (await deleteFromTrash( - context, widget.selectedFiles.files.toList())) { + context, widget.selectedFiles.files.toList(),)) { _clearSelectedFiles(); } }, @@ -410,10 +410,10 @@ class _OverlayWidgetState extends State { } Future _handleVisibilityChangeRequest( - BuildContext context, int newVisibility) async { + BuildContext context, int newVisibility,) async { try { await changeVisibility( - context, widget.selectedFiles.files.toList(), newVisibility); + context, widget.selectedFiles.files.toList(), newVisibility,); } catch (e, s) { _logger.severe("failed to update file visibility", e, s); await showGenericErrorDialog(context); @@ -424,7 +424,7 @@ class _OverlayWidgetState extends State { void _shareSelected(BuildContext context) { share(context, widget.selectedFiles.files.toList(), - shareButtonKey: shareButtonKey); + shareButtonKey: shareButtonKey,); } void _showDeleteSheet(BuildContext context) { @@ -446,32 +446,32 @@ class _OverlayWidgetState extends State { onPressed: () async { Navigator.of(context, rootNavigator: true).pop(); await deleteFilesOnDeviceOnly( - context, widget.selectedFiles.files.toList()); + context, widget.selectedFiles.files.toList(),); _clearSelectedFiles(); showToast(context, "Files deleted from device"); }, - )); + ),); actions.add(CupertinoActionSheetAction( child: Text("ente"), isDestructiveAction: true, onPressed: () async { Navigator.of(context, rootNavigator: true).pop(); await deleteFilesFromRemoteOnly( - context, widget.selectedFiles.files.toList()); + context, widget.selectedFiles.files.toList(),); _clearSelectedFiles(); showShortToast(context, "Moved to trash"); }, - )); + ),); actions.add(CupertinoActionSheetAction( child: Text("Everywhere"), isDestructiveAction: true, onPressed: () async { Navigator.of(context, rootNavigator: true).pop(); await deleteFilesFromEverywhere( - context, widget.selectedFiles.files.toList()); + context, widget.selectedFiles.files.toList(),); _clearSelectedFiles(); }, - )); + ),); } else { actions.add(CupertinoActionSheetAction( child: Text("Delete"), @@ -479,17 +479,17 @@ class _OverlayWidgetState extends State { onPressed: () async { Navigator.of(context, rootNavigator: true).pop(); await deleteFilesFromEverywhere( - context, widget.selectedFiles.files.toList()); + context, widget.selectedFiles.files.toList(),); _clearSelectedFiles(); }, - )); + ),); } final action = CupertinoActionSheet( title: Text("Delete " + count.toString() + " file" + (count == 1 ? "" : "s") + - (containsUploadedFile && containsLocalFile ? " from" : "?")), + (containsUploadedFile && containsLocalFile ? " from" : "?"),), actions: actions, cancelButton: CupertinoActionSheetAction( child: Text("Cancel"), @@ -514,7 +514,7 @@ class _OverlayWidgetState extends State { (count == 1 ? "" : "s") + " from " + widget.collection.name + - "?"), + "?",), actions: [ CupertinoActionSheetAction( child: Text("Remove"), @@ -525,7 +525,7 @@ class _OverlayWidgetState extends State { await dialog.show(); try { await CollectionsService.instance.removeFromCollection( - widget.collection.id, widget.selectedFiles.files.toList()); + widget.collection.id, widget.selectedFiles.files.toList(),); await dialog.hide(); widget.selectedFiles.clearAll(); } catch (e, s) { diff --git a/lib/ui/grant_permissions_widget.dart b/lib/ui/grant_permissions_widget.dart index 17768b53e..2ec14bb44 100644 --- a/lib/ui/grant_permissions_widget.dart +++ b/lib/ui/grant_permissions_widget.dart @@ -59,16 +59,16 @@ class GrantPermissionsWidget extends StatelessWidget { style: Theme.of(context) .textTheme .headline5 - .copyWith(fontWeight: FontWeight.w400)), + .copyWith(fontWeight: FontWeight.w400),), TextSpan(text: 'preserve your photos') - ])), + ],),), ), ], ), Container( width: double.infinity, padding: EdgeInsets.only( - left: 20, right: 20, bottom: Platform.isIOS ? 84 : 60), + left: 20, right: 20, bottom: Platform.isIOS ? 84 : 60,), child: OutlinedButton( child: Text("Grant permission"), onPressed: () async { @@ -80,7 +80,7 @@ class GrantPermissionsWidget extends StatelessWidget { AlertDialog alert = AlertDialog( title: Text("Please grant permissions"), content: Text( - "ente can encrypt and preserve files only if you grant access to them"), + "ente can encrypt and preserve files only if you grant access to them",), actions: [ TextButton( child: Text( @@ -90,7 +90,7 @@ class GrantPermissionsWidget extends StatelessWidget { .subtitle1 .copyWith( fontSize: 14, - fontWeight: FontWeight.w700), + fontWeight: FontWeight.w700,), ), onPressed: () { Navigator.of(context, rootNavigator: true) diff --git a/lib/ui/home_widget.dart b/lib/ui/home_widget.dart index c9a969a98..c32c31b5c 100644 --- a/lib/ui/home_widget.dart +++ b/lib/ui/home_widget.dart @@ -183,7 +183,7 @@ class _HomeWidgetState extends State { context: context, builder: (BuildContext context) { return AppUpdateDialog( - UpdateService.instance.getLatestVersionInfo()); + UpdateService.instance.getLatestVersionInfo(),); }, barrierColor: Colors.black.withOpacity(0.85), ); @@ -216,7 +216,7 @@ class _HomeWidgetState extends State { }); }, onError: (err) { _logger.severe("getIntentDataStream error: $err"); - }); + },); // For sharing images coming from outside the app while the app is closed ReceiveSharingIntent.getInitialMedia().then((List value) { setState(() { @@ -286,7 +286,7 @@ class _HomeWidgetState extends State { Bus.instance.fire(TabChangedEvent( page, TabChangedEventSource.page_view, - )); + ),); }, physics: NeverScrollableScrollPhysics(), controller: _pageController, @@ -335,7 +335,7 @@ class _HomeWidgetState extends State { _getCredentials(context, link); }, onError: (err) { _logger.severe(err); - }); + },); return false; } @@ -366,27 +366,27 @@ class _HomeWidgetState extends State { creationEndTime, ownerID, importantPaths.toList(), limit: limit, asc: asc, - ignoredCollectionIDs: archivedCollectionIds); + ignoredCollectionIDs: archivedCollectionIds,); } else { if (LocalSyncService.instance.hasGrantedLimitedPermissions()) { result = await FilesDB.instance.getAllLocalAndUploadedFiles( creationStartTime, creationEndTime, ownerID, limit: limit, asc: asc, - ignoredCollectionIDs: archivedCollectionIds); + ignoredCollectionIDs: archivedCollectionIds,); } else { result = await FilesDB.instance.getAllUploadedFiles( creationStartTime, creationEndTime, ownerID, limit: limit, asc: asc, - ignoredCollectionIDs: archivedCollectionIds); + ignoredCollectionIDs: archivedCollectionIds,); } } // hide ignored files from home page UI final ignoredIDs = await IgnoredFilesService.instance.ignoredIDs; result.files.removeWhere((f) => f.uploadedFileID == null && - IgnoredFilesService.instance.shouldSkipUpload(ignoredIDs, f)); + IgnoredFilesService.instance.shouldSkipUpload(ignoredIDs, f),); return result; }, reloadEvent: Bus.instance.on(), @@ -430,7 +430,7 @@ class _HomeWidgetState extends State { style: Theme.of(context) .textTheme .caption - .copyWith(fontFamily: 'Inter-Medium', fontSize: 16)), + .copyWith(fontFamily: 'Inter-Medium', fontSize: 16),), Center( child: Hero( tag: "select_folders", @@ -563,7 +563,7 @@ class _HomeBottomNavigationBarState extends State { Bus.instance.fire(TabChangedEvent( index, TabChangedEventSource.tab_bar, - )); + ),); } @override @@ -626,7 +626,7 @@ class _HomeBottomNavigationBarState extends State { text: '', onPressed: () { _onTabChange( - 0); // To take care of occasional missing events + 0,); // To take care of occasional missing events }, ), GButton( @@ -641,7 +641,7 @@ class _HomeBottomNavigationBarState extends State { text: '', onPressed: () { _onTabChange( - 1); // To take care of occasional missing events + 1,); // To take care of occasional missing events }, ), GButton( @@ -656,7 +656,7 @@ class _HomeBottomNavigationBarState extends State { text: '', onPressed: () { _onTabChange( - 2); // To take care of occasional missing events + 2,); // To take care of occasional missing events }, ), GButton( @@ -671,7 +671,7 @@ class _HomeBottomNavigationBarState extends State { text: '', onPressed: () { _onTabChange( - 3); // To take care of occasional missing events + 3,); // To take care of occasional missing events }, ) ], @@ -684,7 +684,7 @@ class _HomeBottomNavigationBarState extends State { ), ], ), - ]), + ],), ), ), ); diff --git a/lib/ui/huge_listview/draggable_scrollbar.dart b/lib/ui/huge_listview/draggable_scrollbar.dart index ead959daf..1fc449e30 100644 --- a/lib/ui/huge_listview/draggable_scrollbar.dart +++ b/lib/ui/huge_listview/draggable_scrollbar.dart @@ -64,7 +64,7 @@ class DraggableScrollbarState extends State WidgetsBinding.instance?.addPostFrameCallback((_) { setState(() => thumbOffset = (widget.initialScrollIndex / widget.totalCount) * - (thumbMax - thumbMin)); + (thumbMax - thumbMin),); }); } @@ -194,22 +194,22 @@ class DraggableScrollbarState extends State onDragUpdate(DragUpdateDetails( globalPosition: Offset.zero, delta: Offset(0, 2), - )); + ),); } else if (value.logicalKey == LogicalKeyboardKey.arrowUp) { onDragUpdate(DragUpdateDetails( globalPosition: Offset.zero, delta: Offset(0, -2), - )); + ),); } else if (value.logicalKey == LogicalKeyboardKey.pageDown) { onDragUpdate(DragUpdateDetails( globalPosition: Offset.zero, delta: Offset(0, 25), - )); + ),); } else if (value.logicalKey == LogicalKeyboardKey.pageUp) { onDragUpdate(DragUpdateDetails( globalPosition: Offset.zero, delta: Offset(0, -25), - )); + ),); } } } diff --git a/lib/ui/huge_listview/huge_listview.dart b/lib/ui/huge_listview/huge_listview.dart index 46359ff92..ee4fd28f0 100644 --- a/lib/ui/huge_listview/huge_listview.dart +++ b/lib/ui/huge_listview/huge_listview.dart @@ -5,9 +5,9 @@ import 'package:photos/ui/huge_listview/draggable_scrollbar.dart'; import 'package:scrollable_positioned_list/scrollable_positioned_list.dart'; typedef HugeListViewItemBuilder = Widget Function( - BuildContext context, int index); + BuildContext context, int index,); typedef HugeListViewErrorBuilder = Widget Function( - BuildContext context, dynamic error); + BuildContext context, dynamic error,); class HugeListView extends StatefulWidget { /// A [ScrollablePositionedList] controller for jumping or scrolling to an item. diff --git a/lib/ui/huge_listview/lazy_loading_gallery.dart b/lib/ui/huge_listview/lazy_loading_gallery.dart index 629e9e35d..3146212a9 100644 --- a/lib/ui/huge_listview/lazy_loading_gallery.dart +++ b/lib/ui/huge_listview/lazy_loading_gallery.dart @@ -102,7 +102,7 @@ class _LazyLoadingGalleryState extends State { DateTime(galleryDate.year, galleryDate.month, galleryDate.day); final result = await widget.asyncLoader( dayStartTime.microsecondsSinceEpoch, - dayStartTime.microsecondsSinceEpoch + kMicroSecondsInDay - 1); + dayStartTime.microsecondsSinceEpoch + kMicroSecondsInDay - 1,); if (mounted) { setState(() { _files = result.files; @@ -152,7 +152,7 @@ class _LazyLoadingGalleryState extends State { child: Column( children: [ getDayWidget( - context, _files[0].creationTime, widget.smallerTodayFont), + context, _files[0].creationTime, widget.smallerTodayFont,), _shouldRender ? _getGallery() : PlaceHolderWidget(_files.length), ], ), @@ -169,7 +169,7 @@ class _LazyLoadingGalleryState extends State { widget.selectedFiles, index == 0, _files.length > kRecycleLimit, - )); + ),); } return Column( @@ -315,8 +315,8 @@ class _LazyLoadingGridViewState extends State { child: ColorFiltered( colorFilter: ColorFilter.mode( Colors.black.withOpacity( - widget.selectedFiles.files.contains(file) ? 0.4 : 0), - BlendMode.darken), + widget.selectedFiles.files.contains(file) ? 0.4 : 0,), + BlendMode.darken,), child: ThumbnailWidget( file, diskLoadDeferDuration: kThumbnailDiskLoadDeferDuration, @@ -355,7 +355,7 @@ class _LazyLoadingGridViewState extends State { widget.asyncLoader, widget.files.indexOf(file), widget.tag, - )); + ),); routeToPage(context, page); } } diff --git a/lib/ui/huge_listview/scroll_bar_thumb.dart b/lib/ui/huge_listview/scroll_bar_thumb.dart index 345bae80f..a10ee504a 100644 --- a/lib/ui/huge_listview/scroll_bar_thumb.dart +++ b/lib/ui/huge_listview/scroll_bar_thumb.dart @@ -63,7 +63,7 @@ class ScrollBarThumb extends StatelessWidget { elevation: 4.0, child: Container( constraints: - BoxConstraints.tight(Size(height * 0.6, height))), + BoxConstraints.tight(Size(height * 0.6, height)),), color: backgroundColor, borderRadius: BorderRadius.only( topLeft: Radius.circular(height), @@ -101,19 +101,19 @@ class _ArrowCustomPainter extends CustomPainter { canvas.drawPath( trianglePath(Offset(baseX - 2.0, baseY - 2.0), width, height, true), - paint); + paint,); canvas.drawPath( trianglePath(Offset(baseX - 2.0, baseY + 2.0), width, height, false), - paint); + paint,); } static Path trianglePath( - Offset offset, double width, double height, bool isUp) { + Offset offset, double width, double height, bool isUp,) { return Path() ..moveTo(offset.dx, offset.dy) ..lineTo(offset.dx + width, offset.dy) ..lineTo(offset.dx + (width / 2), - isUp ? offset.dy - height : offset.dy + height) + isUp ? offset.dy - height : offset.dy + height,) ..close(); } } diff --git a/lib/ui/image_editor_page.dart b/lib/ui/image_editor_page.dart index fcc1ae2f0..30af1f37a 100644 --- a/lib/ui/image_editor_page.dart +++ b/lib/ui/image_editor_page.dart @@ -308,7 +308,7 @@ class _ImageEditorPageState extends State { option.addOption(ClipOption.fromRect(rect)); option.addOption( - FlipOption(horizontal: flipHorizontal, vertical: flipVertical)); + FlipOption(horizontal: flipHorizontal, vertical: flipVertical),); if (action.hasRotateAngle) { option.addOption(RotateOption(radian.toInt())); } @@ -364,7 +364,7 @@ class _ImageEditorPageState extends State { final existingFiles = widget.detailPageConfig.files; final files = (await widget.detailPageConfig.asyncLoader( existingFiles[existingFiles.length - 1].creationTime, - existingFiles[0].creationTime)) + existingFiles[0].creationTime,)) .files; replacePage( context, diff --git a/lib/ui/landing_page_widget.dart b/lib/ui/landing_page_widget.dart index adb746601..b5323a8f9 100644 --- a/lib/ui/landing_page_widget.dart +++ b/lib/ui/landing_page_widget.dart @@ -55,9 +55,9 @@ class _LandingPageWidgetState extends State { Theme.of(context).colorScheme.dotsIndicatorActiveColor, color: Theme.of(context).colorScheme.dotsIndicatorInactiveColor, activeShape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(3)), + borderRadius: BorderRadius.circular(3),), shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(3)), + borderRadius: BorderRadius.circular(3),), size: Size(100, 5), activeSize: Size(100, 5), spacing: EdgeInsets.all(3), diff --git a/lib/ui/loading_photos_widget.dart b/lib/ui/loading_photos_widget.dart index 9217340a0..be3d8cf9d 100644 --- a/lib/ui/loading_photos_widget.dart +++ b/lib/ui/loading_photos_widget.dart @@ -49,7 +49,7 @@ class _LoadingPhotosWidgetState extends State { BackupFolderSelectionPage( shouldSelectAll: true, buttonText: "Start backup", - )); + ),); } } }); @@ -150,7 +150,7 @@ class _LoadingPhotosWidgetState extends State { right: 0, child: BottomShadowWidget(), ) - ]), + ],), ), ], ), diff --git a/lib/ui/location_search_widget.dart b/lib/ui/location_search_widget.dart index aca3a616d..1ba766252 100644 --- a/lib/ui/location_search_widget.dart +++ b/lib/ui/location_search_widget.dart @@ -48,7 +48,7 @@ class _LocationSearchWidgetState extends State { "query": pattern, }, options: Options( - headers: {"X-Auth-Token": Configuration.instance.getToken()}), + headers: {"X-Auth-Token": Configuration.instance.getToken()},), ) .then((response) { if (_searchString == pattern) { @@ -70,14 +70,14 @@ class _LocationSearchWidgetState extends State { suggestion['geometry']['viewport']['northeast'] ['lat'], suggestion['geometry']['viewport']['northeast'] - ['lng']), + ['lng'],), Location( suggestion['geometry']['viewport']['southwest'] ['lat'], suggestion['geometry']['viewport']['southwest'] - ['lng'])), + ['lng'],),), suggestion['name'], - ))); + ),),); }, ); } @@ -113,7 +113,7 @@ class LocationSearchResultWidget extends StatelessWidget { ), ], ), - ]), + ],), ); } } diff --git a/lib/ui/lock_screen.dart b/lib/ui/lock_screen.dart index b872618bc..7d0bf9122 100644 --- a/lib/ui/lock_screen.dart +++ b/lib/ui/lock_screen.dart @@ -35,7 +35,7 @@ class _LockScreenState extends State { Image.asset(MediaQuery.of(context).platformBrightness == Brightness.light ? 'assets/loading_photos_light.png' - : 'assets/loading_photos_dark.png'), + : 'assets/loading_photos_dark.png',), SizedBox( width: 172, child: GradientButton( @@ -54,7 +54,7 @@ class _LockScreenState extends State { ), ], ), - ]), + ],), ), ); } @@ -63,7 +63,7 @@ class _LockScreenState extends State { _logger.info("Showing lockscreen"); try { final result = await requestAuthentication( - "Please authenticate to view your memories"); + "Please authenticate to view your memories",); if (result) { AppLock.of(context).didUnlock(); } diff --git a/lib/ui/login_page.dart b/lib/ui/login_page.dart index 8557b5e7e..e5cf71275 100644 --- a/lib/ui/login_page.dart +++ b/lib/ui/login_page.dart @@ -76,7 +76,7 @@ class _LoginPageState extends State { padding: const EdgeInsets.symmetric(vertical: 30, horizontal: 20), child: Text('Welcome back!', - style: Theme.of(context).textTheme.headline4), + style: Theme.of(context).textTheme.headline4,), ), Padding( padding: const EdgeInsets.fromLTRB(20, 24, 20, 0), @@ -90,7 +90,7 @@ class _LoginPageState extends State { EdgeInsets.symmetric(horizontal: 15, vertical: 15), border: UnderlineInputBorder( borderSide: BorderSide.none, - borderRadius: BorderRadius.circular(6)), + borderRadius: BorderRadius.circular(6),), suffixIcon: _emailIsValid ? Icon( Icons.check, @@ -141,7 +141,7 @@ class _LoginPageState extends State { .copyWith(fontSize: 12), children: [ TextSpan( - text: "By clicking log in, I agree to the "), + text: "By clicking log in, I agree to the ",), TextSpan( text: "terms of service", style: TextStyle( @@ -153,7 +153,7 @@ class _LoginPageState extends State { MaterialPageRoute( builder: (BuildContext context) { return WebPage( - "terms", "https://ente.io/terms"); + "terms", "https://ente.io/terms",); }, ), ); @@ -171,7 +171,7 @@ class _LoginPageState extends State { MaterialPageRoute( builder: (BuildContext context) { return WebPage("privacy", - "https://ente.io/privacy"); + "https://ente.io/privacy",); }, ), ); diff --git a/lib/ui/manage_links_widget.dart b/lib/ui/manage_links_widget.dart index bda42e26c..73e8b229f 100644 --- a/lib/ui/manage_links_widget.dart +++ b/lib/ui/manage_links_widget.dart @@ -137,12 +137,12 @@ class _ManageSharedLinkWidgetState extends State { inputResult == 'ok' && _textFieldController.text.trim().isNotEmpty) { var propToUpdate = await _getEncryptedPassword( - _textFieldController.text); + _textFieldController.text,); await _updateUrlSettings(context, propToUpdate); } } else { await _updateUrlSettings( - context, {'disablePassword': true}); + context, {'disablePassword': true},); } setState(() {}); }, @@ -175,16 +175,16 @@ class _ManageSharedLinkWidgetState extends State { Theme.of(context).colorScheme.greenText, secondActionColor: Theme.of(context) .colorScheme - .inverseBackgroundColor); + .inverseBackgroundColor,); if (choice != DialogUserChoice.secondChoice) { return; } } await _updateUrlSettings( - context, {'enableDownload': value}); + context, {'enableDownload': value},); if (!value) { showErrorDialog(context, "Please note", - "Viewers can still take screenshots or save a copy of your photos using external tools"); + "Viewers can still take screenshots or save a copy of your photos using external tools",); } setState(() {}); }, @@ -262,7 +262,7 @@ class _ManageSharedLinkWidgetState extends State { } if (newValidTill >= 0) { await _updateUrlSettings( - context, {'validTill': newValidTill}); + context, {'validTill': newValidTill},); setState(() {}); } Navigator.of(context).pop(''); @@ -370,7 +370,7 @@ class _ManageSharedLinkWidgetState extends State { actions: [ TextButton( child: Text('Cancel', - style: Theme.of(context).textTheme.subtitle2), + style: Theme.of(context).textTheme.subtitle2,), onPressed: () { Navigator.pop(context, 'cancel'); }, @@ -387,18 +387,18 @@ class _ManageSharedLinkWidgetState extends State { ), ], ); - }); - }); + },); + },); } Future> _getEncryptedPassword(String pass) async { assert(Sodium.cryptoPwhashAlgArgon2id13 == Sodium.cryptoPwhashAlgDefault, - "mismatch in expected default pw hashing algo"); + "mismatch in expected default pw hashing algo",); int memLimit = Sodium.cryptoPwhashMemlimitInteractive; int opsLimit = Sodium.cryptoPwhashOpslimitInteractive; final kekSalt = CryptoUtil.getSaltToDeriveKey(); final result = await CryptoUtil.deriveKey( - utf8.encode(pass), kekSalt, memLimit, opsLimit); + utf8.encode(pass), kekSalt, memLimit, opsLimit,); return { 'passHash': Sodium.bin2base64(result), 'nonce': Sodium.bin2base64(kekSalt), @@ -408,7 +408,7 @@ class _ManageSharedLinkWidgetState extends State { } Future _updateUrlSettings( - BuildContext context, Map prop) async { + BuildContext context, Map prop,) async { final dialog = createProgressDialog(context, "Please wait..."); await dialog.show(); try { @@ -451,7 +451,7 @@ class _ManageSharedLinkWidgetState extends State { List options = []; for (int i = 50; i > 0; i--) { options.add( - Text(i.toString(), style: Theme.of(context).textTheme.subtitle1)); + Text(i.toString(), style: Theme.of(context).textTheme.subtitle1),); } return showCupertinoModalPopup( context: context, @@ -493,7 +493,7 @@ class _ManageSharedLinkWidgetState extends State { onPressed: () async { await _updateUrlSettings(context, { 'deviceLimit': int.tryParse( - options[_selectedDeviceLimitIndex].data), + options[_selectedDeviceLimitIndex].data,), }); setState(() {}); Navigator.of(context).pop(''); diff --git a/lib/ui/memories_widget.dart b/lib/ui/memories_widget.dart index 61292e901..0adafd94c 100644 --- a/lib/ui/memories_widget.dart +++ b/lib/ui/memories_widget.dart @@ -95,7 +95,7 @@ class _MemoryWidgetState extends State { return GestureDetector( onTap: () async { await routeToPage( - context, FullScreenMemory(title, widget.memories, index)); + context, FullScreenMemory(title, widget.memories, index),); setState(() {}); }, child: SizedBox( @@ -261,9 +261,9 @@ class _FullScreenMemoryState extends State { ), Text( getFormattedDate( - DateTime.fromMicrosecondsSinceEpoch(file.creationTime)), + DateTime.fromMicrosecondsSinceEpoch(file.creationTime),), style: Theme.of(context).textTheme.subtitle1.copyWith( - fontSize: 14, color: Colors.white), //same for both themes + fontSize: 14, color: Colors.white,), //same for both themes ), ], ), @@ -280,7 +280,7 @@ class _FullScreenMemoryState extends State { Colors.transparent, ], stops: const [0, 0.6, 1], - )), + ),), ), backgroundColor: Color(0x00000000), elevation: 0, @@ -293,7 +293,7 @@ class _FullScreenMemoryState extends State { bottomGradient(), _buildTitleText(), _buildBottomIcons(), - ]), + ],), ), ); } @@ -311,7 +311,7 @@ class _FullScreenMemoryState extends State { style: Theme.of(context) .textTheme .headline4 - .copyWith(color: Colors.white)), + .copyWith(color: Colors.white),), ), ), ); @@ -330,7 +330,7 @@ class _FullScreenMemoryState extends State { onPressed: () { share(context, [file]); }, - )); + ),); } Widget bottomGradient() { @@ -346,7 +346,7 @@ class _FullScreenMemoryState extends State { Colors.transparent, ], stops: const [0, 0.8], - )), + ),), ); } diff --git a/lib/ui/nav_bar.dart b/lib/ui/nav_bar.dart index 951c1b997..a757a83aa 100644 --- a/lib/ui/nav_bar.dart +++ b/lib/ui/nav_bar.dart @@ -90,7 +90,7 @@ class _GNavState extends State { borderRadius: t.borderRadius ?? widget.tabBorderRadius != null ? BorderRadius.all( - Radius.circular(widget.tabBorderRadius)) + Radius.circular(widget.tabBorderRadius),) : const BorderRadius.all(Radius.circular(100.0)), debug: widget.debug ?? false, margin: t.margin ?? widget.tabMargin, @@ -134,8 +134,8 @@ class _GNavState extends State { }); }); }, - )) - .toList())); + ),) + .toList(),),); } } @@ -260,7 +260,7 @@ class Button extends StatefulWidget { this.borderRadius = const BorderRadius.all(Radius.circular(100.0)), this.border, this.activeBorder, - this.shadow}) + this.shadow,}) : super(key: key); final IconData icon; @@ -317,7 +317,7 @@ class _ButtonState extends State