Fix prefer_final_locals warnings

This commit is contained in:
Neeraj Gupta 2022-11-06 14:04:06 +05:30
parent b70ad80bd8
commit 139e3c7835
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1
5 changed files with 5 additions and 4 deletions

View file

@ -55,6 +55,7 @@ analyzer:
prefer_const_constructors: warning
prefer_const_declarations: warning
prefer_const_constructors_in_immutables: warning
prefer_final_locals: warning
unnecessary_const: error
cancel_subscriptions: error

View file

@ -645,7 +645,7 @@ class FilesDB {
inParam = inParam.substring(0, inParam.length - 1);
final db = await instance.database;
final order = (asc ?? false ? 'ASC' : 'DESC');
String whereClause =
final String whereClause =
'$columnCollectionID IN ($inParam) AND $columnCreationTime >= ? AND '
'$columnCreationTime <= ? AND $columnOwnerID = ?';
final List<Object> whereArgs = [startTime, endTime, userID];

View file

@ -27,7 +27,7 @@ class HomeGalleryWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
double bottomSafeArea = MediaQuery.of(context).padding.bottom;
final double bottomSafeArea = MediaQuery.of(context).padding.bottom;
final gallery = Gallery(
asyncLoader: (creationStartTime, creationEndTime, {limit, asc}) async {
final ownerID = Configuration.instance.getUserID();

View file

@ -505,7 +505,7 @@ class FadingAppBarState extends State<FadingAppBar> {
await dialog.show();
try {
final io.File fileToSave = await getFile(file);
var m = MediaExtension();
final m = MediaExtension();
final bool result = await m.setAs("file://${fileToSave.path}", "image/*");
if (result == false) {
showShortToast(context, "Something went wrong");

View file

@ -91,7 +91,7 @@ class FadingBottomBarState extends State<FadingBottomBar> {
if (widget.file is TrashFile) {
_addTrashOptions(children);
}
bool isUploadedByUser = widget.file.uploadedFileID != null &&
final bool isUploadedByUser = widget.file.uploadedFileID != null &&
widget.file.ownerID == Configuration.instance.getUserID();
bool isFileHidden = false;
if (isUploadedByUser) {