lori_sdk 0.1.11+1

  • Readme
  • Changelog
  • Installing
  • 75

lori_sdk #

A Flutter package to access Neomode's API (LORI).

Installation #

Just follow the basic installation of any flutter plugin by adding the package to the project's pubspec.yaml.

Setting up this amazing package #

To start you need to add the initialization code inside your main file.

void main() {
  ...
  // Widget call to avoid a bug within SharedPrefences library
  WidgetsFlutterBinding.ensureInitialized();
  // SDK init
  LoriApi.init('<LORI_API_URL>', '<LORI_CLIENT_ID>', '<LORI_CLIENT_SECRET>', <LORI_CATEGORY_VERSION>, '<OS_NAME_ANDROID_WEB_IOS>', '<OS_BUILD_NAME>', '<OS_VERSION>');
  ...
}

It's crucial to add the WidgetsFlutterBinding.ensureInitialized(); before the init call, otherwise the LoriApi won't work. Remember to replace the data inside the <> with the info gathered from Neomode.

Using the API to gather information for your app #

Right now, the sdk has support for 88 endpoints from LORI's API. All methods return a Future with an ApiCallback type that can have a subtype depending on the method. Like the LoriApi().loadConfigurations() that has a return type of Future<ApiCallback. The ApiCallback is a simple class with the following structure:

class ApiCallback<T> {
  ApiCallback({this.isSuccessful, this.resultData, this.resultErrorMessage, this.error});

  bool isSuccessful;
  T resultData;
  String resultErrorMessage;
  DioError error;
}

For key classes we've Singletons that delivery a StreamSubscription that will notify listeners when the key object change. All of them are listed below:

CartSingletion().registerToStream(Function callback); // Notify when the current Cart changes.
NotificationSingleton().registerToStream(Function callback); // Notify when a new object is added, updated or removed from the notifications list.
ProductSingleton().registerToStream(Function callback); // Notify when a new object is added, updated or removed from the saw products list.
SearchTermsSingleton().registerToStream(Function callback); // Notify when a new object is added, updated or removed from the list of searched terms.
UserSingleton().registerToStream(Function callback); // Notify when the current user changes.

To better help you with all the flows and how they should work we've created some kind of flowchart that can be accessed from here.

With this said, let's go to the list of available methods inside the SDK by today:

// Log in into the API using the credentials received by the init method.
LoriApi().loginClient(); // Return a Future<ApiCallback<void>>

// Log in a specific user into the API. If log in by sms you need only to pass the smsCode parameter. After this we have a CURRENT USER on the api.
LoriApi().loginUser({String username, String password, String smsCode}); // Return a Future<ApiCallback<void>>

// Refresh the auth token that was created when log in with a specific user.
LoriApi().refreshLogin(AuthResponse authResponse); // Return a Future<ApiCallback<void>>

// Logout the CURRENT USER from the API and the SDK.
LoriApi().logoutUser(); // Return a Future<ApiCallback<void>>

// Check if the email is already registered in this clientId
LoriApi().checkEmail(String email); // Return a Future<ApiCallback<void>>

// Load the UI configurations for the clientId.
LoriApi().loadConfigurations(); // Return a Future<ApiCallback<Configurations>>

// Load the tutorial that can be presented when the user is first opening the app.
LoriApi().loadTutorial(); // Return a Future<ApiCallback<List<TutorialItem>>>

// Load a product by it's id.
LoriApi().loadProduct(String productId); // Return a Future<ApiCallback<Product>>

// Load a list of related products by one another's product id.
LoriApi().loadProductRelated(String productId); // Return a Future<ApiCallback<List<Product>>>

// Load a list of products by a specific tag.
LoriApi().loadProductsByTag(String tags, String order, int page, int perPage); // Return a Future<ApiCallback<List<Product>>>

// Load a list of categories based on the api version received at the init method.
LoriApi().loadProductCategories(); // Return a Future<ApiCallback<List<Category>>>

