Skip to content

Commit 640b247

Browse files
committed
final push
1 parent 4b0b18d commit 640b247

File tree

3 files changed

+89
-37
lines changed

3 files changed

+89
-37
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,8 @@
2020
* Minor BugFix
2121

2222
## [2.0.0] - July 10 2k20
23-
* Major BugFix
23+
* Major BugFix
24+
25+
## [2.0.1] - May 31 2k21
26+
* Migrated to null-safety
27+
* Changed the Data Classes

README.md

Lines changed: 58 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ A wrapper based on [SplitWise](http://dev.splitwise.com/#introduction)
55
- Feel free to open a PR or Issue
66
- Uses OAuth 1
77
- Data Classes Included
8+
- Based on null-safety
89

910
### Steps
1011
- Get the consumerKey and consumerSecret from [Splitwise Register App](https://secure.splitwise.com/apps)
@@ -27,25 +28,72 @@ A wrapper based on [SplitWise](http://dev.splitwise.com/#introduction)
2728
| | '-- splitwise_main.dart
2829
| |-- data
2930
| | '-- model
30-
| | |-- categories_entity.dart
31-
| | |-- categories_entity.g.dart
32-
| | |-- comments_entity.dart
33-
| | | (18 more...)
34-
| | |-- post_response.g.dart
35-
| | |-- single_user_entity.dart
36-
| | '-- single_user_entity.g.dart
31+
| | |-- CategoriesEntity
32+
| | | |-- CategoriesEntity.dart
33+
| | | |-- categories.dart
34+
| | | |-- icon_types.dart
35+
| | | |-- slim.dart
36+
| | | |-- square.dart
37+
| | | '-- subcategories.dart
38+
| | |-- CommentsEntity
39+
| | | |-- CommentsEntity.dart
40+
| | | '-- comments.dart
41+
| | |-- CurrentUserEntity
42+
| | | |-- CurrentUserEntity.dart
43+
| | | |-- notifications.dart
44+
| | | '-- picture.dart
45+
| | |-- ExpensesEntity
46+
| | | |-- ExpensesEntity.dart
47+
| | | |-- category.dart
48+
| | | |-- comments.dart
49+
| | | | (6 more...)
50+
| | | |-- updated_by.dart
51+
| | | |-- user.dart
52+
| | | '-- users.dart
53+
| | |-- FriendsEntity
54+
| | | |-- FriendsEntity.dart
55+
| | | |-- balance.dart
56+
| | | |-- friends.dart
57+
| | | |-- groups.dart
58+
| | | '-- picture.dart
59+
| | |-- GroupsEntity
60+
| | | |-- GroupsEntity.dart
61+
| | | |-- avatar.dart
62+
| | | |-- balance.dart
63+
| | | |-- cover_photo.dart
64+
| | | |-- groups.dart
65+
| | | |-- members.dart
66+
| | | |-- original_debts.dart
67+
| | | |-- picture.dart
68+
| | | '-- simplified_debts.dart
69+
| | |-- NotificationsEntity
70+
| | | |-- NotificationsEntity.dart
71+
| | | |-- notifications.dart
72+
| | | '-- source.dart
73+
| | |-- PostExpense
74+
| | | |-- PostExpense.dart
75+
| | | |-- category.dart
76+
| | | |-- comments.dart
77+
| | | | (7 more...)
78+
| | | |-- updated_by.dart
79+
| | | |-- user.dart
80+
| | | '-- users.dart
81+
| | |-- PostResponse
82+
| | | |-- post_response.dart
83+
| | | '-- post_response.g.dart
84+
| | '-- SingleUserEntity
85+
| | |-- SingleUserEntity.dart
86+
| | '-- picture.dart
3787
| '-- helper
3888
| '-- TokensHelper.dart
3989
'-- pubspec.yaml
4090
41-
42-
4391
```
4492
#### Usage
4593
- Import the package
4694
```yaml
4795
dependencies:
48-
splitwise_api: ^2.0.0
96+
splitwise_api: ^2.0.1
4997
```
5098
- Import in the file
5199

example/example.dart

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
// import 'package:splitwise_api/splitwise_api.dart';
2-
// import 'package:splitwise_api/src/util/data/model/current_user_entity.dart';
1+
import 'package:splitwise_api/splitwise_api.dart';
2+
import 'package:splitwise_api/src/util/data/model/current_user_entity.dart';
33

44

5-
// void main() async {
6-
// SplitWiseService splitWiseService =
7-
// SplitWiseService.initialize(_consumerKey, _consumerSecret);
8-
//
9-
// /// SplitWiseHelper is for saving and retrieving from shared storage
10-
// SplitWiseHelper splitWiseHelper = SplitWiseHelper();
11-
// if (splitWiseHelper.getTokens() == null) {
12-
// var authURL = splitWiseService.validateClient();
13-
// print(authURL);
14-
// //This Will print the token and also return them save them to Shared Prefs
15-
// TokensHelper tokens = await splitWiseService.validateClient(
16-
// verifier: 'theTokenYouGetAfterAuthorization');
17-
// await splitWiseHelper.saveTokens(tokens);
18-
//
19-
// splitWiseService.validateClient(tokens: tokens);
20-
// } else {
21-
// splitWiseService.validateClient(
22-
// tokens: /* tokens from saved */);
23-
// //Example
24-
// CurrentUserEntity currentUserEntity = await splitWiseService
25-
// .getCurrentUser();
26-
// print(currentUserEntity.user.firstName);
27-
// }
28-
// }
5+
void main() async {
6+
SplitWiseService splitWiseService =
7+
SplitWiseService.initialize(_consumerKey, _consumerSecret);
8+
9+
/// SplitWiseHelper is for saving and retrieving from shared storage
10+
SplitWiseHelper splitWiseHelper = SplitWiseHelper();
11+
if (splitWiseHelper.getTokens() == null) {
12+
var authURL = splitWiseService.validateClient();
13+
print(authURL);
14+
//This Will print the token and also return them save them to Shared Prefs
15+
TokensHelper tokens = await splitWiseService.validateClient(
16+
verifier: 'theTokenYouGetAfterAuthorization');
17+
await splitWiseHelper.saveTokens(tokens);
18+
19+
splitWiseService.validateClient(tokens: tokens);
20+
} else {
21+
splitWiseService.validateClient(
22+
tokens: /* tokens from saved */);
23+
//Example
24+
CurrentUserEntity currentUserEntity = await splitWiseService
25+
.getCurrentUser();
26+
print(currentUserEntity.user.firstName);
27+
}
28+
}

0 commit comments

Comments
 (0)