Skip to content

Commit c81313f

Browse files
committed
Lint/Code clean
1 parent 97905a9 commit c81313f

32 files changed

+205
-153
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 1.0.22
2+
13
## 1.0.21
24
LiveQuery fix
35
Logout fix

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Want to get involved? Join our Slack channel and help out! (http://flutter-parse
1313
To install, either add to your pubspec.yaml
1414
```yml
1515
dependencies:
16-
parse_server_sdk: ^1.0.21
16+
parse_server_sdk: ^1.0.22
1717
```
1818
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.
1919

example/lib/data/repositories/user/provider_db_user.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ class UserProviderDB implements UserProviderContract {
7979

8080
Map<String, dynamic> convertItemToStorageMap(User item) {
8181
final Map<String, dynamic> values = Map<String, dynamic>();
82+
// ignore: invalid_use_of_protected_member
8283
values['value'] = json.jsonEncode(item.toJson(full: true));
8384
values[keyVarObjectId] = item.objectId;
8485
item.updatedAt != null
@@ -90,8 +91,7 @@ class UserProviderDB implements UserProviderContract {
9091
User convertRecordToItem({Record record, Map<String, dynamic> values}) {
9192
try {
9293
values ??= record.value;
93-
final User item =
94-
User.clone().fromJson(json.jsonDecode(values['value']));
94+
final User item = User.clone().fromJson(json.jsonDecode(values['value']));
9595
return item;
9696
} catch (e) {
9797
return null;

example/lib/main.dart

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ class MyApp extends StatefulWidget {
4040
class _MyAppState extends State<MyApp> {
4141
DietPlanRepository dietPlanRepo;
4242
UserRepository userRepo;
43-
String text = "";
43+
44+
String text = '';
4445

4546
@override
4647
void initState() {
@@ -64,7 +65,7 @@ class _MyAppState extends State<MyApp> {
6465

6566
Future<void> initData() async {
6667
// Initialize repository
67-
// await initRepository();
68+
await initRepository();
6869

6970
// Initialize parse
7071
Parse().initialize(keyParseApplicationId, keyParseServerUrl,
@@ -84,24 +85,29 @@ class _MyAppState extends State<MyApp> {
8485

8586
Future<void> runTestQueries() async {
8687
// Basic repository example
87-
//await repositoryAddUser();
88-
//await repositoryAddItems();
89-
//await repositoryGetAllItems();
88+
await repositoryAddUser();
89+
await repositoryAddItems();
90+
await repositoryGetAllItems();
9091

9192
//Basic usage
92-
// createItem();
93-
// getAllItems();
94-
// getAllItemsByName();
95-
// getSingleItem();
96-
// getConfigs();
97-
// query();
98-
// initUser();
99-
var instalattion = await ParseInstallation.currentInstallation();
100-
var rees = instalattion.create();
101-
print(rees);
102-
//function();
103-
//functionWithParameters();
104-
// test();
93+
await createItem();
94+
await getAllItems();
95+
await getAllItemsByName();
96+
await getSingleItem();
97+
await getConfigs();
98+
await query();
99+
await initUser();
100+
await initInstallation();
101+
await function();
102+
await functionWithParameters();
103+
await test();
104+
}
105+
106+
Future<void> initInstallation() async {
107+
final ParseInstallation installation =
108+
await ParseInstallation.currentInstallation();
109+
final ParseResponse response = await installation.create();
110+
print(response);
105111
}
106112

107113
Future<void> test() async {

example/windows/find_vcvars.dart

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@
1717
import 'dart:io';
1818

1919
int main() {
20-
final programDir = Platform.environment['PROGRAMFILES(X86)'];
21-
final pathPrefix = '$programDir\\Microsoft Visual Studio';
22-
const pathSuffix = 'VC\\Auxiliary\\Build\\vcvars64.bat';
23-
final years = ['2017', '2019'];
24-
final flavors = ['Community', 'Professional', 'Enterprise', 'Preview'];
25-
for (final year in years) {
26-
for (final flavor in flavors) {
27-
final testPath = '$pathPrefix\\$year\\$flavor\\$pathSuffix';
20+
final String programDir = Platform.environment['PROGRAMFILES(X86)'];
21+
final String pathPrefix = '$programDir\\Microsoft Visual Studio';
22+
const String pathSuffix = 'VC\\Auxiliary\\Build\\vcvars64.bat';
23+
final List<String> years = <String>['2017', '2019'];
24+
final List<String> flavors = <String>[
25+
'Community', 'Professional', 'Enterprise', 'Preview'];
26+
for (final String year in years) {
27+
for (final String flavor in flavors) {
28+
final String testPath = '$pathPrefix\\$year\\$flavor\\$pathSuffix';
2829
if (File(testPath).existsSync()) {
2930
print(testPath);
3031
return 0;

example/windows/generate_props.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
import 'dart:io';
1919

2020
void main(List<String> arguments) {
21-
final outputPath = arguments[0];
22-
final settings = {
21+
final String outputPath = arguments[0];
22+
final Map<String, String> settings = <String, String>{
2323
'FLUTTER_ROOT': arguments[1],
2424
'EXTRA_BUNDLE_FLAGS': arguments[2],
2525
};
@@ -39,16 +39,16 @@ ${getItemGroupContent(settings)}
3939
}
4040

4141
String getUserMacrosContent(Map<String, String> settings) {
42-
final macroList = StringBuffer();
43-
for (final setting in settings.entries) {
42+
final StringBuffer macroList = StringBuffer();
43+
for (final MapEntry<dynamic, dynamic> setting in settings.entries) {
4444
macroList.writeln(' <${setting.key}>${setting.value}</${setting.key}>');
4545
}
4646
return macroList.toString();
4747
}
4848

4949
String getItemGroupContent(Map<String, String> settings) {
50-
final macroList = StringBuffer();
51-
for (final name in settings.keys) {
50+
final StringBuffer macroList = StringBuffer();
51+
for (final String name in settings.keys) {
5252
macroList.writeln(''' <BuildMacro Include="$name">
5353
<Value>\$($name)</Value>
5454
<EnvironmentVariable>true</EnvironmentVariable>

lib/generated/i18n.dart

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import 'dart:async';
32

43
import 'package:flutter/foundation.dart';
@@ -13,35 +12,32 @@ class S implements WidgetsLocalizations {
1312
const S();
1413

1514
static const GeneratedLocalizationsDelegate delegate =
16-
const GeneratedLocalizationsDelegate();
15+
GeneratedLocalizationsDelegate();
1716

1817
static S of(BuildContext context) =>
1918
Localizations.of<S>(context, WidgetsLocalizations);
2019

2120
@override
2221
TextDirection get textDirection => TextDirection.ltr;
23-
2422
}
2523

2624
class en extends S {
2725
const en();
2826
}
2927

30-
31-
class GeneratedLocalizationsDelegate extends LocalizationsDelegate<WidgetsLocalizations> {
28+
class GeneratedLocalizationsDelegate
29+
extends LocalizationsDelegate<WidgetsLocalizations> {
3230
const GeneratedLocalizationsDelegate();
3331

3432
List<Locale> get supportedLocales {
3533
return const <Locale>[
36-
37-
const Locale("en", ""),
38-
34+
Locale("en", ""),
3935
];
4036
}
4137

4238
LocaleResolutionCallback resolution({Locale fallback}) {
4339
return (Locale locale, Iterable<Locale> supported) {
44-
final Locale languageLocale = new Locale(locale.languageCode, "");
40+
final Locale languageLocale = Locale(locale.languageCode, "");
4541
if (supported.contains(locale))
4642
return locale;
4743
else if (supported.contains(languageLocale))
@@ -57,12 +53,11 @@ class GeneratedLocalizationsDelegate extends LocalizationsDelegate<WidgetsLocali
5753
Future<WidgetsLocalizations> load(Locale locale) {
5854
final String lang = getLang(locale);
5955
switch (lang) {
60-
6156
case "en":
62-
return new SynchronousFuture<WidgetsLocalizations>(const en());
57+
return SynchronousFuture<WidgetsLocalizations>(const en());
6358

6459
default:
65-
return new SynchronousFuture<WidgetsLocalizations>(const S());
60+
return SynchronousFuture<WidgetsLocalizations>(const S());
6661
}
6762
}
6863

lib/parse_server_sdk.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,15 @@ class Parse {
128128
bool hasParseBeenInitialized() => _hasBeenInitialized;
129129

130130
Future<ParseResponse> healthCheck(
131-
{bool debug, ParseHTTPClient client, bool autoSendSessionId}) async {
131+
{bool debug, ParseHTTPClient client, bool sendSessionIdByDefault}) async {
132132
ParseResponse parseResponse;
133133

134134
final bool _debug = isDebugEnabled(objectLevelDebug: debug);
135+
135136
final ParseHTTPClient _client = client ??
136137
ParseHTTPClient(
137138
sendSessionId:
138-
autoSendSessionId ?? ParseCoreData().autoSendSessionId,
139+
sendSessionIdByDefault ?? ParseCoreData().autoSendSessionId,
139140
securityContext: ParseCoreData().securityContext);
140141

141142
const String className = 'parseBase';
@@ -144,7 +145,6 @@ class Parse {
144145
try {
145146
final Response response =
146147
await _client.get('${ParseCoreData().serverUrl}$keyEndPointHealth');
147-
148148
parseResponse =
149149
handleResponse<Parse>(null, response, type, _debug, className);
150150
} on Exception catch (e) {

lib/src/base/parse_constants.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
part of flutter_parse_sdk;
22

33
// Library
4-
const String keySdkVersion = '1.0.21';
4+
const String keySdkVersion = '1.0.22';
55
const String keyLibraryName = 'Flutter Parse SDK';
66

77
// End Points

lib/src/data/core_store.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ abstract class CoreStore {
1515

1616
Future<List<String>> getStringList(String key);
1717

18-
Future setBool(String key, bool value);
18+
Future<dynamic> setBool(String key, bool value);
1919

20-
Future setInt(String key, int value);
20+
Future<dynamic> setInt(String key, int value);
2121

22-
Future setDouble(String key, double value);
22+
Future<dynamic> setDouble(String key, double value);
2323

24-
Future setString(String key, String value);
24+
Future<dynamic> setString(String key, String value);
2525

26-
Future setStringList(String key, List<String> values);
26+
Future<dynamic> setStringList(String key, List<String> values);
2727

28-
Future remove(String key);
28+
Future<dynamic> remove(String key);
2929

30-
Future clear();
30+
Future<dynamic> clear();
3131
}

0 commit comments

Comments
 (0)