Skip to content

update examples #205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update to 1.0.22
  • Loading branch information
unreal0 committed Jul 17, 2019
commit 0594dd6acd11a25bcdec34dfacec50bf832a0939
7 changes: 4 additions & 3 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,18 @@ class _MyAppState extends State<MyApp> with AutomaticKeepAliveClientMixin {
final CoreStore coreStore = await initCoreStore();

// Initialize parse
Parse().initialize(keyParseApplicationId, keyParseServerUrl,
await Parse().initialize(keyParseApplicationId, keyParseServerUrl,
masterKey: keyParseMasterKey,
liveQueryUrl: keyParseLiveServerUrl,
// clientKey: "XXXi3GejX3SIxpDgSbKHHV8uHUUP3QGiPPTlxxxx",
sessionId: "1212121",
autoSendSessionId: true,
debug: true);
debug: true,
coreStore: await CoreStoreSharedPrefsImp.getInstance());
// ParseHTTPClient client = ParseHTTPClient();

liveQuery = LiveQuery();

//parse serve with secure store and desktop support

// Parse().initialize(keyParseApplicationId, keyParseServerUrl,
Expand Down Expand Up @@ -525,7 +527,6 @@ class _MyAppState extends State<MyApp> with AutomaticKeepAliveClientMixin {
userRepo ??= UserRepository.init(await getDB());
}


/// Available options:
/// SharedPreferences - Not secure but will work with older versions of SDK - CoreStoreSharedPrefsImpl
/// Sembast - NoSQL DB - Has security - CoreStoreSembastImpl
Expand Down
1 change: 0 additions & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
# flutter_stetho: ^0.2.2
sembast: ^1.13.3+1
shared_preferences: ^0.5.0
json_table: ^0.3.0
Expand Down
18 changes: 15 additions & 3 deletions lib/src/objects/response/parse_response_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,22 @@ class _ParseResponseBuilder {
/// Handles a response with a single result object
T _handleSingleResult<T>(
T object, Map<String, dynamic> map, bool createNewObject) {
if (object is ParseObject) {
return object..fromJson(map);
} else if (createNewObject && object is ParseCloneable) {
if (createNewObject && object is ParseCloneable) {
return object.clone(map);
} else if (object is ParseObject) {
// Merge unsaved changes and response.
final Map<String, dynamic> unsaved = Map<String, dynamic>();
unsaved.addAll(object._unsavedChanges);
unsaved.forEach((String k, dynamic v) {
if (map[k] != null && map[k] != v) {
// Changes after save & before response. Keep it.
map.remove(k);
}
});
return object
..fromJson(map)
.._unsavedChanges.clear()
.._unsavedChanges.addAll(unsaved);
} else {
return null;
}
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.