// Load a category by it's id.
LoriApi().loadProductCategory(String categoryId); // Return a Future<ApiCallback<Category>>

// Load a list of subcategories by it's father's category id.
LoriApi().loadProductSubcategories(String categoryId); // Return a Future<ApiCallback<List<Subcategory>>>

// Load a list of products by it's father's subcategory id.
LoriApi().loadProductsFromSubcategory(String subcategoryId, String order, int page, int perPage); // Return a Future<ApiCallback<List<Product>>>

// Load a list of products by it's father's category id.
LoriApi().loadProductsFromCategory(String categoryId, String order, int page, int perPage); // Return a Future<ApiCallback<List<Product>>>

// Load a list of the most searched terms.
LoriApi().loadProductTerms(); // Return a Future<ApiCallback<List<String>>>

// Load a list of products by a string term.
LoriApi().loadProductsByTerm(String term, String order, int page, int perPage); // Return a Future<ApiCallback<List<Product>>>

// Load a list of banners.
LoriApi().loadBanners(); // Return a Future<ApiCallback<List<Banner>>>

// Load a list of promotions.
LoriApi().loadPromotions(); // Return a Future<ApiCallback<List<Promotion>>>

// Load a list answers and questions.
LoriApi().loadFaq(); // Return a Future<ApiCallback<List<Faq>>>

// Load the user terms of the clientId.
LoriApi().loadUserTerms(); // Return a Future<ApiCallback<UserTerms>>

// Load the user terms of the clientId.
LoriApi().loadPrivacyPolicy(); // Return a Future<ApiCallback<PrivacyPolicy>>

// Load a list of evaluations from a product.
LoriApi().loadProductEvaluations(String productId); // Return a Future<ApiCallback<Evaluation>>

// Load the evaluation form that the user must fullfil to send an evaluation.
LoriApi().loadProductEvaluationForm(); // Return a Future<ApiCallback<EvaluationForm>>

// Create an evaluation for a product.
LoriApi().crateProductEvaluation(String productId, List<OpinionResponse> responses); // Return a Future<ApiCallback<void>>

// Load a wishlist for the current LOGGED USER.
LoriApi().loadWishlist(); // Return a Future<ApiCallback<List<Product>>>

// Add a product to the wishlist of the current LOGGED USER.
LoriApi().addProductWishlist(String productId); // Return a Future<ApiCallback<void>>

// Remove a product to the wishlist of the current LOGGED USER.
LoriApi().removeProductWishlist(String productId); // Return a Future<ApiCallback<void>>

// Load all the stores registered within the clientId.
LoriApi().loadStores({double latitude, double longitude, int page = 1, int perPage = 100000}) // Return a Future<ApiCallback<StoreResult>>

// Load a list of complaints of the current LOGGED USER.
LoriApi().loadComplaints(); // Return a Future<ApiCallback<List<Complaints>>>

// Load a list of complaints types to show on the form to create a complaint.
LoriApi().loadComplaintTypes(); // Return a Future<ApiCallback<List<ComplaintType>>>

// Create a complaint for the current LOGGED USER.
LoriApi().createComplaint(String description, String orderId, bool isComplaint, String complaintType, {String externalOrderId}); // Return a Future<ApiCallback<void>>

// Validate all information within the current cart to check if it's a good cart. This method will handle the need of creating a new cart if none exists and/or the current cart is somehow buggy.
LoriApi().validateCart(); // Return a Future<ApiCallback<void>>

// Create a new cart within the API. THIS METHOD IS MANDATORY TO THE API. Everything only works if a cart was created. Make sure to call it.
LoriApi().createCart(); // Return a Future<ApiCallback<void>>

// Load the cart from API.
LoriApi().loadCart(); // Return a Future<ApiCallback<Cart>>

// Reset the cart to the initial state.
LoriApi().clearCart(); // Return a Future<ApiCallback<void>>

// Update a specific product quantity inside the cart. The quantity parameter is the quantity that will be ADDED to the current quantity.
LoriApi().updateCartItem(String skuId, int quantity); // Return a Future<ApiCallback<void>>

// Downgrade a specific product quantity inside the cart. The quantity parameter is the quantity that will be REMOVED from the current quantity.
LoriApi().downgradeCartItem(String skuId, int quantity); // Return a Future<ApiCallback<void>>

// Update the current cart owner. If no CURRENT USER the owner will be empty and if any CURRENT USER the CURRENT USER will be the new owner.
LoriApi().updateCartOwner(); // Return a Future<ApiCallback<void>>

// Update the latitude and the longitude of the current cart.
LoriApi().updateCartLocation(String lat, String lon); // Return a Future<ApiCallback<void>>

// Load a list of sellers that are available to fullfil the current cart items.
LoriApi().loadCartSellers(); // Return a Future<ApiCallback<List<Seller>>>

// Load a list of products with it's specific availability from the sellerId.
LoriApi().loadCartSellerItems(String sellerId); // Return a Future<ApiCallback<List<CartItem>>>

// Update the current cart seller that was selected.
LoriApi().updateCartSeller(String sellerId); // Return a Future<ApiCallback<void>>

// Update the current cart address that was selected.
LoriApi().updateCartAddress(String addressId); // Return a Future<ApiCallback<void>>

// Update the current cart cep that was selected.
LoriApi().updateCartCep(String cep); // Return a Future<ApiCallback<void>>

// Load a list of available freights for the current cart address/cep.
LoriApi().loadCartFreights(); // Return a Future<ApiCallback<List<Freight>>

// Update the current cart freight that was selected.
LoriApi().updateCartFreight(String freightReference); // Return a Future<ApiCallback<void>>

// Load a list of available installments for the current cart items.
LoriApi().loadCartInstallments(); // Return a Future<ApiCallback<List<Installment>>>

// Update the current cart installment that was selected.
LoriApi().updateCartInstallment(String installmentNumber); // Return a Future<ApiCallback<void>>

// Update the current cart invoice cpf that was selected.
LoriApi().updateCartInvoiceCpf(String cpf); // Return a Future<ApiCallback<void>>

// Update the current cart pickup cpf that was selected.
LoriApi().updateCartPickupCpf(String cpf); // Return a Future<ApiCallback<void>>

// Load a list of available paymentMethods that are available for selection.
LoriApi().loadCartPayments(); // Return a Future<ApiCallback<List<PaymentMethod>>>

// Update the current cart payment method that was selected.
LoriApi().updateCartPaymentMethod(String paymentId); // Return a Future<ApiCallback<void>>

// Update the current cart payment method that was selected.
LoriApi().updateCartVoucher(String voucherCode); // Return a Future<ApiCallback<void>>

// Remove the current cart payment method that was selected.
LoriApi().removeCartVoucher(String voucherCode); // Return a Future<ApiCallback<void>>

// Update the current cart cvv and them validate it with the card that was selected. This method only need to be called when the PaymentMethod has the type of CreditCard.
LoriApi().updateCartCvv(String cvv); // Return a Future<ApiCallback<void>>

// Update the current cart dealer code that was selected.
LoriApi().updateCartDealerCode(String dealerCode); // Return a Future<ApiCallback<void>>

// Update the current cart device fingerprint that was generated by the TrustDefender.
LoriApi().updateCartFingerprint(String deviceFingerprint); // Return a Future<ApiCallback<void>>

// Try to finalize the current cart. If this method return success, the current cart will be reseted.
LoriApi().finalizeCart(); // Return a Future<ApiCallback<void>>

// Load a address from a valid CEP.
LoriApi().loadAddressByCep(String cep); // Return a Future<ApiCallback<AddressCep>>

// Load a list of available states for the clientId.
LoriApi().loadStates(); // Return a Future<ApiCallback<List<AddressState>>>

// Load a list of available states for the clientId AND the state.
LoriApi().loadCities(String state); // Return a Future<ApiCallback<List<AddressCity>>>

// Update the that later will be used to send push notifications. IMPORTANT: this method need to be called when a new user is logged and when has done logout.
LoriApi().updateNotificationToken(String token); // Return a Future<ApiCallback<void>>

// Log that a notification was opened by the user.
LoriApi().notificationOpened(String notificationId); // Return a Future<ApiCallback<void>>

// Request a new password for an e-mail.
LoriApi().recoverUser(String email); // Return a Future<ApiCallback<void>>

// Request the change of a phone number for an e-mail.
LoriApi().recoverPhone(String email); // Return a Future<ApiCallback<void>>

// Request an SMS Code for both login by sms and for request password change.
LoriApi().requestSmsCode(String email); // Return a Future<ApiCallback<SmsRequestResult>>

// Request the change of the current password for an e-mail using a sms code.
LoriApi().requestPasswordChange(String email, String smsCode, String password); // Return a Future<ApiCallback<void>>

// Try to create a new user within the API. Validates if the e-mail already exists.
LoriApi().createUser(String email, String fullName, String cpf, String phoneNumber, String password); // Return a Future<ApiCallback<User>>

// Load all information about the CURRENT USER.
LoriApi().loadUser(); // Return a Future<ApiCallback<User>>

// Update some information of the CURRENT USER.
LoriApi().updateUser(String fullName, String cpf, String phoneNumber, {String dateOfBirth, int gender, String password}); // Return a Future<ApiCallback<void>>

// Update the user picture of the CURRENT USER.
LoriApi().updateUserPhoto(List<int> bytes); // Return a Future<ApiCallback<String>>

// Create a new address for the CURRENT USER.
LoriApi().createUserAddress(UserAddress address); // Return a Future<ApiCallback<UserAddress>>

// Update an existing address of the CURRENT USER.
LoriApi().updateUserAddress(UserAddress address); // Return a Future<ApiCallback<void>>

// Delete an existing address of the CURRENT USER.
LoriApi().deleteUserAddress(UserAddress address); // Return a Future<ApiCallback<void>>

// Load payment methods of the CURRENT USER.
LoriApi().loadUserPayments(); // Return a Future<ApiCallback<List<PaymentMethod>>>

// Create a new payment method for the CURRENT USER.
LoriApi().createUserPayment(String number, String cardHolder, String cvv, String expiration, String brand); // Return a Future<ApiCallback<PaymentMethod>>

// Delete a payment method of the CURRENT USER.
LoriApi().deleteUserPayment(String paymentId); // Return a Future<ApiCallback<void>>

// Load the card brand of the bin.
LoriApi().loadCardBrand(String bin); // Return a Future<ApiCallback<String>>

// Load all orders of the CURRENT USER.
LoriApi().loadOrders(); // Return a Future<ApiCallback<List<Order>>>

// Load a order by it's id of the CURRENT USER.
LoriApi().loadOrder(String orderId); // Return a Future<ApiCallback<Order>>

// Load a order's available payment methods. THIS METHOD MUST BE CALLED ONLY IF THE Order().isOrderRetryingPayment() is TRUE.
LoriApi().loadOrderPayments(Order order); // Return a Future<ApiCallback<List<PaymentMethod>>>

// Update the order payment method that was selected. THIS METHOD MUST BE CALLED ONLY IF THE Order().isOrderRetryingPayment() is TRUE.
LoriApi().updateOrderPayment(Order order, PaymentMethod paymentMethod); // Return a Future<ApiCallback<void>>

// Update the order cvv that was selected. THIS METHOD MUST BE CALLED ONLY IF THE Order().isOrderRetryingPayment() is TRUE and the payment method has a type of CreditCard.
LoriApi().updateOrderPaymentCvv(Order order, String cvv); // Return a Future<ApiCallback<void>>

// Load an order's available installments.
LoriApi().loadOrderInstallments(Order order); // Return a Future<ApiCallback<List<Installment>>>

// Update an order installment that was previously selected.
LoriApi().updateOrderInstallment(Order order, String installmentNumber); // Return a Future<ApiCallback<void>>

// Restart the payment process of an order after the payment method was updated. THIS METHOD MUST BE CALLED ONLY IF THE Order().isOrderRetryingPayment() is TRUE.
LoriApi().restartOrder(Order order); // Return a Future<ApiCallback<void>>

// Cancel an order. THIS METHOD MUST BE CALLED ONLY IF THE Order().isOrderRetryingPayment() is TRUE.
LoriApi().cancelOrder(Order order); // Return a Future<ApiCallback<void>>

I need help or i want to help you guys, what should i do? #

Mail us at joao@neomode.com.br with your doubt or suggestion that we'll be very pleased to help you.

Remember, we do this with all love. From Curitiba <3

[0.1.11+1] - Added a check to see if cart exists at loginUser method #

[0.1.11] - Fixed a bug where the auth token was always considered invalid #

[0.1.10] - Now running firebase_performance only for non-web platforms, since the plugin doesn't work on web. #

[0.1.9] - Added an option to change the category environment after the sdk has been initialized. #

[0.1.8] - Fixed a bug on cart item price migration where all the discounts were null #

[0.1.7] - Added promotional cart item boolean flag #

[0.1.6] - Added forceSellerNameAtList to configurations in order to allow further customization of the seller list #

[0.1.5] - Added checkout store payment message to configurations + standardizing the DAOs methods. #

[0.1.4] - Added a new class called SkuAttribute. #

[0.1.3] - Added enum to support default product ordering + added property on product to use as old price. #

