splitwise_api 2.0.3 copy "splitwise_api: ^2.0.3" to clipboard
splitwise_api: ^2.0.3 copied to clipboard

A Wrapper over SplitWise API. * Uses OAuth 1 as Authentication. * Includes all methods stated on SplitWise DEV website.

example/example.dart

// import 'package:splitwise_api/splitwise_api.dart';
// import 'package:splitwise_api/src/util/data/model/current_user_entity.dart';
//
//
// void main() async {
//   SplitWiseService splitWiseService =
//   SplitWiseService.initialize(_consumerKey, _consumerSecret);
//
//   /// SplitWiseHelper is for saving and retrieving from shared storage
//   SplitWiseHelper splitWiseHelper = SplitWiseHelper();
//   if (splitWiseHelper.getTokens() == null) {
//     var authURL = splitWiseService.validateClient();
//     print(authURL);
//     //This Will print the token and also return them save them to Shared Prefs
//     TokensHelper tokens = await splitWiseService.validateClient(
//         verifier: 'theTokenYouGetAfterAuthorization');
//     await splitWiseHelper.saveTokens(tokens);
//
//     splitWiseService.validateClient(tokens: tokens);
//   } else {
//     splitWiseService.validateClient(
//         tokens: /* tokens from saved */);
//     //Example
//     CurrentUserEntity currentUserEntity = await splitWiseService
//         .getCurrentUser();
//     print(currentUserEntity.user.firstName);
//   }
// }
1
likes
125
pub points
0%
popularity

Publisher

unverified uploader

A Wrapper over SplitWise API. * Uses OAuth 1 as Authentication. * Includes all methods stated on SplitWise DEV website.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

json_annotation, json_serializable, oauth1

More

Packages that depend on splitwise_api