From ddc25c66906b6abd5abe7f961b49f6d67abca9c8 Mon Sep 17 00:00:00 2001 From: Phill Date: Mon, 7 Jan 2019 19:03:11 +0000 Subject: [PATCH] Version 0.4 for release --- .idea/workspace.xml | 439 +++++++++---------- CHANGELOG.md | 4 + README.md | 2 +- example/lib/diet_plan.dart | 2 +- example/lib/main.dart | 4 - lib/enums/parse_enum_function_call.dart | 11 - lib/enums/parse_enum_object_call.dart | 26 -- lib/enums/parse_enum_user_call.dart | 32 -- lib/parse.dart | 33 +- lib/{ => src}/base/parse_constants.dart | 2 + lib/{ => src}/data/parse_data.dart | 2 + lib/{ => src}/data/parse_data_objects.dart | 2 +- lib/{ => src}/data/parse_data_server.dart | 2 + lib/{ => src}/data/parse_data_user.dart | 4 +- lib/src/enums/parse_enum_function_call.dart | 14 + lib/src/enums/parse_enum_object_call.dart | 34 ++ lib/src/enums/parse_enum_user_call.dart | 51 +++ lib/{ => src}/network/parse_http_client.dart | 10 +- lib/{ => src}/network/parse_livequery.dart | 5 +- lib/{ => src}/network/parse_query.dart | 6 +- lib/{ => src}/objects/parse_base.dart | 4 +- lib/{ => src}/objects/parse_exception.dart | 2 +- lib/{ => src}/objects/parse_function.dart | 12 +- lib/{ => src}/objects/parse_object.dart | 16 +- lib/{ => src}/objects/parse_response.dart | 8 +- lib/{ => src}/objects/parse_user.dart | 15 +- lib/src/utils/parse_utils_date.dart | 18 + lib/{ => src}/utils/parse_utils_objects.dart | 4 +- lib/utils/parse_utils_date.dart | 20 - lib/utils/parse_utils_network.dart | 5 - pubspec.yaml | 4 +- 31 files changed, 398 insertions(+), 395 deletions(-) delete mode 100644 lib/enums/parse_enum_function_call.dart delete mode 100644 lib/enums/parse_enum_object_call.dart delete mode 100644 lib/enums/parse_enum_user_call.dart rename lib/{ => src}/base/parse_constants.dart (93%) rename lib/{ => src}/data/parse_data.dart (96%) rename lib/{ => src}/data/parse_data_objects.dart (85%) rename lib/{ => src}/data/parse_data_server.dart (97%) rename lib/{ => src}/data/parse_data_user.dart (90%) create mode 100644 lib/src/enums/parse_enum_function_call.dart create mode 100644 lib/src/enums/parse_enum_object_call.dart create mode 100644 lib/src/enums/parse_enum_user_call.dart rename lib/{ => src}/network/parse_http_client.dart (65%) rename lib/{ => src}/network/parse_livequery.dart (89%) rename lib/{ => src}/network/parse_query.dart (98%) rename lib/{ => src}/objects/parse_base.dart (95%) rename lib/{ => src}/objects/parse_exception.dart (66%) rename lib/{ => src}/objects/parse_function.dart (83%) rename lib/{ => src}/objects/parse_object.dart (85%) rename lib/{ => src}/objects/parse_response.dart (86%) rename lib/{ => src}/objects/parse_user.dart (92%) create mode 100644 lib/src/utils/parse_utils_date.dart rename lib/{ => src}/utils/parse_utils_objects.dart (67%) delete mode 100644 lib/utils/parse_utils_date.dart delete mode 100644 lib/utils/parse_utils_network.dart diff --git a/.idea/workspace.xml b/.idea/workspace.xml index a6520a292..3a6414019 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,25 +7,32 @@ - - - - - - - - - + - - - + + + + + + + + + + + + + + + + + - - + + + @@ -38,123 +45,88 @@ - - + + - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + User() + import + + + part + + - @@ -178,48 +150,54 @@ - + + + + + + + @@ -255,6 +233,9 @@ + + + @@ -345,15 +326,23 @@ - + - + @@ -363,16 +352,16 @@ - + - - + + - + @@ -389,244 +378,242 @@ + + + - - - file://$PROJECT_DIR$/lib/objects/parse_object.dart - 76 - - - + - - - - + + - + - + + + - + - - - - - + + + + + + + - + - - + + - + - - - - - + + + + + + + - + - - - - - + + - + - + - + - + + + - + - + + + - + - + + + - + - - - - - + + - + - + + + - + - - + + - + - - - - - + + - + - - + + - + - - + + - + - + + + - + - - - - - + + - + - - + + - + - - + + - + - - - - - + + - + - - - - - + + - + - - + + - + - - + + - - + + - + - + - - + + - + - + - - + + + + + - + - - - - - + + - + - - - - - + + + + + + + + + diff --git a/CHANGELOG.md b/CHANGELOG.md index 60a981fd4..1daa7cb3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.4 + +Added description + ## 0.0.3 Added more cloud functions diff --git a/README.md b/README.md index 10e612a12..969cc9211 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Want to get involved? Join our Slack channel and help out! (http://flutter-parse To install, either add to your pubspec.yaml ``` dependencies: - parse_server_sdk: ^0.0.2 + parse_server_sdk: ^0.0.4 ``` or clone this repository and add to your project. As this is an early development with multiple contributors, it is probably best to download/clone and keep updating as an when a new feature is added. diff --git a/example/lib/diet_plan.dart b/example/lib/diet_plan.dart index fa83e128b..116d9636d 100644 --- a/example/lib/diet_plan.dart +++ b/example/lib/diet_plan.dart @@ -1,6 +1,6 @@ import 'dart:core'; -import 'package:parse_server_sdk/objects/parse_object.dart'; +import 'package:parse_server_sdk/parse.dart'; class DietPlan extends ParseObject { DietPlan() : super(DIET_PLAN); diff --git a/example/lib/main.dart b/example/lib/main.dart index 5ff422be2..5f7ba88dd 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,10 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_plugin_example/application_constants.dart'; import 'package:flutter_plugin_example/diet_plan.dart'; -import 'package:parse_server_sdk/network/parse_query.dart'; -import 'package:parse_server_sdk/objects/parse_function.dart'; -import 'package:parse_server_sdk/objects/parse_object.dart'; -import 'package:parse_server_sdk/objects/parse_user.dart'; import 'package:parse_server_sdk/parse.dart'; void main() => runApp(new MyApp()); diff --git a/lib/enums/parse_enum_function_call.dart b/lib/enums/parse_enum_function_call.dart deleted file mode 100644 index 86c2b845c..000000000 --- a/lib/enums/parse_enum_function_call.dart +++ /dev/null @@ -1,11 +0,0 @@ -enum ParseApiFunctionCallType { - execute -} - -getEnumValue(ParseApiFunctionCallType type){ - switch (type){ - case ParseApiFunctionCallType.execute: { - return 'execure'; - } - } -} \ No newline at end of file diff --git a/lib/enums/parse_enum_object_call.dart b/lib/enums/parse_enum_object_call.dart deleted file mode 100644 index c57044a59..000000000 --- a/lib/enums/parse_enum_object_call.dart +++ /dev/null @@ -1,26 +0,0 @@ -enum ParseApiObjectCallType { - get, getAll, create, save, query, delete -} - -getEnumValue(ParseApiObjectCallType type){ - switch (type){ - case ParseApiObjectCallType.get: { - return 'get'; - } - case ParseApiObjectCallType.getAll: { - return 'getAll'; - } - case ParseApiObjectCallType.create: { - return 'create'; - } - case ParseApiObjectCallType.save: { - return 'save'; - } - case ParseApiObjectCallType.query: { - return 'query'; - } - case ParseApiObjectCallType.delete: { - return 'delete'; - } - } -} \ No newline at end of file diff --git a/lib/enums/parse_enum_user_call.dart b/lib/enums/parse_enum_user_call.dart deleted file mode 100644 index 9d9c5dbf4..000000000 --- a/lib/enums/parse_enum_user_call.dart +++ /dev/null @@ -1,32 +0,0 @@ -enum ParseApiUserCallType { - currentUser, signUp, login, verificationEmailRequest, requestPasswordReset, save, destroy, all -} - -getEnumValue(ParseApiUserCallType type){ - switch (type){ - case ParseApiUserCallType.currentUser: { - return 'currentUser'; - } - case ParseApiUserCallType.signUp: { - return 'signUp'; - } - case ParseApiUserCallType.login: { - return 'login'; - } - case ParseApiUserCallType.verificationEmailRequest: { - return 'verificationEmailRequest'; - } - case ParseApiUserCallType.requestPasswordReset: { - return 'requestPasswordReset'; - } - case ParseApiUserCallType.save: { - return 'save'; - } - case ParseApiUserCallType.destroy: { - return 'destroy'; - } - case ParseApiUserCallType.all: { - return 'all'; - } - } -} \ No newline at end of file diff --git a/lib/parse.dart b/lib/parse.dart index b1d9a87d2..0e1881968 100644 --- a/lib/parse.dart +++ b/lib/parse.dart @@ -1,5 +1,34 @@ -import 'package:parse_server_sdk/data/parse_data_server.dart'; -import 'package:parse_server_sdk/network/parse_http_client.dart'; +library flutter_parse_sdk; + +import 'dart:async'; +import 'dart:convert'; +import 'dart:io'; + +import 'package:http/http.dart'; +import 'package:intl/intl.dart'; +import 'package:meta/meta.dart'; +import 'package:web_socket_channel/io.dart'; + +part 'src/base/parse_constants.dart'; +part 'src/data/parse_data.dart'; +part 'src/data/parse_data_objects.dart'; +part 'src/data/parse_data_server.dart'; +part 'src/data/parse_data_user.dart'; +part 'src/enums/parse_enum_function_call.dart'; +part 'src/enums/parse_enum_object_call.dart'; +part 'src/enums/parse_enum_user_call.dart'; +part 'src/network/parse_http_client.dart'; +part 'src/network/parse_livequery.dart'; +part 'src/network/parse_query.dart'; +part 'src/objects/parse_base.dart'; +part 'src/objects/parse_exception.dart'; +part 'src/objects/parse_function.dart'; +part 'src/objects/parse_object.dart'; +part 'src/objects/parse_response.dart'; +part 'src/objects/parse_user.dart'; + +part 'src/utils/parse_utils_date.dart'; +part 'src/utils/parse_utils_objects.dart'; class Parse { ParseDataServer data; diff --git a/lib/base/parse_constants.dart b/lib/src/base/parse_constants.dart similarity index 93% rename from lib/base/parse_constants.dart rename to lib/src/base/parse_constants.dart index 40052d27b..d873cfe1f 100644 --- a/lib/base/parse_constants.dart +++ b/lib/src/base/parse_constants.dart @@ -1,3 +1,5 @@ +part of flutter_parse_sdk; + class ParseConstants { static const String PARSE_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm"; diff --git a/lib/data/parse_data.dart b/lib/src/data/parse_data.dart similarity index 96% rename from lib/data/parse_data.dart rename to lib/src/data/parse_data.dart index 66bf62da1..5f6a6d15c 100644 --- a/lib/data/parse_data.dart +++ b/lib/src/data/parse_data.dart @@ -1,3 +1,5 @@ +part of flutter_parse_sdk; + class ParseData { static ParseData _instance; diff --git a/lib/data/parse_data_objects.dart b/lib/src/data/parse_data_objects.dart similarity index 85% rename from lib/data/parse_data_objects.dart rename to lib/src/data/parse_data_objects.dart index 7b804c193..3a23cc43b 100644 --- a/lib/data/parse_data_objects.dart +++ b/lib/src/data/parse_data_objects.dart @@ -1,4 +1,4 @@ -import 'package:parse_server_sdk/objects/parse_object.dart'; +part of flutter_parse_sdk; class ParseDataObjects { static ParseDataObjects _instance; diff --git a/lib/data/parse_data_server.dart b/lib/src/data/parse_data_server.dart similarity index 97% rename from lib/data/parse_data_server.dart rename to lib/src/data/parse_data_server.dart index 2fcae8889..25785e206 100644 --- a/lib/data/parse_data_server.dart +++ b/lib/src/data/parse_data_server.dart @@ -1,3 +1,5 @@ +part of flutter_parse_sdk; + class ParseDataServer { static ParseDataServer _instance; static ParseDataServer get instance => _instance; diff --git a/lib/data/parse_data_user.dart b/lib/src/data/parse_data_user.dart similarity index 90% rename from lib/data/parse_data_user.dart rename to lib/src/data/parse_data_user.dart index c30f74047..8724e7f2d 100644 --- a/lib/data/parse_data_user.dart +++ b/lib/src/data/parse_data_user.dart @@ -1,6 +1,4 @@ -import 'package:parse_server_sdk/base/parse_constants.dart'; -import 'package:parse_server_sdk/objects/parse_base.dart'; -import 'package:parse_server_sdk/utils/parse_utils_date.dart'; +part of flutter_parse_sdk; class User extends ParseBase { static User _instance; diff --git a/lib/src/enums/parse_enum_function_call.dart b/lib/src/enums/parse_enum_function_call.dart new file mode 100644 index 000000000..75926f272 --- /dev/null +++ b/lib/src/enums/parse_enum_function_call.dart @@ -0,0 +1,14 @@ +part of flutter_parse_sdk; + +enum ParseApiFunctionCallType { execute } + +class ParseApiFunctionCallTypeUtil { + static getEnumValue(ParseApiFunctionCallType type) { + switch (type) { + case ParseApiFunctionCallType.execute: + { + return 'execure'; + } + } + } +} diff --git a/lib/src/enums/parse_enum_object_call.dart b/lib/src/enums/parse_enum_object_call.dart new file mode 100644 index 000000000..778580a50 --- /dev/null +++ b/lib/src/enums/parse_enum_object_call.dart @@ -0,0 +1,34 @@ +part of flutter_parse_sdk; + +enum ParseApiObjectCallType { get, getAll, create, save, query, delete } + +class ParseApiObjectCallTypeUtil { + static getEnumValue(ParseApiObjectCallType type) { + switch (type) { + case ParseApiObjectCallType.get: + { + return 'get'; + } + case ParseApiObjectCallType.getAll: + { + return 'getAll'; + } + case ParseApiObjectCallType.create: + { + return 'create'; + } + case ParseApiObjectCallType.save: + { + return 'save'; + } + case ParseApiObjectCallType.query: + { + return 'query'; + } + case ParseApiObjectCallType.delete: + { + return 'delete'; + } + } + } +} diff --git a/lib/src/enums/parse_enum_user_call.dart b/lib/src/enums/parse_enum_user_call.dart new file mode 100644 index 000000000..db79726a4 --- /dev/null +++ b/lib/src/enums/parse_enum_user_call.dart @@ -0,0 +1,51 @@ +part of flutter_parse_sdk; + +enum ParseApiUserCallType { + currentUser, + signUp, + login, + verificationEmailRequest, + requestPasswordReset, + save, + destroy, + all +} + +class ParseApiUserCallTypeUtils { + static getEnumValue(ParseApiUserCallType type) { + switch (type) { + case ParseApiUserCallType.currentUser: + { + return 'currentUser'; + } + case ParseApiUserCallType.signUp: + { + return 'signUp'; + } + case ParseApiUserCallType.login: + { + return 'login'; + } + case ParseApiUserCallType.verificationEmailRequest: + { + return 'verificationEmailRequest'; + } + case ParseApiUserCallType.requestPasswordReset: + { + return 'requestPasswordReset'; + } + case ParseApiUserCallType.save: + { + return 'save'; + } + case ParseApiUserCallType.destroy: + { + return 'destroy'; + } + case ParseApiUserCallType.all: + { + return 'all'; + } + } + } +} diff --git a/lib/network/parse_http_client.dart b/lib/src/network/parse_http_client.dart similarity index 65% rename from lib/network/parse_http_client.dart rename to lib/src/network/parse_http_client.dart index d5427ea75..839ef2649 100644 --- a/lib/network/parse_http_client.dart +++ b/lib/src/network/parse_http_client.dart @@ -1,11 +1,7 @@ -import 'dart:async'; +part of flutter_parse_sdk; -import 'package:http/http.dart' as http; -import 'package:http/http.dart'; -import 'package:parse_server_sdk/data/parse_data_server.dart'; - -class ParseHTTPClient extends http.BaseClient { - final http.Client _client = new http.Client(); +class ParseHTTPClient extends BaseClient { + final Client _client = new Client(); final String _userAgent = "Dart Parse SDK 0.1"; ParseDataServer data = ParseDataServer(); diff --git a/lib/network/parse_livequery.dart b/lib/src/network/parse_livequery.dart similarity index 89% rename from lib/network/parse_livequery.dart rename to lib/src/network/parse_livequery.dart index 99219ae33..ded028e95 100644 --- a/lib/network/parse_livequery.dart +++ b/lib/src/network/parse_livequery.dart @@ -1,7 +1,4 @@ -import "dart:convert"; -import 'package:web_socket_channel/io.dart'; -import 'package:parse_server_sdk/network/parse_http_client.dart'; -import 'dart:io'; +part of flutter_parse_sdk; class LiveQuery { final ParseHTTPClient client; diff --git a/lib/network/parse_query.dart b/lib/src/network/parse_query.dart similarity index 98% rename from lib/network/parse_query.dart rename to lib/src/network/parse_query.dart index 633841b3c..caa2172b8 100644 --- a/lib/network/parse_query.dart +++ b/lib/src/network/parse_query.dart @@ -1,6 +1,4 @@ -import 'dart:convert'; - -import 'package:parse_server_sdk/objects/parse_object.dart'; +part of flutter_parse_sdk; class QueryBuilder { @@ -276,7 +274,7 @@ class QueryBuilder { } convertValueToCorrectType(dynamic value) { - if (value is int) return (value as num); + if (value is num) return value; if (value is String) return "\"$value\""; } } diff --git a/lib/objects/parse_base.dart b/lib/src/objects/parse_base.dart similarity index 95% rename from lib/objects/parse_base.dart rename to lib/src/objects/parse_base.dart index b715e1011..338e782b8 100644 --- a/lib/objects/parse_base.dart +++ b/lib/src/objects/parse_base.dart @@ -1,6 +1,4 @@ -import 'dart:convert'; - -import 'package:meta/meta.dart'; +part of flutter_parse_sdk; abstract class ParseBase { Map _objectData; diff --git a/lib/objects/parse_exception.dart b/lib/src/objects/parse_exception.dart similarity index 66% rename from lib/objects/parse_exception.dart rename to lib/src/objects/parse_exception.dart index 6921b5a5f..9b383aeff 100644 --- a/lib/objects/parse_exception.dart +++ b/lib/src/objects/parse_exception.dart @@ -1,4 +1,4 @@ -import 'package:http/http.dart'; +part of flutter_parse_sdk; class ParseException { diff --git a/lib/objects/parse_function.dart b/lib/src/objects/parse_function.dart similarity index 83% rename from lib/objects/parse_function.dart rename to lib/src/objects/parse_function.dart index ecd9d9c7d..9df200fb3 100644 --- a/lib/objects/parse_function.dart +++ b/lib/src/objects/parse_function.dart @@ -1,10 +1,4 @@ -import 'dart:convert'; - -import 'package:http/http.dart'; -import 'package:parse_server_sdk/enums/parse_enum_function_call.dart'; -import 'package:parse_server_sdk/network/parse_http_client.dart'; -import 'package:parse_server_sdk/objects/parse_base.dart'; -import 'package:parse_server_sdk/objects/parse_response.dart'; +part of flutter_parse_sdk; class ParseCloudFunction extends ParseBase { final String functionName; @@ -17,7 +11,7 @@ class ParseCloudFunction extends ParseBase { client == null ? _client = ParseHTTPClient() : _client = client; if (_debug == null) { - _client.data.debug != null ? _debug = _client.data.debug : false; + _client.data.debug != null ? _debug = _client.data.debug : _debug = false; } else { _debug = _debug; } @@ -41,7 +35,7 @@ class ParseCloudFunction extends ParseBase { var responseString = ' \n'; responseString += "----" - "\n${_client.data.appName} API Response ($functionName : ${getEnumValue(type)}) :"; + "\n${_client.data.appName} API Response ($functionName : ${ParseApiFunctionCallTypeUtil.getEnumValue(type)}) :"; if (parseResponse.success && parseResponse.result != null) { responseString += "\nStatus Code: ${parseResponse.statusCode}"; diff --git a/lib/objects/parse_object.dart b/lib/src/objects/parse_object.dart similarity index 85% rename from lib/objects/parse_object.dart rename to lib/src/objects/parse_object.dart index 14beacff2..27c419232 100644 --- a/lib/objects/parse_object.dart +++ b/lib/src/objects/parse_object.dart @@ -1,11 +1,4 @@ -import 'dart:convert'; - -import 'package:http/http.dart'; -import 'package:meta/meta.dart'; -import 'package:parse_server_sdk/enums/parse_enum_object_call.dart'; -import 'package:parse_server_sdk/network/parse_http_client.dart'; -import 'package:parse_server_sdk/objects/parse_base.dart'; -import 'package:parse_server_sdk/objects/parse_response.dart'; +part of flutter_parse_sdk; class ParseObject extends ParseBase { final String className; @@ -13,12 +6,12 @@ class ParseObject extends ParseBase { bool _debug; ParseHTTPClient _client; - ParseObject(this.className, {bool debug, ParseHTTPClient client}) { + ParseObject(this.className, {bool debug: false, ParseHTTPClient client}) { client == null ? _client = ParseHTTPClient() : _client = client; if (_debug == null) { - _client.data.debug != null ? _debug = _client.data.debug : false; + _client.data.debug != null ? _debug = _client.data.debug : _debug = false; } else { _debug = _debug; } @@ -57,7 +50,6 @@ class ParseObject extends ParseBase { } } - @protected query(String query) async { var uri = "${_getBasePath(_path)}?$query"; var result = await _client.get(uri); @@ -80,7 +72,7 @@ class ParseObject extends ParseBase { var responseString = ' \n'; responseString += "----" - "\n${_client.data.appName} API Response ($className : ${getEnumValue(type)}) :"; + "\n${_client.data.appName} API Response ($className : ${ParseApiObjectCallTypeUtil.getEnumValue(type)}) :"; if (parseResponse.success && parseResponse.result != null) { responseString += "\nStatus Code: ${parseResponse.statusCode}"; diff --git a/lib/objects/parse_response.dart b/lib/src/objects/parse_response.dart similarity index 86% rename from lib/objects/parse_response.dart rename to lib/src/objects/parse_response.dart index 04f8fedc8..be6ed156f 100644 --- a/lib/objects/parse_response.dart +++ b/lib/src/objects/parse_response.dart @@ -1,10 +1,4 @@ -import 'dart:convert'; - -import 'package:http/http.dart'; -import 'package:parse_server_sdk/objects/parse_base.dart'; -import 'package:parse_server_sdk/objects/parse_exception.dart'; -import 'package:parse_server_sdk/objects/parse_object.dart'; -import 'package:parse_server_sdk/utils/parse_utils_objects.dart'; +part of flutter_parse_sdk; class ParseResponse { bool success = false; diff --git a/lib/objects/parse_user.dart b/lib/src/objects/parse_user.dart similarity index 92% rename from lib/objects/parse_user.dart rename to lib/src/objects/parse_user.dart index d389f42f4..fe088eaad 100644 --- a/lib/objects/parse_user.dart +++ b/lib/src/objects/parse_user.dart @@ -1,10 +1,4 @@ -import 'dart:convert'; - -import 'package:http/http.dart'; -import 'package:parse_server_sdk/base/parse_constants.dart'; -import 'package:parse_server_sdk/data/parse_data_user.dart'; -import 'package:parse_server_sdk/enums/parse_enum_user_call.dart'; -import 'package:parse_server_sdk/network/parse_http_client.dart'; +part of flutter_parse_sdk; class ParseUser { ParseHTTPClient _client; @@ -16,7 +10,7 @@ class ParseUser { client != null ? _client = client : _client = ParseHTTPClient(); if (_debug == null) { - _client.data.debug != null ? _debug = _client.data.debug : false; + _client.data.debug != null ? _debug = _client.data.debug : _debug = false; } else { _debug = _debug; } @@ -33,10 +27,9 @@ class ParseUser { } else if (fromServer == false) { return User.instance; } else { - Uri tempUri = Uri.parse(_client.data.serverUrl); - Uri uri= Uri( + Uri uri = Uri( scheme: tempUri.scheme, host: tempUri.host, path: "${tempUri.path}/users/me"); @@ -140,7 +133,7 @@ class ParseUser { var responseString = ' \n'; responseString += "----" - "\n${_client.data.appName} API Response ($className : ${getEnumValue(type)}) :"; + "\n${_client.data.appName} API Response ($className : ${ParseApiUserCallTypeUtils.getEnumValue(type)}) :"; if (response.statusCode == 200 || response.statusCode == 201) { responseString += "\nStatus Code: ${response.statusCode}"; diff --git a/lib/src/utils/parse_utils_date.dart b/lib/src/utils/parse_utils_date.dart new file mode 100644 index 000000000..be8f6cc0d --- /dev/null +++ b/lib/src/utils/parse_utils_date.dart @@ -0,0 +1,18 @@ +part of flutter_parse_sdk; + +DateTime convertStringToDateTime(String date) { + if (date == null) return null; + + var formatter = DateFormat(ParseConstants.PARSE_DATE_FORMAT); + var dateToReturn = formatter.parse(_removeTimeZones(date)); + return dateToReturn; +} + +String _removeTimeZones(String date) { + // TODO - library doesn't support timezones. Monitor this + if (date.contains('zzzZ')) { + return date.replaceRange(date.length - 4, date.length, ''); + } else { + return date; + } +} diff --git a/lib/utils/parse_utils_objects.dart b/lib/src/utils/parse_utils_objects.dart similarity index 67% rename from lib/utils/parse_utils_objects.dart rename to lib/src/utils/parse_utils_objects.dart index 6a143a202..799d0bb38 100644 --- a/lib/utils/parse_utils_objects.dart +++ b/lib/src/utils/parse_utils_objects.dart @@ -1,6 +1,4 @@ -import 'package:parse_server_sdk/base/parse_constants.dart'; -import 'package:parse_server_sdk/objects/parse_object.dart'; -import 'package:parse_server_sdk/utils/parse_utils_date.dart'; +part of flutter_parse_sdk; populateObjectBaseData(ParseObject object, Map objectData) { object.set(ParseConstants.OBJECT_ID, objectData[ParseConstants.OBJECT_ID]); diff --git a/lib/utils/parse_utils_date.dart b/lib/utils/parse_utils_date.dart deleted file mode 100644 index be4d85824..000000000 --- a/lib/utils/parse_utils_date.dart +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:parse_server_sdk/base/parse_constants.dart'; -import 'package:intl/intl.dart'; - - DateTime convertStringToDateTime(String date) { - if (date == null) return null; - - var formatter = DateFormat(ParseConstants.PARSE_DATE_FORMAT); - var dateToReturn = formatter.parse(_removeTimeZones(date)); - return dateToReturn; - } - - String _removeTimeZones(String date) { - // TODO - library doesn't support timezones. Monitor this - if (date.contains('zzzZ')) { - return date.replaceRange(date.length - 4, date.length, ''); - } else { - return date; - } - } - diff --git a/lib/utils/parse_utils_network.dart b/lib/utils/parse_utils_network.dart deleted file mode 100644 index b494ae8ed..000000000 --- a/lib/utils/parse_utils_network.dart +++ /dev/null @@ -1,5 +0,0 @@ -import 'package:parse_server_sdk/base/parse_constants.dart'; - -class ParseUtilsDates { - -} diff --git a/pubspec.yaml b/pubspec.yaml index c0442a4f0..b0def5fac 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: parse_server_sdk -description: A Flutter Parse Server SDK -version: 0.0.3 +description: This is a Flutter plugin that allows communication with a Parse Server, (https://parseplatform.org) either hosted on your own server or another, like (http://Back4App.com). The plugin has lots of functionalitiy, please check the README for more info. +version: 0.0.4 homepage: https://github.com/phillwiggins/flutter_parse_sdk author: PhillWiggins