Apply dart fix
for require_trailing_commas
This commit is contained in:
parent
495a8297b3
commit
3e306facf5
138 changed files with 746 additions and 746 deletions
16
lib/app.dart
16
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(
|
||||
|
|
8
lib/core/cache/thumbnail_cache.dart
vendored
8
lib/core/cache/thumbnail_cache.dart
vendored
|
@ -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(),);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<void> 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<KeyAttributes> 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,);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ class TunneledTransport implements Transport {
|
|||
}
|
||||
|
||||
Future<StreamedRequest> _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,
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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<User>.from((json.decode(row[columnSharees]) as List)
|
||||
.map((x) => User.fromMap(x))),
|
||||
.map((x) => User.fromMap(x)),),
|
||||
row[columnPublicURLs] == null
|
||||
? []
|
||||
: List<PublicURL>.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,
|
||||
|
|
|
@ -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<int> deleteByLocalIDs(List<String> localIDs) async {
|
||||
|
|
|
@ -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<int> insert(File file) async {
|
||||
|
@ -340,7 +340,7 @@ class FilesDB {
|
|||
Future<File> 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<int> ignoredCollectionIDs}) async {
|
||||
Set<int> 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<FileLoadResult> getAllLocalAndUploadedFiles(
|
||||
int startTime, int endTime, int ownerID,
|
||||
{int limit, bool asc, Set<int> ignoredCollectionIDs}) async {
|
||||
{int limit, bool asc, Set<int> 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<FileLoadResult> getImportantFiles(
|
||||
int startTime, int endTime, int ownerID, List<String> paths,
|
||||
{int limit, bool asc, Set<int> ignoredCollectionIDs}) async {
|
||||
{int limit, bool asc, Set<int> ignoredCollectionIDs,}) async {
|
||||
final db = await instance.database;
|
||||
String inParam = "";
|
||||
for (final path in paths) {
|
||||
|
@ -469,7 +469,7 @@ class FilesDB {
|
|||
}
|
||||
|
||||
List<File> _deduplicatedAndFilterIgnoredFiles(
|
||||
List<File> files, Set<int> ignoredCollectionIDs) {
|
||||
List<File> files, Set<int> ignoredCollectionIDs,) {
|
||||
final uploadedFileIDs = <int>{};
|
||||
final List<File> deduplicatedFiles = [];
|
||||
for (final file in files) {
|
||||
|
@ -489,7 +489,7 @@ class FilesDB {
|
|||
|
||||
Future<FileLoadResult> 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<FileLoadResult> 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<List<File>> getFilesCreatedWithinDurations(
|
||||
List<List<int>> durations) async {
|
||||
List<List<int>> durations,) async {
|
||||
final db = await instance.database;
|
||||
String whereClause = "";
|
||||
for (int index = 0; index < durations.length; index++) {
|
||||
|
@ -569,7 +569,7 @@ class FilesDB {
|
|||
}
|
||||
|
||||
Future<List<File>> getFilesToBeUploadedWithinFolders(
|
||||
Set<String> folders) async {
|
||||
Set<String> 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<List<File>> getLocalFiles(List<String> localIDs) async {
|
||||
|
@ -846,7 +846,7 @@ class FilesDB {
|
|||
}
|
||||
|
||||
Future<int> deleteFilesFromCollection(
|
||||
int collectionID, List<int> uploadedFileIDs) async {
|
||||
int collectionID, List<int> uploadedFileIDs,) async {
|
||||
final db = await instance.database;
|
||||
return db.delete(
|
||||
table,
|
||||
|
@ -859,14 +859,14 @@ class FilesDB {
|
|||
Future<int> 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<int> 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 = <String, File>{};
|
||||
|
@ -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 = <int, File>{};
|
||||
|
@ -970,7 +970,7 @@ class FilesDB {
|
|||
FROM $table
|
||||
WHERE $columnLocalID IS NOT NULL
|
||||
GROUP BY $columnDeviceFolder
|
||||
''');
|
||||
''',);
|
||||
final result = <String, int>{};
|
||||
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<bool> doesFileExistInCollection(
|
||||
int uploadedFileID, int collectionID) async {
|
||||
int uploadedFileID, int collectionID,) async {
|
||||
final db = await instance.database;
|
||||
final rows = await db.query(
|
||||
table,
|
||||
|
|
|
@ -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<List<IgnoredFile>> getAll() async {
|
||||
|
@ -103,7 +103,7 @@ class IgnoredFilesDB {
|
|||
|
||||
IgnoredFile _getIgnoredFileFromRow(Map<String, dynamic> row) {
|
||||
return IgnoredFile(row[columnLocalID], row[columnTitle],
|
||||
row[columnDeviceFolder], row[columnReason]);
|
||||
row[columnDeviceFolder], row[columnReason],);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _getRowForIgnoredFile(IgnoredFile ignoredFile) {
|
||||
|
|
|
@ -40,7 +40,7 @@ class MemoriesDB {
|
|||
$columnFileID INTEGER PRIMARY KEY NOT NULL,
|
||||
$columnSeenTime TEXT NOT NULL
|
||||
)
|
||||
''');
|
||||
''',);
|
||||
}
|
||||
|
||||
Future<void> clearTable() async {
|
||||
|
@ -60,7 +60,7 @@ class MemoriesDB {
|
|||
Future<int> 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<Map<int, int>> getSeenTimes() async {
|
||||
|
|
|
@ -41,7 +41,7 @@ class PublicKeysDB {
|
|||
$columnEmail TEXT PRIMARY KEY NOT NULL,
|
||||
$columnPublicKey TEXT NOT NULL
|
||||
)
|
||||
''');
|
||||
''',);
|
||||
}
|
||||
|
||||
Future<void> clearTable() async {
|
||||
|
@ -52,7 +52,7 @@ class PublicKeysDB {
|
|||
Future<int> setKey(PublicKey key) async {
|
||||
final db = await instance.database;
|
||||
return db.insert(table, _getRow(key),
|
||||
conflictAlgorithm: ConflictAlgorithm.replace);
|
||||
conflictAlgorithm: ConflictAlgorithm.replace,);
|
||||
}
|
||||
|
||||
Future<List<PublicKey>> searchByEmail(String email) async {
|
||||
|
@ -61,7 +61,7 @@ class PublicKeysDB {
|
|||
table,
|
||||
where: '$columnEmail LIKE ?',
|
||||
whereArgs: ['%$email%'],
|
||||
));
|
||||
),);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _getRow(PublicKey key) {
|
||||
|
|
|
@ -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<TrashFile> 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<int> 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<int> insert(TrashFile trash) async {
|
||||
|
@ -174,7 +174,7 @@ class TrashDB {
|
|||
}
|
||||
|
||||
Future<FileLoadResult> 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(
|
||||
|
|
|
@ -40,7 +40,7 @@ class UploadLocksDB {
|
|||
$_columnOwner TEXT NOT NULL,
|
||||
$_columnTime TEXT NOT NULL
|
||||
)
|
||||
''');
|
||||
''',);
|
||||
}
|
||||
|
||||
Future<void> clearTable() async {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -64,7 +64,7 @@ Future<void> _runInForeground() async {
|
|||
enabled: Configuration.instance.shouldShowLockScreen(),
|
||||
lightTheme: lightThemeData,
|
||||
darkTheme: darkThemeData,
|
||||
));
|
||||
),);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ Future<void> _runBackgroundTask(String taskId) async {
|
|||
_runWithLogs(() async {
|
||||
_logger.info("run background task");
|
||||
_runInBackground(taskId);
|
||||
}, prefix: "[bg]");
|
||||
}, prefix: "[bg]",);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,7 @@ Future<void> _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<void> _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<bool> _isRunningInForeground() async {
|
|||
|
||||
Future<void> _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<void> _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<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
|
|||
if (PushService.shouldSync(message)) {
|
||||
await _sync('firebaseBgSyncNoActiveProcess');
|
||||
}
|
||||
}, prefix: "[fbg]");
|
||||
}, prefix: "[fbg]",);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ class BillingPlans {
|
|||
|
||||
return BillingPlans(
|
||||
plans: List<BillingPlan>.from(
|
||||
map['plans']?.map((x) => BillingPlan.fromMap(x))),
|
||||
map['plans']?.map((x) => BillingPlan.fromMap(x)),),
|
||||
freePlan: FreePlan.fromMap(map['freePlan']),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
? <PublicURL>[]
|
||||
: List<PublicURL>.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<String, dynamic> toMap() {
|
||||
return {
|
||||
|
|
|
@ -9,7 +9,7 @@ class DuplicateFilesResponse {
|
|||
factory DuplicateFilesResponse.fromMap(Map<String, dynamic> map) {
|
||||
return DuplicateFilesResponse(
|
||||
List<DuplicateItems>.from(
|
||||
map['duplicates']?.map((x) => DuplicateItems.fromMap(x))),
|
||||
map['duplicates']?.map((x) => DuplicateItems.fromMap(x)),),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -23,6 +23,6 @@ class IgnoredFile {
|
|||
}
|
||||
|
||||
return IgnoredFile(trashFile.localID, trashFile.title,
|
||||
trashFile.deviceFolder, kIgnoreReasonTrash);
|
||||
trashFile.deviceFolder, kIgnoreReasonTrash,);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -135,7 +135,7 @@ class Attributes {
|
|||
|
||||
Attributes({
|
||||
this.isCancelled,
|
||||
this.customerID});
|
||||
this.customerID,});
|
||||
|
||||
Attributes.fromJson(dynamic json) {
|
||||
isCancelled = json["isCancelled"];
|
||||
|
|
|
@ -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<FamilyMember>.from(
|
||||
map['members'].map((x) => FamilyMember.fromMap(x)));
|
||||
map['members'].map((x) => FamilyMember.fromMap(x)),);
|
||||
return FamilyData(
|
||||
members,
|
||||
map['storage'] as int,
|
||||
|
|
|
@ -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<String> getStripeCustomerPortalUrl(
|
||||
{String endpoint = kWebPaymentRedirectUrl}) async {
|
||||
{String endpoint = kWebPaymentRedirectUrl,}) async {
|
||||
try {
|
||||
final response = await _dio.get(
|
||||
_config.getHttpEndpoint() + "/billing/stripe/customer-portal",
|
||||
|
|
|
@ -192,7 +192,7 @@ class CollectionsService {
|
|||
|
||||
Future<void> 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<void> 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<void> updateMagicMetadata(
|
||||
Collection collection, Map<String, dynamic> newMetadataUpdate) async {
|
||||
Collection collection, Map<String, dynamic> 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<void> updateShareUrl(
|
||||
Collection collection, Map<String, dynamic> prop) async {
|
||||
Collection collection, Map<String, dynamic> 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<Collection> 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<void> addToCollection(int collectionID, List<File> 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<void> move(
|
||||
int toCollectionID, int fromCollectionID, List<File> files) async {
|
||||
int toCollectionID, int fromCollectionID, List<File> 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<File> files) {
|
||||
int toCollectionID, int fromCollectionID, List<File> 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<CollectionFileItem>.from(
|
||||
map['files']?.map((x) => CollectionFileItem.fromMap(x))),
|
||||
map['files']?.map((x) => CollectionFileItem.fromMap(x)),),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -37,7 +37,7 @@ class FavoritesService {
|
|||
return false;
|
||||
}
|
||||
return _filesDB.doesFileExistInCollection(
|
||||
file.uploadedFileID, collection.id);
|
||||
file.uploadedFileID, collection.id,);
|
||||
}
|
||||
|
||||
Future<void> addToFavorites(File file) async {
|
||||
|
@ -98,7 +98,7 @@ class FavoritesService {
|
|||
null,
|
||||
null,
|
||||
null,
|
||||
));
|
||||
),);
|
||||
_cachedFavoritesCollectionID = collection.id;
|
||||
return collection.id;
|
||||
}
|
||||
|
|
|
@ -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<String, dynamic> toMap() {
|
||||
return {
|
||||
|
|
|
@ -44,7 +44,7 @@ class FileMagicService {
|
|||
}
|
||||
|
||||
Future<void> updatePublicMagicMetadata(
|
||||
List<File> files, Map<String, dynamic> newMetadataUpdate) async {
|
||||
List<File> files, Map<String, dynamic> newMetadataUpdate,) async {
|
||||
final params = <String, dynamic>{};
|
||||
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<void> _updateMagicData(
|
||||
List<File> files, Map<String, dynamic> newMetadataUpdate) async {
|
||||
List<File> files, Map<String, dynamic> newMetadataUpdate,) async {
|
||||
final params = <String, dynamic>{};
|
||||
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<String, dynamic> toJson() {
|
||||
|
|
|
@ -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<void> _checkAndMarkFilesForReUpload(
|
||||
List<String> localIDsToProcess) async {
|
||||
List<String> localIDsToProcess,) async {
|
||||
_logger.info("files to process ${localIDsToProcess.length}");
|
||||
var localIDsWithLocation = <String>[];
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<void>();
|
||||
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(
|
||||
|
|
|
@ -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<List<int>> 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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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<File> 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++;
|
||||
|
|
|
@ -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<String> paths) {
|
||||
_uploader.removeFromQueueWhere((file) {
|
||||
return !paths.contains(file.deviceFolder);
|
||||
}, UserCancelledUploadError());
|
||||
}, UserCancelledUploadError(),);
|
||||
}
|
||||
|
||||
void onVideoBackupPaused() {
|
||||
_uploader.removeFromQueueWhere((file) {
|
||||
return file.fileType == FileType.video;
|
||||
}, UserCancelledUploadError());
|
||||
}, UserCancelledUploadError(),);
|
||||
}
|
||||
|
||||
Future<void> deleteFilesOnServer(List<int> 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",);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ class TrashSyncService {
|
|||
}
|
||||
|
||||
Future<Response<dynamic>> _trashFiles(
|
||||
Map<String, dynamic> requestData) async {
|
||||
Map<String, dynamic> requestData,) async {
|
||||
return _dio.post(
|
||||
Configuration.instance.getHttpEndpoint() + "/files/trash",
|
||||
options: Options(
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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<void> 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<bool> 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"]);
|
||||
}
|
||||
|
|
|
@ -106,11 +106,11 @@ class _AppLockState extends State<AppLock> 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);
|
||||
},
|
||||
|
|
|
@ -22,7 +22,7 @@ class _AppUpdateDialogState extends State<AppUpdateDialog> {
|
|||
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<AppUpdateDialog> {
|
|||
Text("Changelog",
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
)),
|
||||
),),
|
||||
Padding(padding: EdgeInsets.all(4)),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
@ -81,7 +81,7 @@ class _AppUpdateDialogState extends State<AppUpdateDialog> {
|
|||
child: AlertDialog(
|
||||
title: Text(shouldForceUpdate
|
||||
? "Critical update available"
|
||||
: "Update available"),
|
||||
: "Update available",),
|
||||
content: content,
|
||||
),
|
||||
);
|
||||
|
@ -139,7 +139,7 @@ class _ApkDownloaderDialogState extends State<ApkDownloaderDialog> {
|
|||
setState(() {
|
||||
_downloadProgress = count / widget.versionInfo.size;
|
||||
});
|
||||
});
|
||||
},);
|
||||
Navigator.of(context, rootNavigator: true).pop('dialog');
|
||||
OpenFile.open(_saveUrl);
|
||||
} catch (e) {
|
||||
|
|
|
@ -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<FilesUpdatedEvent>().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,
|
||||
),
|
||||
],
|
||||
|
|
|
@ -133,7 +133,7 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
|
|||
.compareTo(second.deviceFolder.toLowerCase());
|
||||
});
|
||||
setState(() {});
|
||||
}),
|
||||
},),
|
||||
Expanded(child: _getFolders()),
|
||||
Hero(
|
||||
tag: "select_folders",
|
||||
|
@ -144,10 +144,10 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
|
|||
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<BackupFolderSelectionPage> {
|
|||
? 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<BackupFolderSelectionPage> {
|
|||
Icons.local_police,
|
||||
color: Colors.white,
|
||||
)
|
||||
: null),
|
||||
]),
|
||||
: null,),
|
||||
],),
|
||||
height: 88,
|
||||
width: 88,
|
||||
),
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -65,7 +65,7 @@ class _ChangeEmailDialogState extends State<ChangeEmailDialog> {
|
|||
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);
|
||||
|
|
|
@ -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<CollectionUpdatedEvent>()
|
||||
|
|
|
@ -101,7 +101,7 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
|
|||
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<CollectionWithThumbnail> collectionsWithThumbnail = [];
|
||||
final latestCollectionFiles =
|
||||
|
@ -137,7 +137,7 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
|
|||
.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<CollectionsGalleryWidget>
|
|||
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<CollectionsGalleryWidget>
|
|||
? nothingToSeeHere(
|
||||
textColor: Theme.of(context)
|
||||
.colorScheme
|
||||
.defaultTextColor)
|
||||
.defaultTextColor,)
|
||||
: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
scrollDirection: Axis.horizontal,
|
||||
|
@ -203,7 +203,7 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
|
|||
// 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<CollectionsGalleryWidget>
|
|||
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<CollectionsGalleryWidget>
|
|||
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<CollectionsGalleryWidget>
|
|||
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<CollectionsGalleryWidget>
|
|||
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<CollectionsGalleryWidget>
|
|||
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<CollectionsGalleryWidget>
|
|||
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<CollectionsGalleryWidget>
|
|||
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<CollectionsGalleryWidget>
|
|||
}
|
||||
|
||||
Widget _buildCollection(BuildContext context,
|
||||
List<CollectionWithThumbnail> collections, int index) {
|
||||
List<CollectionWithThumbnail> collections, int index,) {
|
||||
if (index < collections.length) {
|
||||
final c = collections[index];
|
||||
return CollectionItem(c);
|
||||
|
@ -476,7 +476,7 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
|
|||
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<CollectionsGalleryWidget>
|
|||
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();
|
||||
}
|
||||
|
|
|
@ -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
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
@ -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
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ PopupMenuButton<dynamic> reportBugPopupMenu(BuildContext context) {
|
|||
onSelected: (value) async {
|
||||
if (value == 1) {
|
||||
await sendLogs(context, "Contact support", "support@ente.io",
|
||||
postShare: () {});
|
||||
postShare: () {},);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
|
|
@ -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<CreateCollectionPage> {
|
|||
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<CreateCollectionPage> {
|
|||
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<CreateCollectionPage> {
|
|||
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<CreateCollectionPage> {
|
|||
type: PageTransitionType.bottomToTop,
|
||||
child: CollectionPage(
|
||||
CollectionWithThumbnail(collection, null),
|
||||
)));
|
||||
),),);
|
||||
}
|
||||
|
||||
Future<bool> _runCollectionAction(int collectionID) async {
|
||||
|
@ -293,7 +293,7 @@ class _CreateCollectionPageState extends State<CreateCollectionPage> {
|
|||
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<CreateCollectionPage> {
|
|||
final List<File> filesPendingUpload = [];
|
||||
if (widget.sharedFiles != null) {
|
||||
filesPendingUpload.addAll(await convertIncomingSharedMediaToFile(
|
||||
widget.sharedFiles, collectionID));
|
||||
widget.sharedFiles, collectionID,),);
|
||||
} else {
|
||||
final List<File> filesPendingUpload = [];
|
||||
for (final file in widget.selectedFiles.files) {
|
||||
|
|
|
@ -127,14 +127,14 @@ class _DeduplicatePageState extends State<DeduplicatePage> {
|
|||
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<DeduplicatePage> {
|
|||
"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<DeduplicatePage> {
|
|||
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<DeduplicatePage> {
|
|||
),
|
||||
),
|
||||
_selectedFiles.contains(file) ? kDeleteIconOverlay : Container(),
|
||||
]),
|
||||
],),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ class _DetailPageState extends State<DetailPage> {
|
|||
(_selectedIndex + 1).toString() +
|
||||
" / " +
|
||||
_files.length.toString() +
|
||||
" files .");
|
||||
" files .",);
|
||||
_appBarKey = GlobalKey<FadingAppBarState>();
|
||||
_bottomBarKey = GlobalKey<FadingBottomBarState>();
|
||||
return Scaffold(
|
||||
|
@ -201,7 +201,7 @@ class _DetailPageState extends State<DetailPage> {
|
|||
_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<DetailPage> {
|
|||
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<DetailPage> {
|
|||
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<DetailPage> {
|
|||
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...");
|
||||
|
|
|
@ -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<LocalPhotosUpdatedEvent>(),
|
||||
removalEventTypes: const {
|
||||
|
@ -99,7 +99,7 @@ class _BackupConfigurationHeaderWidgetState
|
|||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.defaultTextColor
|
||||
.withOpacity(0.7)),
|
||||
.withOpacity(0.7),),
|
||||
),
|
||||
Switch(
|
||||
value: isBackedUp,
|
||||
|
|
|
@ -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,
|
||||
),
|
||||
),
|
||||
|
|
|
@ -96,7 +96,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
|||
roundedEdges: Radius.circular(10),
|
||||
unselectedColor:
|
||||
Theme.of(context).colorScheme.stepProgressUnselectedColor,
|
||||
)),
|
||||
),),
|
||||
);
|
||||
return Scaffold(
|
||||
appBar: appBar,
|
||||
|
@ -137,7 +137,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
|||
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<EmailEntryPage> {
|
|||
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<EmailEntryPage> {
|
|||
: 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<EmailEntryPage> {
|
|||
: 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<EmailEntryPage> {
|
|||
setState(() {
|
||||
_hasAgreedToTOS = value;
|
||||
});
|
||||
}),
|
||||
},),
|
||||
Expanded(
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
|
@ -390,7 +390,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
|||
MaterialPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return WebPage(
|
||||
"Privacy", "https://ente.io/privacy");
|
||||
"Privacy", "https://ente.io/privacy",);
|
||||
},
|
||||
),
|
||||
);
|
||||
|
@ -448,7 +448,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
|||
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,
|
||||
|
|
|
@ -192,7 +192,7 @@ class _ExpansionTileState extends State<ExpansionCard>
|
|||
child: const Icon(Icons.expand_more),
|
||||
),
|
||||
),
|
||||
)),
|
||||
),),
|
||||
ClipRect(
|
||||
child: Align(
|
||||
heightFactor: _heightFactor.value,
|
||||
|
|
|
@ -368,14 +368,14 @@ class _PageViewState extends State<ExtentsPageView> {
|
|||
description
|
||||
.add(EnumProperty<Axis>('scrollDirection', widget.scrollDirection));
|
||||
description.add(
|
||||
FlagProperty('reverse', value: widget.reverse, ifTrue: 'reversed'));
|
||||
FlagProperty('reverse', value: widget.reverse, ifTrue: 'reversed'),);
|
||||
description.add(DiagnosticsProperty<PageController>(
|
||||
'controller', widget.controller,
|
||||
showName: false));
|
||||
showName: false,),);
|
||||
description.add(DiagnosticsProperty<ScrollPhysics>(
|
||||
'physics', widget.physics,
|
||||
showName: false));
|
||||
showName: false,),);
|
||||
description.add(FlagProperty('pageSnapping',
|
||||
value: widget.pageSnapping, ifFalse: 'snapping disabled'));
|
||||
value: widget.pageSnapping, ifFalse: 'snapping disabled',),);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -179,7 +179,7 @@ class FadingAppBarState extends State<FadingAppBar> {
|
|||
_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<FadingAppBar> {
|
|||
);
|
||||
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<FadingAppBar> {
|
|||
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<FadingAppBar> {
|
|||
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<FadingAppBar> {
|
|||
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<FadingAppBar> {
|
|||
Navigator.of(context, rootNavigator: true).pop();
|
||||
widget.onFileDeleted(file);
|
||||
},
|
||||
));
|
||||
),);
|
||||
}
|
||||
final action = CupertinoActionSheet(
|
||||
title: Text("Delete file?"),
|
||||
|
|
|
@ -199,7 +199,7 @@ class FadingBottomBarState extends State<FadingBottomBar> {
|
|||
selectedFiles,
|
||||
null,
|
||||
actionType: CollectionActionType.restoreFiles,
|
||||
)));
|
||||
),),);
|
||||
},
|
||||
),
|
||||
),
|
||||
|
|
|
@ -134,7 +134,7 @@ class _FileInfoWidgetState extends State<FileInfoWidget> {
|
|||
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<FileInfoWidget> {
|
|||
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)),
|
||||
|
|
|
@ -31,7 +31,7 @@ class _FreeSpacePageState extends State<FreeSpacePage> {
|
|||
|
||||
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);
|
||||
|
|
|
@ -83,7 +83,7 @@ class _GalleryState extends State<Gallery> {
|
|||
_logger.info("Force reload triggered");
|
||||
final result = await _loadFiles();
|
||||
_setFilesAndReload(result.files);
|
||||
}));
|
||||
}),);
|
||||
}
|
||||
}
|
||||
if (widget.initialFiles != null) {
|
||||
|
@ -112,14 +112,14 @@ class _GalleryState extends State<Gallery> {
|
|||
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<Gallery> {
|
|||
}
|
||||
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<Gallery> {
|
|||
},
|
||||
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<Gallery> {
|
|||
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<File> collatedDailyFiles = [];
|
||||
collatedDailyFiles.addAll(dailyFiles);
|
||||
collatedFiles.add(collatedDailyFiles);
|
||||
|
|
|
@ -181,10 +181,10 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
|
|||
widget.collection,
|
||||
widget.collection.isArchived()
|
||||
? kVisibilityVisible
|
||||
: kVisibilityArchive);
|
||||
: kVisibilityArchive,);
|
||||
}
|
||||
},
|
||||
));
|
||||
),);
|
||||
}
|
||||
return actions;
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
|
|||
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 =
|
||||
|
|
|
@ -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<OverlayWidget> {
|
|||
child: CreateCollectionPage(
|
||||
widget.selectedFiles,
|
||||
null,
|
||||
)));
|
||||
),),);
|
||||
}
|
||||
|
||||
Future<void> _moveFiles() async {
|
||||
|
@ -234,7 +234,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
|
|||
widget.selectedFiles,
|
||||
null,
|
||||
actionType: CollectionActionType.moveFiles,
|
||||
)));
|
||||
),),);
|
||||
}
|
||||
|
||||
List<Widget> _getActions(BuildContext context) {
|
||||
|
@ -278,7 +278,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
|
|||
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<OverlayWidget> {
|
|||
),
|
||||
onPressed: () {
|
||||
_handleVisibilityChangeRequest(
|
||||
context, showArchive ? kVisibilityArchive : kVisibilityVisible);
|
||||
context, showArchive ? kVisibilityArchive : kVisibilityVisible,);
|
||||
},
|
||||
),
|
||||
));
|
||||
),);
|
||||
}
|
||||
return actions;
|
||||
}
|
||||
|
@ -386,10 +386,10 @@ class _OverlayWidgetState extends State<OverlayWidget> {
|
|||
widget.selectedFiles,
|
||||
null,
|
||||
actionType: CollectionActionType.restoreFiles,
|
||||
)));
|
||||
),),);
|
||||
},
|
||||
),
|
||||
));
|
||||
),);
|
||||
actions.add(
|
||||
Tooltip(
|
||||
message: "Delete permanently",
|
||||
|
@ -400,7 +400,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
|
|||
),
|
||||
onPressed: () async {
|
||||
if (await deleteFromTrash(
|
||||
context, widget.selectedFiles.files.toList())) {
|
||||
context, widget.selectedFiles.files.toList(),)) {
|
||||
_clearSelectedFiles();
|
||||
}
|
||||
},
|
||||
|
@ -410,10 +410,10 @@ class _OverlayWidgetState extends State<OverlayWidget> {
|
|||
}
|
||||
|
||||
Future<void> _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<OverlayWidget> {
|
|||
|
||||
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<OverlayWidget> {
|
|||
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<OverlayWidget> {
|
|||
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<OverlayWidget> {
|
|||
(count == 1 ? "" : "s") +
|
||||
" from " +
|
||||
widget.collection.name +
|
||||
"?"),
|
||||
"?",),
|
||||
actions: <Widget>[
|
||||
CupertinoActionSheetAction(
|
||||
child: Text("Remove"),
|
||||
|
@ -525,7 +525,7 @@ class _OverlayWidgetState extends State<OverlayWidget> {
|
|||
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) {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -183,7 +183,7 @@ class _HomeWidgetState extends State<HomeWidget> {
|
|||
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<HomeWidget> {
|
|||
});
|
||||
}, onError: (err) {
|
||||
_logger.severe("getIntentDataStream error: $err");
|
||||
});
|
||||
},);
|
||||
// For sharing images coming from outside the app while the app is closed
|
||||
ReceiveSharingIntent.getInitialMedia().then((List<SharedMediaFile> value) {
|
||||
setState(() {
|
||||
|
@ -286,7 +286,7 @@ class _HomeWidgetState extends State<HomeWidget> {
|
|||
Bus.instance.fire(TabChangedEvent(
|
||||
page,
|
||||
TabChangedEventSource.page_view,
|
||||
));
|
||||
),);
|
||||
},
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
controller: _pageController,
|
||||
|
@ -335,7 +335,7 @@ class _HomeWidgetState extends State<HomeWidget> {
|
|||
_getCredentials(context, link);
|
||||
}, onError: (err) {
|
||||
_logger.severe(err);
|
||||
});
|
||||
},);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -366,27 +366,27 @@ class _HomeWidgetState extends State<HomeWidget> {
|
|||
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<LocalPhotosUpdatedEvent>(),
|
||||
|
@ -430,7 +430,7 @@ class _HomeWidgetState extends State<HomeWidget> {
|
|||
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<HomeBottomNavigationBar> {
|
|||
Bus.instance.fire(TabChangedEvent(
|
||||
index,
|
||||
TabChangedEventSource.tab_bar,
|
||||
));
|
||||
),);
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -626,7 +626,7 @@ class _HomeBottomNavigationBarState extends State<HomeBottomNavigationBar> {
|
|||
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<HomeBottomNavigationBar> {
|
|||
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<HomeBottomNavigationBar> {
|
|||
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<HomeBottomNavigationBar> {
|
|||
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<HomeBottomNavigationBar> {
|
|||
),
|
||||
],
|
||||
),
|
||||
]),
|
||||
],),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -64,7 +64,7 @@ class DraggableScrollbarState extends State<DraggableScrollbar>
|
|||
WidgetsBinding.instance?.addPostFrameCallback((_) {
|
||||
setState(() => thumbOffset =
|
||||
(widget.initialScrollIndex / widget.totalCount) *
|
||||
(thumbMax - thumbMin));
|
||||
(thumbMax - thumbMin),);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -194,22 +194,22 @@ class DraggableScrollbarState extends State<DraggableScrollbar>
|
|||
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),
|
||||
));
|
||||
),);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,9 +5,9 @@ import 'package:photos/ui/huge_listview/draggable_scrollbar.dart';
|
|||
import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
|
||||
|
||||
typedef HugeListViewItemBuilder<T> = Widget Function(
|
||||
BuildContext context, int index);
|
||||
BuildContext context, int index,);
|
||||
typedef HugeListViewErrorBuilder = Widget Function(
|
||||
BuildContext context, dynamic error);
|
||||
BuildContext context, dynamic error,);
|
||||
|
||||
class HugeListView<T> extends StatefulWidget {
|
||||
/// A [ScrollablePositionedList] controller for jumping or scrolling to an item.
|
||||
|
|
|
@ -102,7 +102,7 @@ class _LazyLoadingGalleryState extends State<LazyLoadingGallery> {
|
|||
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<LazyLoadingGallery> {
|
|||
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<LazyLoadingGallery> {
|
|||
widget.selectedFiles,
|
||||
index == 0,
|
||||
_files.length > kRecycleLimit,
|
||||
));
|
||||
),);
|
||||
}
|
||||
|
||||
return Column(
|
||||
|
@ -315,8 +315,8 @@ class _LazyLoadingGridViewState extends State<LazyLoadingGridView> {
|
|||
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<LazyLoadingGridView> {
|
|||
widget.asyncLoader,
|
||||
widget.files.indexOf(file),
|
||||
widget.tag,
|
||||
));
|
||||
),);
|
||||
routeToPage(context, page);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -308,7 +308,7 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
|
|||
|
||||
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<ImageEditorPage> {
|
|||
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,
|
||||
|
|
|
@ -55,9 +55,9 @@ class _LandingPageWidgetState extends State<LandingPageWidget> {
|
|||
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),
|
||||
|
|
|
@ -49,7 +49,7 @@ class _LoadingPhotosWidgetState extends State<LoadingPhotosWidget> {
|
|||
BackupFolderSelectionPage(
|
||||
shouldSelectAll: true,
|
||||
buttonText: "Start backup",
|
||||
));
|
||||
),);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -150,7 +150,7 @@ class _LoadingPhotosWidgetState extends State<LoadingPhotosWidget> {
|
|||
right: 0,
|
||||
child: BottomShadowWidget(),
|
||||
)
|
||||
]),
|
||||
],),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
@ -48,7 +48,7 @@ class _LocationSearchWidgetState extends State<LocationSearchWidget> {
|
|||
"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<LocationSearchWidget> {
|
|||
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 {
|
|||
),
|
||||
],
|
||||
),
|
||||
]),
|
||||
],),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ class _LockScreenState extends State<LockScreen> {
|
|||
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<LockScreen> {
|
|||
),
|
||||
],
|
||||
),
|
||||
]),
|
||||
],),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ class _LockScreenState extends State<LockScreen> {
|
|||
_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();
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ class _LoginPageState extends State<LoginPage> {
|
|||
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<LoginPage> {
|
|||
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<LoginPage> {
|
|||
.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<LoginPage> {
|
|||
MaterialPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return WebPage(
|
||||
"terms", "https://ente.io/terms");
|
||||
"terms", "https://ente.io/terms",);
|
||||
},
|
||||
),
|
||||
);
|
||||
|
@ -171,7 +171,7 @@ class _LoginPageState extends State<LoginPage> {
|
|||
MaterialPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return WebPage("privacy",
|
||||
"https://ente.io/privacy");
|
||||
"https://ente.io/privacy",);
|
||||
},
|
||||
),
|
||||
);
|
||||
|
|
|
@ -137,12 +137,12 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
|
|||
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<ManageSharedLinkWidget> {
|
|||
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<ManageSharedLinkWidget> {
|
|||
}
|
||||
if (newValidTill >= 0) {
|
||||
await _updateUrlSettings(
|
||||
context, {'validTill': newValidTill});
|
||||
context, {'validTill': newValidTill},);
|
||||
setState(() {});
|
||||
}
|
||||
Navigator.of(context).pop('');
|
||||
|
@ -370,7 +370,7 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
|
|||
actions: <Widget>[
|
||||
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<ManageSharedLinkWidget> {
|
|||
),
|
||||
],
|
||||
);
|
||||
});
|
||||
});
|
||||
},);
|
||||
},);
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> _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<ManageSharedLinkWidget> {
|
|||
}
|
||||
|
||||
Future<void> _updateUrlSettings(
|
||||
BuildContext context, Map<String, dynamic> prop) async {
|
||||
BuildContext context, Map<String, dynamic> prop,) async {
|
||||
final dialog = createProgressDialog(context, "Please wait...");
|
||||
await dialog.show();
|
||||
try {
|
||||
|
@ -451,7 +451,7 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
|
|||
List<Text> 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<ManageSharedLinkWidget> {
|
|||
onPressed: () async {
|
||||
await _updateUrlSettings(context, {
|
||||
'deviceLimit': int.tryParse(
|
||||
options[_selectedDeviceLimitIndex].data),
|
||||
options[_selectedDeviceLimitIndex].data,),
|
||||
});
|
||||
setState(() {});
|
||||
Navigator.of(context).pop('');
|
||||
|
|
|
@ -95,7 +95,7 @@ class _MemoryWidgetState extends State<MemoryWidget> {
|
|||
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<FullScreenMemory> {
|
|||
),
|
||||
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<FullScreenMemory> {
|
|||
Colors.transparent,
|
||||
],
|
||||
stops: const [0, 0.6, 1],
|
||||
)),
|
||||
),),
|
||||
),
|
||||
backgroundColor: Color(0x00000000),
|
||||
elevation: 0,
|
||||
|
@ -293,7 +293,7 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
|
|||
bottomGradient(),
|
||||
_buildTitleText(),
|
||||
_buildBottomIcons(),
|
||||
]),
|
||||
],),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -311,7 +311,7 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
|
|||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.headline4
|
||||
.copyWith(color: Colors.white)),
|
||||
.copyWith(color: Colors.white),),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -330,7 +330,7 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
|
|||
onPressed: () {
|
||||
share(context, [file]);
|
||||
},
|
||||
));
|
||||
),);
|
||||
}
|
||||
|
||||
Widget bottomGradient() {
|
||||
|
@ -346,7 +346,7 @@ class _FullScreenMemoryState extends State<FullScreenMemory> {
|
|||
Colors.transparent,
|
||||
],
|
||||
stops: const [0, 0.8],
|
||||
)),
|
||||
),),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ class _GNavState extends State<GNav> {
|
|||
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<GNav> {
|
|||
});
|
||||
});
|
||||
},
|
||||
))
|
||||
.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<Button> with TickerProviderStateMixin {
|
|||
Widget build(BuildContext context) {
|
||||
var curveValue = expandController
|
||||
.drive(
|
||||
CurveTween(curve: _expanded ? widget.curve : widget.curve.flipped))
|
||||
CurveTween(curve: _expanded ? widget.curve : widget.curve.flipped),)
|
||||
.value;
|
||||
|
||||
_expanded = !widget.active;
|
||||
|
@ -372,7 +372,7 @@ class _ButtonState extends State<Button> with TickerProviderStateMixin {
|
|||
fit: BoxFit.fitHeight,
|
||||
child: Stack(children: [
|
||||
Align(alignment: Alignment.centerLeft, child: icon),
|
||||
]),
|
||||
],),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -69,7 +69,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
|
|||
onPressedFunction: () {
|
||||
if (widget.isChangeEmail) {
|
||||
UserService.instance.changeEmail(
|
||||
context, widget.email, _verificationCodeController.text);
|
||||
context, widget.email, _verificationCodeController.text,);
|
||||
} else {
|
||||
UserService.instance
|
||||
.verifyEmail(context, _verificationCodeController.text);
|
||||
|
@ -90,7 +90,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
|
|||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(20, 30, 20, 15),
|
||||
child: Text('Verify email',
|
||||
style: Theme.of(context).textTheme.headline4),
|
||||
style: Theme.of(context).textTheme.headline4,),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||
|
@ -113,7 +113,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
|
|||
TextSpan(
|
||||
text: widget.email,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).buttonColor))
|
||||
color: Theme.of(context).buttonColor,),)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -145,7 +145,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
|
|||
contentPadding: EdgeInsets.all(15),
|
||||
border: UnderlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
borderRadius: BorderRadius.circular(6)),
|
||||
borderRadius: BorderRadius.circular(6),),
|
||||
),
|
||||
controller: _verificationCodeController,
|
||||
autofocus: false,
|
||||
|
@ -167,12 +167,12 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
|
|||
TextButton(
|
||||
onPressed: () {
|
||||
UserService.instance.getOtt(context, widget.email,
|
||||
isCreateAccountScreen: widget.isCreateAccountScreen);
|
||||
isCreateAccountScreen: widget.isCreateAccountScreen,);
|
||||
},
|
||||
child: Text(
|
||||
"Resend email",
|
||||
style: Theme.of(context).textTheme.subtitle1.copyWith(
|
||||
fontSize: 14, decoration: TextDecoration.underline),
|
||||
fontSize: 14, decoration: TextDecoration.underline,),
|
||||
),
|
||||
)
|
||||
],
|
||||
|
|
|
@ -59,7 +59,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
|||
_volatilePassword = Configuration.instance.getVolatilePassword();
|
||||
if (_volatilePassword != null) {
|
||||
Future.delayed(
|
||||
Duration.zero, () => _showRecoveryCodeDialog(_volatilePassword));
|
||||
Duration.zero, () => _showRecoveryCodeDialog(_volatilePassword),);
|
||||
}
|
||||
_password1FocusNode.addListener(() {
|
||||
setState(() {
|
||||
|
@ -117,7 +117,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
|||
} else {
|
||||
_updatePassword();
|
||||
}
|
||||
}),
|
||||
},),
|
||||
floatingActionButtonLocation: fabLocation(),
|
||||
floatingActionButtonAnimator: NoScalingAnimation(),
|
||||
);
|
||||
|
@ -147,7 +147,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
|||
padding:
|
||||
const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
|
||||
child: Text(buttonTextAndHeading,
|
||||
style: Theme.of(context).textTheme.headline4),
|
||||
style: Theme.of(context).textTheme.headline4,),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
|
@ -174,14 +174,14 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
|||
children: [
|
||||
TextSpan(
|
||||
text:
|
||||
"We don't store this password, so if you forget, "),
|
||||
"We don't store this password, so if you forget, ",),
|
||||
TextSpan(
|
||||
text: "we cannot decrypt your data",
|
||||
style: Theme.of(context).textTheme.subtitle1.copyWith(
|
||||
fontSize: 14,
|
||||
decoration: TextDecoration.underline),
|
||||
decoration: TextDecoration.underline,),
|
||||
),
|
||||
])),
|
||||
],),),
|
||||
),
|
||||
Padding(padding: EdgeInsets.all(12)),
|
||||
Visibility(
|
||||
|
@ -210,7 +210,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
|||
contentPadding: EdgeInsets.all(20),
|
||||
border: UnderlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
borderRadius: BorderRadius.circular(6)),
|
||||
borderRadius: BorderRadius.circular(6),),
|
||||
suffixIcon: _password1InFocus
|
||||
? IconButton(
|
||||
icon: Icon(
|
||||
|
@ -274,7 +274,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
|||
filled: true,
|
||||
hintText: "Confirm password",
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
horizontal: 20, vertical: 20),
|
||||
horizontal: 20, vertical: 20,),
|
||||
suffixIcon: _password2InFocus
|
||||
? IconButton(
|
||||
icon: Icon(
|
||||
|
@ -302,7 +302,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
|||
: null,
|
||||
border: UnderlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
borderRadius: BorderRadius.circular(6)),
|
||||
borderRadius: BorderRadius.circular(6),),
|
||||
),
|
||||
focusNode: _password2FocusNode,
|
||||
onChanged: (cnfPassword) {
|
||||
|
@ -328,7 +328,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
|||
width: MediaQuery.of(context).size.width,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 20),
|
||||
horizontal: 20,),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
boxShadow: [
|
||||
|
@ -355,24 +355,24 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
|||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
4.0, 4, 4.0, 4.0),
|
||||
4.0, 4, 4.0, 4.0,),
|
||||
child: Row(
|
||||
children: [
|
||||
Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 5),
|
||||
vertical: 5,),
|
||||
child: Text(
|
||||
'Password Strength: $passwordStrengthText',
|
||||
style: TextStyle(
|
||||
color:
|
||||
passwordStrengthColor),
|
||||
)),
|
||||
passwordStrengthColor,),
|
||||
),),
|
||||
],
|
||||
),
|
||||
),
|
||||
]),
|
||||
],),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -380,7 +380,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
|||
width: 20,
|
||||
),
|
||||
],
|
||||
)),
|
||||
),),
|
||||
),
|
||||
],
|
||||
clipBehavior: Clip.none,
|
||||
|
@ -395,7 +395,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
|||
MaterialPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return WebPage(
|
||||
"How it works", "https://ente.io/architecture");
|
||||
"How it works", "https://ente.io/architecture",);
|
||||
},
|
||||
),
|
||||
);
|
||||
|
@ -407,7 +407,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
|||
text: "How it works",
|
||||
style: Theme.of(context).textTheme.subtitle1.copyWith(
|
||||
fontSize: 14,
|
||||
decoration: TextDecoration.underline)),
|
||||
decoration: TextDecoration.underline,),),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -481,13 +481,13 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
|||
isDismissible: false,
|
||||
onDone: onDone,
|
||||
showProgressBar: true,
|
||||
));
|
||||
),);
|
||||
} catch (e) {
|
||||
_logger.severe(e);
|
||||
await dialog.hide();
|
||||
if (e is UnsupportedError) {
|
||||
showErrorDialog(context, "Insecure device",
|
||||
"Sorry, we could not generate secure keys on this device.\n\nplease sign up from a different device.");
|
||||
"Sorry, we could not generate secure keys on this device.\n\nplease sign up from a different device.",);
|
||||
} else {
|
||||
showGenericErrorDialog(context);
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
|
|||
try {
|
||||
await Configuration.instance.decryptAndSaveSecrets(
|
||||
_passwordController.text,
|
||||
Configuration.instance.getKeyAttributes());
|
||||
Configuration.instance.getKeyAttributes(),);
|
||||
} catch (e) {
|
||||
Logger("PRP").warning(e);
|
||||
await dialog.hide();
|
||||
|
@ -91,7 +91,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
|
|||
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),
|
||||
|
@ -103,7 +103,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
|
|||
contentPadding: EdgeInsets.all(20),
|
||||
border: UnderlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
borderRadius: BorderRadius.circular(6)),
|
||||
borderRadius: BorderRadius.circular(6),),
|
||||
suffixIcon: _passwordInFocus
|
||||
? IconButton(
|
||||
icon: Icon(
|
||||
|
@ -165,7 +165,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
|
|||
.subtitle1
|
||||
.copyWith(
|
||||
fontSize: 14,
|
||||
decoration: TextDecoration.underline)),
|
||||
decoration: TextDecoration.underline,),),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -188,7 +188,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
|
|||
.subtitle1
|
||||
.copyWith(
|
||||
fontSize: 14,
|
||||
decoration: TextDecoration.underline)),
|
||||
decoration: TextDecoration.underline,),),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -114,7 +114,7 @@ class _PaymentWebPageState extends State<PaymentWebPage> {
|
|||
),
|
||||
].where((Object o) => o != null).toList(),
|
||||
),
|
||||
));
|
||||
),);
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -149,7 +149,7 @@ class _PaymentWebPageState extends State<PaymentWebPage> {
|
|||
child: Text('Yes',
|
||||
style: TextStyle(
|
||||
color: Colors.redAccent,
|
||||
)),
|
||||
),),
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
),
|
||||
TextButton(
|
||||
|
@ -199,8 +199,8 @@ class _PaymentWebPageState extends State<PaymentWebPage> {
|
|||
child: Text('Ok'),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop('dialog');
|
||||
}),
|
||||
]));
|
||||
},),
|
||||
],),);
|
||||
Navigator.of(context).pop(true);
|
||||
}
|
||||
|
||||
|
@ -211,7 +211,7 @@ class _PaymentWebPageState extends State<PaymentWebPage> {
|
|||
try {
|
||||
var response = await billingService.verifySubscription(
|
||||
widget.planId, checkoutSessionID,
|
||||
paymentProvider: kStripe);
|
||||
paymentProvider: kStripe,);
|
||||
await _dialog.hide();
|
||||
if (response != null) {
|
||||
var content = widget.actionType == 'buy'
|
||||
|
@ -247,7 +247,7 @@ class _PaymentWebPageState extends State<PaymentWebPage> {
|
|||
),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop('dialog');
|
||||
}),
|
||||
},),
|
||||
],
|
||||
),
|
||||
).then((val) => Navigator.pop(context, true));
|
||||
|
|
|
@ -121,8 +121,8 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
|
|||
BoxShadow(
|
||||
color: Theme.of(context).backgroundColor,
|
||||
blurRadius: 16,
|
||||
offset: Offset(0, 8))
|
||||
]),
|
||||
offset: Offset(0, 8),)
|
||||
],),
|
||||
child: widget.isOnboarding
|
||||
? AppBar(
|
||||
elevation: 0,
|
||||
|
@ -136,12 +136,12 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
|
|||
unselectedColor: Theme.of(context)
|
||||
.colorScheme
|
||||
.stepProgressUnselectedColor,
|
||||
)),
|
||||
),),
|
||||
)
|
||||
: AppBar(
|
||||
elevation: 0,
|
||||
title: Text("Subscription"),
|
||||
)),
|
||||
),),
|
||||
);
|
||||
return Scaffold(
|
||||
appBar: appBar,
|
||||
|
@ -179,12 +179,12 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
|
|||
widgets.add(SubscriptionHeaderWidget(
|
||||
isOnboarding: widget.isOnboarding,
|
||||
currentUsage: _userDetails.getFamilyOrPersonalUsage(),
|
||||
));
|
||||
),);
|
||||
|
||||
widgets.addAll([
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: _getStripePlanWidgets()),
|
||||
children: _getStripePlanWidgets(),),
|
||||
Padding(padding: EdgeInsets.all(4)),
|
||||
]);
|
||||
|
||||
|
@ -220,14 +220,14 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
|
|||
launch(
|
||||
"https://play.google.com/store/account/subscriptions?sku=" +
|
||||
_currentSubscription.productID +
|
||||
"&package=io.ente.photos");
|
||||
"&package=io.ente.photos",);
|
||||
break;
|
||||
case kAppStore:
|
||||
launch("https://apps.apple.com/account/billing");
|
||||
break;
|
||||
default:
|
||||
_logger.severe(
|
||||
"unexpected payment provider ", _currentSubscription);
|
||||
"unexpected payment provider ", _currentSubscription,);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
|
@ -246,7 +246,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
|
|||
decoration: _isStripeSubscriber
|
||||
? TextDecoration.underline
|
||||
: TextDecoration.none,
|
||||
)),
|
||||
),),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
|
@ -318,7 +318,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
|
|||
await showErrorDialog(
|
||||
context,
|
||||
"Now you can share your storage plan with your family members!",
|
||||
"Customers on paid plans can add up to 5 family members without paying extra. Each member gets their own private space.");
|
||||
"Customers on paid plans can add up to 5 family members without paying extra. Each member gets their own private space.",);
|
||||
return;
|
||||
}
|
||||
await _dialog.show();
|
||||
|
@ -328,9 +328,9 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
|
|||
Navigator.of(context).push(MaterialPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return WebPage("Family",
|
||||
'$kFamilyPlanManagementUrl?token=$jwtToken&isFamilyCreated=$familyExist');
|
||||
'$kFamilyPlanManagementUrl?token=$jwtToken&isFamilyCreated=$familyExist',);
|
||||
},
|
||||
)).then((value) => onWebPaymentGoBack);
|
||||
),).then((value) => onWebPaymentGoBack);
|
||||
} catch (e) {
|
||||
await _dialog.hide();
|
||||
showGenericErrorDialog(context);
|
||||
|
@ -358,14 +358,14 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
|
|||
if (isRenewCancelled) {
|
||||
var choice = await showChoiceDialog(
|
||||
context, title, "are you sure you want to renew?",
|
||||
firstAction: "no", secondAction: "yes");
|
||||
firstAction: "no", secondAction: "yes",);
|
||||
confirmAction = choice == DialogUserChoice.secondChoice;
|
||||
} else {
|
||||
var choice = await showChoiceDialog(
|
||||
context, title, 'are you sure you want to cancel?',
|
||||
firstAction: 'yes, cancel',
|
||||
secondAction: 'no',
|
||||
actionType: ActionType.critical);
|
||||
actionType: ActionType.critical,);
|
||||
confirmAction = choice == DialogUserChoice.firstChoice;
|
||||
}
|
||||
if (confirmAction) {
|
||||
|
@ -384,7 +384,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
|
|||
await _fetchSub();
|
||||
} catch (e) {
|
||||
showToast(
|
||||
context, isRenewCancelled ? 'failed to renew' : 'failed to cancel');
|
||||
context, isRenewCancelled ? 'failed to renew' : 'failed to cancel',);
|
||||
}
|
||||
await _dialog.hide();
|
||||
}
|
||||
|
@ -415,12 +415,12 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
|
|||
_hasActiveSubscription &&
|
||||
_currentSubscription.productID != kFreeProductID) {
|
||||
showErrorDialog(context, "Sorry",
|
||||
"please cancel your existing subscription from ${_currentSubscription.paymentProvider} first");
|
||||
"please cancel your existing subscription from ${_currentSubscription.paymentProvider} first",);
|
||||
return;
|
||||
}
|
||||
if (_userDetails.getFamilyOrPersonalUsage() > plan.storage) {
|
||||
showErrorDialog(
|
||||
context, "Sorry", "you cannot downgrade to this plan");
|
||||
context, "Sorry", "you cannot downgrade to this plan",);
|
||||
return;
|
||||
}
|
||||
String stripPurChaseAction = 'buy';
|
||||
|
@ -431,7 +431,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
|
|||
"Confirm plan change",
|
||||
"Are you sure you want to change your plan?",
|
||||
firstAction: "No",
|
||||
secondAction: 'Yes');
|
||||
secondAction: 'Yes',);
|
||||
if (result != DialogUserChoice.secondChoice) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ class SubscriptionHeaderWidget extends StatefulWidget {
|
|||
final int currentUsage;
|
||||
|
||||
const SubscriptionHeaderWidget(
|
||||
{Key key, this.isOnboarding, this.currentUsage})
|
||||
{Key key, this.isOnboarding, this.currentUsage,})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
|
@ -58,7 +58,7 @@ class _SubscriptionHeaderWidgetState extends State<SubscriptionHeaderWidget> {
|
|||
children: [
|
||||
TextSpan(
|
||||
text: "Current usage is ",
|
||||
style: Theme.of(context).textTheme.subtitle1),
|
||||
style: Theme.of(context).textTheme.subtitle1,),
|
||||
TextSpan(
|
||||
text: formatBytes(widget.currentUsage),
|
||||
style: Theme.of(context)
|
||||
|
@ -86,7 +86,7 @@ class ValidityWidget extends StatelessWidget {
|
|||
return Container();
|
||||
}
|
||||
var endDate = getDateAndMonthAndYear(
|
||||
DateTime.fromMicrosecondsSinceEpoch(currentSubscription.expiryTime));
|
||||
DateTime.fromMicrosecondsSinceEpoch(currentSubscription.expiryTime),);
|
||||
var message = "Renews on $endDate";
|
||||
if (currentSubscription.productID == kFreeProductID) {
|
||||
message = "Free plan valid till $endDate";
|
||||
|
|
|
@ -103,7 +103,7 @@ class _SubscriptionPageState extends State<SubscriptionPage> {
|
|||
"payment failed",
|
||||
"please talk to " +
|
||||
(Platform.isAndroid ? "PlayStore" : "AppStore") +
|
||||
" support if you were charged");
|
||||
" support if you were charged",);
|
||||
return;
|
||||
}
|
||||
} else if (Platform.isIOS && purchase.pendingCompletePurchase) {
|
||||
|
@ -178,7 +178,7 @@ class _SubscriptionPageState extends State<SubscriptionPage> {
|
|||
widgets.add(SubscriptionHeaderWidget(
|
||||
isOnboarding: widget.isOnboarding,
|
||||
currentUsage: _userDetails.getFamilyOrPersonalUsage(),
|
||||
));
|
||||
),);
|
||||
|
||||
widgets.addAll([
|
||||
Column(
|
||||
|
@ -215,7 +215,7 @@ class _SubscriptionPageState extends State<SubscriptionPage> {
|
|||
launch(
|
||||
"https://play.google.com/store/account/subscriptions?sku=" +
|
||||
_currentSubscription.productID +
|
||||
"&package=io.ente.photos");
|
||||
"&package=io.ente.photos",);
|
||||
} else {
|
||||
launch("https://apps.apple.com/account/billing");
|
||||
}
|
||||
|
@ -308,7 +308,7 @@ class _SubscriptionPageState extends State<SubscriptionPage> {
|
|||
return;
|
||||
}
|
||||
showErrorDialog(context, "Sorry",
|
||||
"Please visit web.ente.io to manage your subscription");
|
||||
"Please visit web.ente.io to manage your subscription",);
|
||||
},
|
||||
child: SubscriptionPlanWidget(
|
||||
storage: plan.storage,
|
||||
|
@ -357,7 +357,7 @@ class _SubscriptionPageState extends State<SubscriptionPage> {
|
|||
}
|
||||
if (_userDetails.getFamilyOrPersonalUsage() > plan.storage) {
|
||||
showErrorDialog(
|
||||
context, "Sorry", "you cannot downgrade to this plan");
|
||||
context, "Sorry", "you cannot downgrade to this plan",);
|
||||
return;
|
||||
}
|
||||
await _dialog.show();
|
||||
|
@ -366,7 +366,7 @@ class _SubscriptionPageState extends State<SubscriptionPage> {
|
|||
.queryProductDetails({productID});
|
||||
if (response.notFoundIDs.isNotEmpty) {
|
||||
_logger.severe("Could not find products: " +
|
||||
response.notFoundIDs.toString());
|
||||
response.notFoundIDs.toString(),);
|
||||
await _dialog.hide();
|
||||
showGenericErrorDialog(context);
|
||||
return;
|
||||
|
@ -381,7 +381,7 @@ class _SubscriptionPageState extends State<SubscriptionPage> {
|
|||
.queryProductDetails({_currentSubscription.productID});
|
||||
if (existingProductDetailsResponse.notFoundIDs.isNotEmpty) {
|
||||
_logger.severe("Could not find existing products: " +
|
||||
response.notFoundIDs.toString());
|
||||
response.notFoundIDs.toString(),);
|
||||
await _dialog.hide();
|
||||
showGenericErrorDialog(context);
|
||||
return;
|
||||
|
@ -453,7 +453,7 @@ class _SubscriptionPageState extends State<SubscriptionPage> {
|
|||
await showErrorDialog(
|
||||
context,
|
||||
"Now you can share your storage plan with your family members!",
|
||||
"Customers on paid plans can add up to 5 family members without paying extra. Each member gets their own private space.");
|
||||
"Customers on paid plans can add up to 5 family members without paying extra. Each member gets their own private space.",);
|
||||
return;
|
||||
}
|
||||
await _dialog.show();
|
||||
|
@ -463,9 +463,9 @@ class _SubscriptionPageState extends State<SubscriptionPage> {
|
|||
Navigator.of(context).push(MaterialPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return WebPage("Family",
|
||||
'$kFamilyPlanManagementUrl?token=$jwtToken&isFamilyCreated=$familyExist');
|
||||
'$kFamilyPlanManagementUrl?token=$jwtToken&isFamilyCreated=$familyExist',);
|
||||
},
|
||||
));
|
||||
),);
|
||||
} catch (e) {
|
||||
await _dialog.hide();
|
||||
showGenericErrorDialog(context);
|
||||
|
|
|
@ -60,7 +60,7 @@ class SubscriptionPlanWidget extends StatelessWidget {
|
|||
),
|
||||
Text(_displayPrice(),
|
||||
style: Theme.of(context).textTheme.headline6.copyWith(
|
||||
color: textColor, fontWeight: FontWeight.normal)),
|
||||
color: textColor, fontWeight: FontWeight.normal,),),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
|
|
@ -21,9 +21,9 @@ bool _barrierDismissible = true, _showLogs = false;
|
|||
Color _barrierColor;
|
||||
|
||||
TextStyle _progressTextStyle = TextStyle(
|
||||
color: Colors.black, fontSize: 12.0, fontWeight: FontWeight.w400),
|
||||
color: Colors.black, fontSize: 12.0, fontWeight: FontWeight.w400,),
|
||||
_messageStyle = TextStyle(
|
||||
color: Colors.black, fontSize: 18.0, fontWeight: FontWeight.w600);
|
||||
color: Colors.black, fontSize: 18.0, fontWeight: FontWeight.w600,);
|
||||
|
||||
double _dialogElevation = 8.0, _borderRadius = 8.0;
|
||||
Color _backgroundColor = Colors.white;
|
||||
|
@ -70,7 +70,7 @@ class ProgressDialog {
|
|||
double borderRadius,
|
||||
Curve insetAnimCurve,
|
||||
EdgeInsets padding,
|
||||
Alignment progressWidgetAlignment}) {
|
||||
Alignment progressWidgetAlignment,}) {
|
||||
if (_isShowing) return;
|
||||
if (_progressDialogType == ProgressDialogType.Download) {
|
||||
_progress = progress ?? _progress;
|
||||
|
@ -98,7 +98,7 @@ class ProgressDialog {
|
|||
String message,
|
||||
Widget progressWidget,
|
||||
TextStyle progressTextStyle,
|
||||
TextStyle messageTextStyle}) {
|
||||
TextStyle messageTextStyle,}) {
|
||||
if (_progressDialogType == ProgressDialogType.Download) {
|
||||
_progress = progress ?? _progress;
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ class ProgressDialog {
|
|||
elevation: _dialogElevation,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(_borderRadius))),
|
||||
BorderRadius.all(Radius.circular(_borderRadius)),),
|
||||
child: _dialog,
|
||||
),
|
||||
);
|
||||
|
@ -236,7 +236,7 @@ class _BodyState extends State<_Body> {
|
|||
_dialogMessage,
|
||||
style: _messageStyle,
|
||||
textDirection: _direction,
|
||||
)),
|
||||
),),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 4.0),
|
||||
|
|
|
@ -30,7 +30,7 @@ class RecoveryKeyPage extends StatefulWidget {
|
|||
this.title,
|
||||
this.text,
|
||||
this.subText,
|
||||
this.showProgressBar = false})
|
||||
this.showProgressBar = false,})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
|
@ -40,14 +40,14 @@ class RecoveryKeyPage extends StatefulWidget {
|
|||
class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
|
||||
bool _hasTriedToSave = false;
|
||||
final _recoveryKeyFile = io.File(
|
||||
Configuration.instance.getTempDirectory() + "ente-recovery-key.txt");
|
||||
Configuration.instance.getTempDirectory() + "ente-recovery-key.txt",);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final String recoveryKey = bip39.entropyToMnemonic(widget.recoveryKey);
|
||||
if (recoveryKey.split(' ').length != kMnemonicKeyWordCount) {
|
||||
throw AssertionError(
|
||||
'recovery code should have $kMnemonicKeyWordCount words');
|
||||
'recovery code should have $kMnemonicKeyWordCount words',);
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
|
@ -81,7 +81,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
|
|||
? 32
|
||||
: 120,
|
||||
20,
|
||||
20),
|
||||
20,),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
|
@ -89,7 +89,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
|
|||
widget.showAppBar
|
||||
? const SizedBox.shrink()
|
||||
: Text(widget.title ?? "Recovery key",
|
||||
style: Theme.of(context).textTheme.headline4),
|
||||
style: Theme.of(context).textTheme.headline4,),
|
||||
Padding(padding: EdgeInsets.all(widget.showAppBar ? 0 : 12)),
|
||||
Text(
|
||||
widget.text ??
|
||||
|
@ -116,7 +116,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
|
|||
GestureDetector(
|
||||
onTap: () async {
|
||||
await Clipboard.setData(
|
||||
ClipboardData(text: recoveryKey));
|
||||
ClipboardData(text: recoveryKey),);
|
||||
showToast(context, "Recovery key copied to clipboard");
|
||||
setState(() {
|
||||
_hasTriedToSave = true;
|
||||
|
@ -155,7 +155,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
|
|||
"We don’t store this key, please save this in a safe place.",
|
||||
style: Theme.of(context).textTheme.bodyText1,
|
||||
),
|
||||
padding: EdgeInsets.symmetric(vertical: 20)),
|
||||
padding: EdgeInsets.symmetric(vertical: 20),),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
|
@ -165,7 +165,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
|
|||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: _saveOptions(context, recoveryKey)),
|
||||
children: _saveOptions(context, recoveryKey),),
|
||||
),
|
||||
)
|
||||
],
|
||||
|
@ -183,7 +183,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
|
|||
onPressed: () async {
|
||||
await _saveKeys();
|
||||
},
|
||||
));
|
||||
),);
|
||||
childrens.add(SizedBox(height: 10));
|
||||
}
|
||||
|
||||
|
@ -199,7 +199,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
|
|||
onTap: () async {
|
||||
await _shareRecoveryKey(recoveryKey);
|
||||
},
|
||||
));
|
||||
),);
|
||||
if (_hasTriedToSave) {
|
||||
childrens.add(SizedBox(height: 10));
|
||||
childrens.add(ElevatedButton(
|
||||
|
@ -207,7 +207,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
|
|||
onPressed: () async {
|
||||
await _saveKeys();
|
||||
},
|
||||
));
|
||||
),);
|
||||
}
|
||||
childrens.add(SizedBox(height: 12));
|
||||
return childrens;
|
||||
|
|
|
@ -61,7 +61,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
|
|||
}
|
||||
showErrorDialog(context, "incorrect recovery key", errMessage);
|
||||
}
|
||||
}),
|
||||
},),
|
||||
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
|
||||
floatingActionButtonAnimator: NoScalingAnimation(),
|
||||
body: Column(
|
||||
|
@ -73,7 +73,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
|
|||
padding:
|
||||
const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
|
||||
child: Text('Forgot password',
|
||||
style: Theme.of(context).textTheme.headline4),
|
||||
style: Theme.of(context).textTheme.headline4,),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(20, 24, 20, 0),
|
||||
|
@ -84,7 +84,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
|
|||
contentPadding: EdgeInsets.all(20),
|
||||
border: UnderlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
borderRadius: BorderRadius.circular(6)),
|
||||
borderRadius: BorderRadius.circular(6),),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
|
@ -127,7 +127,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
|
|||
.subtitle1
|
||||
.copyWith(
|
||||
fontSize: 14,
|
||||
decoration: TextDecoration.underline),
|
||||
decoration: TextDecoration.underline,),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -74,12 +74,12 @@ class _RenameDialogState extends State<RenameDialog> {
|
|||
onPressed: () {
|
||||
if (_newName.trim().isEmpty) {
|
||||
showErrorDialog(
|
||||
context, "Empty name", "${widget.type} name cannot be empty");
|
||||
context, "Empty name", "${widget.type} name cannot be empty",);
|
||||
return;
|
||||
}
|
||||
if (_newName.trim().length > widget.maxLength) {
|
||||
showErrorDialog(context, "Name too large",
|
||||
"${widget.type} name should be less than ${widget.maxLength} characters");
|
||||
"${widget.type} name should be less than ${widget.maxLength} characters",);
|
||||
return;
|
||||
}
|
||||
Navigator.of(context).pop(_newName.trim());
|
||||
|
|
|
@ -120,7 +120,7 @@ class _SessionsPageState extends State<SessionsPage> {
|
|||
await dialog.hide();
|
||||
_logger.severe('failed to terminate', e, s);
|
||||
showErrorDialog(
|
||||
context, 'Oops', "Something went wrong, please try again");
|
||||
context, 'Oops', "Something went wrong, please try again",);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ class _SetWallpaperDialogState extends State<SetWallpaperDialog> {
|
|||
await dialog.show();
|
||||
try {
|
||||
await WallpaperManagerFlutter().setwallpaperfromFile(
|
||||
await getFile(widget.file), _lockscreenValue);
|
||||
await getFile(widget.file), _lockscreenValue,);
|
||||
await dialog.hide();
|
||||
showToast(context, "Wallpaper set successfully");
|
||||
} catch (e, s) {
|
||||
|
|
|
@ -50,7 +50,7 @@ class AccountSectionWidgetState extends State<AccountSectionWidget> {
|
|||
);
|
||||
},
|
||||
child: SettingsTextItem(
|
||||
text: "Subscription plan", icon: Icons.navigate_next),
|
||||
text: "Subscription plan", icon: Icons.navigate_next,),
|
||||
),
|
||||
SectionOptionDivider,
|
||||
GestureDetector(
|
||||
|
@ -76,7 +76,7 @@ class AccountSectionWidgetState extends State<AccountSectionWidget> {
|
|||
routeToPage(
|
||||
context,
|
||||
RecoveryKeyPage(recoveryKey, "OK",
|
||||
showAppBar: true, onDone: () {}));
|
||||
showAppBar: true, onDone: () {},),);
|
||||
},
|
||||
child:
|
||||
SettingsTextItem(text: "Recovery key", icon: Icons.navigate_next),
|
||||
|
@ -130,7 +130,7 @@ class AccountSectionWidgetState extends State<AccountSectionWidget> {
|
|||
);
|
||||
},
|
||||
child: SettingsTextItem(
|
||||
text: "Change password", icon: Icons.navigate_next),
|
||||
text: "Change password", icon: Icons.navigate_next,),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
@ -138,6 +138,6 @@ class AccountSectionWidgetState extends State<AccountSectionWidget> {
|
|||
|
||||
Future<String> _getOrCreateRecoveryKey() async {
|
||||
return Sodium.bin2hex(
|
||||
await UserService.instance.getOrCreateRecoveryKey(context));
|
||||
await UserService.instance.getOrCreateRecoveryKey(context),);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ class _AppVersionWidgetState extends State<AppVersionWidget> {
|
|||
createProgressDialog(context, "Starting network inspector...");
|
||||
await dialog.show();
|
||||
await Future.delayed(
|
||||
Duration(milliseconds: kDummyDelayDurationInMilliseconds));
|
||||
Duration(milliseconds: kDummyDelayDurationInMilliseconds),);
|
||||
await dialog.hide();
|
||||
Network.instance.getAlice().showInspector();
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ class BackupSectionWidgetState extends State<BackupSectionWidget> {
|
|||
);
|
||||
},
|
||||
child: SettingsTextItem(
|
||||
text: "Backed up folders", icon: Icons.navigate_next),
|
||||
text: "Backed up folders", icon: Icons.navigate_next,),
|
||||
),
|
||||
SectionOptionDivider,
|
||||
SizedBox(
|
||||
|
@ -111,7 +111,7 @@ class BackupSectionWidgetState extends State<BackupSectionWidget> {
|
|||
await dialog.hide();
|
||||
if (status.localIDs.isEmpty) {
|
||||
showErrorDialog(context, "✨ All clear",
|
||||
"You've no files on this device that can be deleted");
|
||||
"You've no files on this device that can be deleted",);
|
||||
} else {
|
||||
bool result = await routeToPage(context, FreeSpacePage(status));
|
||||
if (result == true) {
|
||||
|
@ -143,7 +143,7 @@ class BackupSectionWidgetState extends State<BackupSectionWidget> {
|
|||
await dialog.hide();
|
||||
if (duplicates.isEmpty) {
|
||||
showErrorDialog(context, "✨ No duplicates",
|
||||
"You've no duplicate files that can be cleared");
|
||||
"You've no duplicate files that can be cleared",);
|
||||
} else {
|
||||
DeduplicationResult result =
|
||||
await routeToPage(context, DeduplicatePage(duplicates));
|
||||
|
@ -165,7 +165,7 @@ class BackupSectionWidgetState extends State<BackupSectionWidget> {
|
|||
AlertDialog alert = AlertDialog(
|
||||
title: Text("Success"),
|
||||
content: Text(
|
||||
"You have successfully freed up " + formatBytes(status.size) + "!"),
|
||||
"You have successfully freed up " + formatBytes(status.size) + "!",),
|
||||
actions: [
|
||||
TextButton(
|
||||
child: Text(
|
||||
|
@ -179,7 +179,7 @@ class BackupSectionWidgetState extends State<BackupSectionWidget> {
|
|||
// TODO: Replace with https://pub.dev/packages/in_app_review
|
||||
if (Platform.isAndroid) {
|
||||
launch(
|
||||
"https://play.google.com/store/apps/details?id=io.ente.photos");
|
||||
"https://play.google.com/store/apps/details?id=io.ente.photos",);
|
||||
} else {
|
||||
launch("https://apps.apple.com/in/app/ente-photos/id1542026904");
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ class BackupSectionWidgetState extends State<BackupSectionWidget> {
|
|||
onPressed: () {
|
||||
if (Platform.isIOS) {
|
||||
showToast(context,
|
||||
"Also empty \"Recently Deleted\" from \"Settings\" -> \"Storage\" to claim the freed space");
|
||||
"Also empty \"Recently Deleted\" from \"Settings\" -> \"Storage\" to claim the freed space",);
|
||||
}
|
||||
Navigator.of(context, rootNavigator: true).pop('dialog');
|
||||
},
|
||||
|
@ -223,7 +223,7 @@ class BackupSectionWidgetState extends State<BackupSectionWidget> {
|
|||
countText +
|
||||
", saving " +
|
||||
formatBytes(result.size) +
|
||||
"!"),
|
||||
"!",),
|
||||
actions: [
|
||||
TextButton(
|
||||
child: Text(
|
||||
|
@ -237,7 +237,7 @@ class BackupSectionWidgetState extends State<BackupSectionWidget> {
|
|||
// TODO: Replace with https://pub.dev/packages/in_app_review
|
||||
if (Platform.isAndroid) {
|
||||
launch(
|
||||
"https://play.google.com/store/apps/details?id=io.ente.photos");
|
||||
"https://play.google.com/store/apps/details?id=io.ente.photos",);
|
||||
} else {
|
||||
launch("https://apps.apple.com/in/app/ente-photos/id1542026904");
|
||||
}
|
||||
|
@ -252,7 +252,7 @@ class BackupSectionWidgetState extends State<BackupSectionWidget> {
|
|||
),
|
||||
onPressed: () {
|
||||
showToast(context,
|
||||
"Also empty your \"Trash\" to claim the freed up space");
|
||||
"Also empty your \"Trash\" to claim the freed up space",);
|
||||
Navigator.of(context, rootNavigator: true).pop('dialog');
|
||||
},
|
||||
),
|
||||
|
|
|
@ -42,7 +42,7 @@ class _DangerSectionWidgetState extends State<DangerSectionWidget> {
|
|||
_onDeleteAccountTapped();
|
||||
},
|
||||
child: SettingsTextItem(
|
||||
text: "Delete account", icon: Icons.navigate_next),
|
||||
text: "Delete account", icon: Icons.navigate_next,),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
|
|
@ -35,9 +35,9 @@ class DebugSectionWidget extends StatelessWidget {
|
|||
Network.instance.getAlice().showInspector();
|
||||
},
|
||||
child: SettingsTextItem(
|
||||
text: "Network requests", icon: Icons.navigate_next),
|
||||
text: "Network requests", icon: Icons.navigate_next,),
|
||||
)
|
||||
]);
|
||||
],);
|
||||
}
|
||||
|
||||
void _showKeyAttributesDialog(BuildContext context) {
|
||||
|
@ -53,13 +53,13 @@ class DebugSectionWidget extends StatelessWidget {
|
|||
Text(keyAttributes.encryptedKey),
|
||||
Padding(padding: EdgeInsets.all(12)),
|
||||
Text("Key Decryption Nonce",
|
||||
style: TextStyle(fontWeight: FontWeight.bold)),
|
||||
style: TextStyle(fontWeight: FontWeight.bold),),
|
||||
Text(keyAttributes.keyDecryptionNonce),
|
||||
Padding(padding: EdgeInsets.all(12)),
|
||||
Text("KEK Salt", style: TextStyle(fontWeight: FontWeight.bold)),
|
||||
Text(keyAttributes.kekSalt),
|
||||
Padding(padding: EdgeInsets.all(12)),
|
||||
]),
|
||||
],),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue