simplify: dedupe boilerplate and remove dead code across all layers
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
class PendingShare {
|
||||
final List<String> filePaths;
|
||||
final String? text;
|
||||
@@ -17,12 +19,6 @@ class PendingShare {
|
||||
/// fires two `open(url)` requests per share (see ShareViewController), so
|
||||
/// the same share can arrive twice on the media stream — receivedAt is
|
||||
/// deliberately ignored here so such duplicates compare equal.
|
||||
bool contentEquals(PendingShare other) {
|
||||
if (text != other.text) return false;
|
||||
if (filePaths.length != other.filePaths.length) return false;
|
||||
for (var i = 0; i < filePaths.length; i++) {
|
||||
if (filePaths[i] != other.filePaths[i]) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
bool contentEquals(PendingShare other) =>
|
||||
text == other.text && listEquals(filePaths, other.filePaths);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user