From 49e2a00be24e369f56a89f6def8c7115517ca3c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=90=A7=E7=8E=89?= Date: Thu, 1 Aug 2019 15:58:23 +0800 Subject: [PATCH] ParseFile should NOT extends ParseObject. --- lib/src/objects/parse_base.dart | 2 +- lib/src/objects/parse_file.dart | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/src/objects/parse_base.dart b/lib/src/objects/parse_base.dart index ccb9e72a5..78a4a7205 100644 --- a/lib/src/objects/parse_base.dart +++ b/lib/src/objects/parse_base.dart @@ -23,7 +23,7 @@ abstract class ParseBase { } bool _isDirty(bool considerChildren) { - if (_dirty || _unsavedChanges.isNotEmpty) { + if (_dirty || _unsavedChanges.isNotEmpty || objectId == null) { return true; } diff --git a/lib/src/objects/parse_file.dart b/lib/src/objects/parse_file.dart index 7bef32891..9fa117fd8 100644 --- a/lib/src/objects/parse_file.dart +++ b/lib/src/objects/parse_file.dart @@ -1,6 +1,6 @@ part of flutter_parse_sdk; -class ParseFile extends ParseObject { +class ParseFile extends ParseBase { /// Creates a new file /// /// {https://docs.parseplatform.org/rest/guide/#files/} @@ -9,8 +9,7 @@ class ParseFile extends ParseObject { String url, bool debug, ParseHTTPClient client, - bool autoSendSessionId}) - : super(keyFile) { + bool autoSendSessionId}) { _debug = isDebugEnabled(objectLevelDebug: debug); _client = client ?? ParseHTTPClient( @@ -27,6 +26,9 @@ class ParseFile extends ParseObject { } } + bool _debug; + ParseHTTPClient _client; + File file; String get name => super.get(keyVarName);