[0.1.2] - Added support for banner types (don't use promotions anymore). Added 2 new flags to configurations: default sorting for product listing and buyWithOneClick. #

[0.1.1] - Fixed a bug when the refresh_token was not valid anymore and the user was unable of using the app. Also added the Phoenix plugin to restart the app when needed. #

[0.1.0] - Added validation for duplicated CPFs and added iconUrl return on categories/subcategories. #

[0.0.8] - Added dateOfBirth as optional parameter at createUser method. #

[0.0.7] - Now the systemOperationVersion can be null because the web sometimes doesn't have access to it. #

[0.0.6] - Removed repetitive systemName parameter from init method. #

[0.0.5] - More tweaks to ame the SDK available when using flutter_web. #

[0.0.4] - Added 3 new fields to the init method. #

[0.0.3] - Removed dart:io from lori_api since it's not supported on web. #

[0.0.2] - Added a better description + formatted all files to silence pub.dev warnings. #

[0.0.1] - First release with the SDK ready for use in production. STILL working on WEB support. #

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  lori_sdk: ^0.1.11+1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:lori_sdk/data/database/authResponseDaoStub.dart';
import 'package:lori_sdk/data/database/cartDaoStub.dart';
import 'package:lori_sdk/data/database/interfaces/authResponseDao.dart';
import 'package:lori_sdk/data/database/interfaces/cartDao.dart';
import 'package:lori_sdk/data/database/interfaces/notificationDao.dart';
import 'package:lori_sdk/data/database/interfaces/productDao.dart';
import 'package:lori_sdk/data/database/interfaces/searchTermsDao.dart';
import 'package:lori_sdk/data/database/interfaces/userDao.dart';
import 'package:lori_sdk/data/database/mobile/mobileAuthResponseDao.dart';
import 'package:lori_sdk/data/database/mobile/mobileCartDao.dart';
import 'package:lori_sdk/data/database/mobile/mobileNotificationDao.dart';
import 'package:lori_sdk/data/database/mobile/mobileProductDao.dart';
import 'package:lori_sdk/data/database/mobile/mobileSearchTermsDao.dart';
import 'package:lori_sdk/data/database/mobile/mobileUserDao.dart';
import 'package:lori_sdk/data/database/notificationDaoStub.dart';
import 'package:lori_sdk/data/database/productDaoStub.dart';
import 'package:lori_sdk/data/database/searchTermsDaoStub.dart';
import 'package:lori_sdk/data/database/userDaoStub.dart';
import 'package:lori_sdk/data/database/web/webAuthResponseDao.dart';
import 'package:lori_sdk/data/database/web/webCartDao.dart';
import 'package:lori_sdk/data/database/web/webNotificationDao.dart';
import 'package:lori_sdk/data/database/web/webProductDao.dart';
import 'package:lori_sdk/data/database/web/webSearchTermsDao.dart';
import 'package:lori_sdk/data/database/web/webUserDao.dart';
import 'package:lori_sdk/data/lori_api.dart';
import 'package:lori_sdk/data/lori_push_notification_token.dart';
import 'package:lori_sdk/data/models/addressCep.dart';
import 'package:lori_sdk/data/models/addressCep.g.dart';
import 'package:lori_sdk/data/models/addressCity.dart';
import 'package:lori_sdk/data/models/addressCity.g.dart';
import 'package:lori_sdk/data/models/addressState.dart';
import 'package:lori_sdk/data/models/addressState.g.dart';
import 'package:lori_sdk/data/models/authResponse.dart';
import 'package:lori_sdk/data/models/authResponse.g.dart';
import 'package:lori_sdk/data/models/banner.dart';
import 'package:lori_sdk/data/models/banner.g.dart';
import 'package:lori_sdk/data/models/cart/cart.dart';
import 'package:lori_sdk/data/models/cart/cart.g.dart';
import 'package:lori_sdk/data/models/cart/cartItem.dart';
import 'package:lori_sdk/data/models/cart/cartItem.g.dart';
import 'package:lori_sdk/data/models/cart/freight.dart';
import 'package:lori_sdk/data/models/cart/freight.g.dart';
import 'package:lori_sdk/data/models/cart/installment.dart';
import 'package:lori_sdk/data/models/cart/installment.g.dart';
import 'package:lori_sdk/data/models/cart/paymentMethod.dart';
import 'package:lori_sdk/data/models/cart/paymentMethod.g.dart';
import 'package:lori_sdk/data/models/cart/seller.dart';
import 'package:lori_sdk/data/models/cart/seller.g.dart';
import 'package:lori_sdk/data/models/cart/voucher.dart';
import 'package:lori_sdk/data/models/cart/voucher.g.dart';
import 'package:lori_sdk/data/models/configurations.dart';
import 'package:lori_sdk/data/models/configurations.g.dart';
import 'package:lori_sdk/data/models/faq.dart';
import 'package:lori_sdk/data/models/faq.g.dart';
import 'package:lori_sdk/data/models/notification.dart';
import 'package:lori_sdk/data/models/notification.g.dart';
import 'package:lori_sdk/data/models/order/buyedItem.dart';
import 'package:lori_sdk/data/models/order/buyedItem.g.dart';
import 'package:lori_sdk/data/models/order/complaint.dart';
import 'package:lori_sdk/data/models/order/complaint.g.dart';
import 'package:lori_sdk/data/models/order/complaintType.dart';
import 'package:lori_sdk/data/models/order/complaintType.g.dart';
import 'package:lori_sdk/data/models/order/order.dart';
import 'package:lori_sdk/data/models/order/order.g.dart';
import 'package:lori_sdk/data/models/order/orderInstallment.dart';
import 'package:lori_sdk/data/models/order/orderInstallment.g.dart';
import 'package:lori_sdk/data/models/order/orderStep.dart';
import 'package:lori_sdk/data/models/order/orderStep.g.dart';
import 'package:lori_sdk/data/models/order/paymentInfo.dart';
import 'package:lori_sdk/data/models/order/paymentInfo.g.dart';
import 'package:lori_sdk/data/models/privacyPolicy.dart';
import 'package:lori_sdk/data/models/privacyPolicy.g.dart';
import 'package:lori_sdk/data/models/product/category.dart';
import 'package:lori_sdk/data/models/product/category.g.dart';
import 'package:lori_sdk/data/models/product/evaluation.dart';
import 'package:lori_sdk/data/models/product/evaluation.g.dart';
import 'package:lori_sdk/data/models/product/evaluationForm.dart';
import 'package:lori_sdk/data/models/product/evaluationForm.g.dart';
import 'package:lori_sdk/data/models/product/opinion.dart';
import 'package:lori_sdk/data/models/product/opinion.g.dart';
import 'package:lori_sdk/data/models/product/opinionQuestion.dart';
import 'package:lori_sdk/data/models/product/opinionQuestion.g.dart';
import 'package:lori_sdk/data/models/product/opinionResponse.dart';
import 'package:lori_sdk/data/models/product/opinionResponse.g.dart';
import 'package:lori_sdk/data/models/product/product.dart';
import 'package:lori_sdk/data/models/product/product.g.dart';
import 'package:lori_sdk/data/models/product/productImage.dart';
import 'package:lori_sdk/data/models/product/productImage.g.dart';
import 'package:lori_sdk/data/models/product/productOrder.dart';
import 'package:lori_sdk/data/models/product/productTag.dart';
import 'package:lori_sdk/data/models/product/productTag.g.dart';
import 'package:lori_sdk/data/models/product/searchTerm.dart';
import 'package:lori_sdk/data/models/product/searchTerm.g.dart';
import 'package:lori_sdk/data/models/product/skuAttribute.dart';
import 'package:lori_sdk/data/models/product/skuAttribute.g.dart';
import 'package:lori_sdk/data/models/product/subcategory.dart';
import 'package:lori_sdk/data/models/product/subcategory.g.dart';
import 'package:lori_sdk/data/models/promotion.dart';
import 'package:lori_sdk/data/models/promotion.g.dart';
import 'package:lori_sdk/data/models/ranking/ranking.dart';
import 'package:lori_sdk/data/models/ranking/ranking.g.dart';
import 'package:lori_sdk/data/models/response/productPaginationResult.dart';
import 'package:lori_sdk/data/models/response/productPaginationResult.g.dart';
import 'package:lori_sdk/data/models/response/storeResult.dart';
import 'package:lori_sdk/data/models/response/storeResult.g.dart';
import 'package:lori_sdk/data/models/singleton/cartSingleton.dart';
import 'package:lori_sdk/data/models/singleton/notificationSingleton.dart';
import 'package:lori_sdk/data/models/singleton/productSingleton.dart';
import 'package:lori_sdk/data/models/singleton/searchTermsSingleton.dart';
import 'package:lori_sdk/data/models/singleton/userSingleton.dart';
import 'package:lori_sdk/data/models/smsRequestResult.dart';
import 'package:lori_sdk/data/models/smsRequestResult.g.dart';
import 'package:lori_sdk/data/models/store.dart';
import 'package:lori_sdk/data/models/store.g.dart';
import 'package:lori_sdk/data/models/trustDefenderConfiguration.dart';
import 'package:lori_sdk/data/models/trustDefenderConfiguration.g.dart';
import 'package:lori_sdk/data/models/tutorialItem.dart';
import 'package:lori_sdk/data/models/tutorialItem.g.dart';
import 'package:lori_sdk/data/models/user.dart';
import 'package:lori_sdk/data/models/user.g.dart';
import 'package:lori_sdk/data/models/userAddress.dart';
import 'package:lori_sdk/data/models/userAddress.g.dart';
import 'package:lori_sdk/data/models/userTerms.dart';
import 'package:lori_sdk/data/models/userTerms.g.dart';
import 'package:lori_sdk/data/models/v2/category.dart';
import 'package:lori_sdk/data/models/v2/category.g.dart';
import 'package:lori_sdk/ext/extensions.dart';
import 'package:lori_sdk/misc/lori_sdk_exception.dart';
import 'package:lori_sdk/utils/lori_utils.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
59
Health:
Code health derived from static analysis. [more]
92
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
75
Learn more about scoring.

We analyzed this package on Apr 3, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Health issues and suggestions

Document public APIs. (-0.34 points)

1554 out of 1590 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/data/models/cart/cartItem.dart. (-2.48 points)

Analysis of lib/data/models/cart/cartItem.dart reported 5 hints:

line 69 col 57: 'price' is deprecated and shouldn't be used. Please use subTotalAmount instead.

line 71 col 67: 'price' is deprecated and shouldn't be used. Please use subTotalAmount instead.

line 72 col 85: 'priceSeparated' is deprecated and shouldn't be used. Please use subTotalSeparatedAmount instead.

line 73 col 61: 'price' is deprecated and shouldn't be used. Please use subTotalAmount instead.

line 74 col 79: 'priceSeparated' is deprecated and shouldn't be used. Please use subTotalSeparatedAmount instead.

Fix lib/data/models/cart/cartItem.g.dart. (-1.99 points)

Analysis of lib/data/models/cart/cartItem.g.dart reported 4 hints:

line 19 col 7: 'price' is deprecated and shouldn't be used. Please use subTotalAmount instead.

line 20 col 7: 'priceSeparated' is deprecated and shouldn't be used. Please use subTotalSeparatedAmount instead.

line 37 col 25: 'price' is deprecated and shouldn't be used. Please use subTotalAmount instead.

line 38 col 34: 'priceSeparated' is deprecated and shouldn't be used. Please use subTotalSeparatedAmount instead.

Fix lib/data/lori_api.dart. (-1 points)

Analysis of lib/data/lori_api.dart reported 2 hints:

line 7 col 8: Don't import implementation files from another package.

line 298 col 26: This function has a return type of 'Future

Fix additional 5 files with analysis or formatting issues. (-2 points)

Additional issues in the following files:

  • lib/data/models/product/productOrder.dart (2 hints)
  • lib/data/database/interfaces/searchTermsDao.dart (1 hint)
  • lib/data/models/product/skuAttribute.dart (1 hint)
  • lib/data/models/banner.dart (Run flutter format to format lib/data/models/banner.dart.)
  • lib/data/models/product/product.dart (Run flutter format to format lib/data/models/product/product.dart.)

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and lori_sdk.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
cloud_firestore ^0.13.4 0.13.4+2
dio ^3.0.8 3.0.9
firebase_performance ^0.3.1+5 0.3.1+8
flutter 0.0.0
flutter_phoenix ^0.1.0 0.1.0
http ^0.12.0+4 0.12.0+4
intl ^0.16.0 0.16.1
json_annotation ^3.0.1 3.0.1
path ^1.6.4 1.6.4
shared_preferences ^0.5.6 0.5.6+3
simple_rsa ^0.0.5 0.0.5
sqflite ^1.2.1 1.3.0
validators ^2.0.0+1 2.0.0+1
Transitive dependencies
async 2.4.1
charcode 1.1.3
cloud_firestore_platform_interface 1.1.0
cloud_firestore_web 0.1.1+2
collection 1.14.11 1.14.12
firebase 7.2.1
firebase_core 0.4.4+3
firebase_core_platform_interface 1.0.4
firebase_core_web 0.1.1+2
flutter_web_plugins 0.0.0
http_parser 3.1.4
js 0.6.1+1
matcher 0.12.6
meta 1.1.8
pedantic 1.9.0
plugin_platform_interface 1.0.2
quiver 2.1.3
shared_preferences_macos 0.0.1+6
shared_preferences_platform_interface 1.0.3
shared_preferences_web 0.1.2+4
sky_engine 0.0.99
source_span 1.7.0
sqflite_common 1.0.0+1
stack_trace 1.9.3
string_scanner 1.0.5
synchronized 2.2.0
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
build_runner ^1.7.1
flutter_test
json_serializable ^3.2.5