flutter_simple_shopify

A new Flutter package which provides help in creating a mobile app of a shopify store. Note: This library as of right now is not ready for production however we finished creating our own app and used the library. There are still minor bugs here and there but we advise everyone to start using the library and post as many issues as possible. If there are questions about the usage feel free to hit us up on our mail address.

How To Use

I Assume you have already a private app on your Shopify store. if not please follow this. At step 6 we recommend checking every API permission as some queries and mutations require permission on objects like product tags.

First of all configure the ShopifyConfig like that:

void main() {
  
  ShopifyConfig.setConfig(
      'de16cae1ce0b86260703fccaa6b689a3', // Storefront API access token.
      'exampleShopname.myshopify.com', // Store url.
      '2020-04'); // The Shopify Storefront API version.
  
  runApp(MyApp());
}

These are the five possible instances, each contains different methods which will help you with working with the Shopify Storefront API. The goal is to make creating an mobile app from your Shopify website easier.

  ShopifyAuth shopifyAuth = ShopifyAuth.instance;
    Future<ShopifyUser> createUserWithEmailAndPassword({@required String email, @required String password})
    Future<void> signOutCurrentUser()
    Future<void> sendPasswordResetEmail({@required String email})
    Future<ShopifyUser> signInWithEmailAndPassword({@required String email, @required String password})
    Future<ShopifyUser> currentUser()
  ShopifyStore shopifyStore = ShopifyStore.instance;
     Future<List<Product>> getProductsByIds()
     Future<List<Product>> getXProductsAfterCursor(int limit,String startCursor)
     Future<List<Product>> getAllProducts()
     Future<List<Product>> getNProducts({@required int n, @required SortKey sortKey})
     Future<Shop> getShop()
     Future<Collection> getFeaturedCollection()
     Future<List<Collection>> getAllCollections()
     Future<List<Product>> getXProductsAfterCursorWithinCollection(String id, int limit, String startCursor, SortKeyProduct sortKey)
     Future<List<Product>> getAllProductsFromCollectionById(String id)
     Future<List<Product>> getAllProductsOnQuery(String cursor, SortKeyProduct sortKey, String query)
     Future<List<Product>> getXProductsOnQueryAfterCursor(String cursor, int limit, SortKeyProduct sortKey, String query)
     Future<List<Metafield>> getMetafieldsFromProduct(String productHandle, {String namespace})
  ShopifyCheckout shopifyCheckout = ShopifyCheckout.instance;
    Future<Checkout> getCheckoutInfoQuery({String checkoutId})
    Future<List<Order>> getAllOrders({String customerAccessToken})
    Future<void> checkoutLineItemsReplace({String checkoutId, List<Map<String,dynamic>> checkoutLineItems})
    Future<void> checkoutCustomerAssociate({String checkoutId, String customerAccessToken}) 
    Future<void> checkoutCustomerDisassociate({String checkoutId})
    Future<void> checkoutDiscountCodeApply({String checkoutId, String discountCode})
    Future<void> checkoutDiscountCodeRemove({String checkoutId})
    Future<String> createCheckout()
    Future<void> checkoutGiftCardAppend(String checkoutId, List<String> giftCardCodes)
    Future<void> checkoutGiftCardRemove(String appliedGiftCardId, String checkoutId)
    Future<void> checkoutCompleteFree(String checkoutId)
  ShopifyCustomer shopifyCustomer = ShopifyCustomer.instance;
     Future<void> customerAddressUpdate({String address1, String address2, String company, String city, String country, String firstName, String lastName, String phone, String province, String zip, String customerAccessToken, id})
     Future<void> customerUpdate({String email, String firstName, String lastName, String password, String phoneNumber, String customerAccessToken, bool acceptsMarketing})
     Future<void> customerAddressCreate({String address1, String address2, String company, String city, String country, String firstName, String lastName, String phone, String province, String zip, String customerAccessToken})
     Future<void> customerAddressDelete({String customerAccessToken, String addressId})
       
  ShopifyBlog shopifyBlog = ShopifyBlog.instance;
     Future<List<Blog>> getAllBlogs()
     Future<Blog> getBlogByHandle(String handle, SortKeyArticle sortKeyArticle)
     Future<List<Article>> getXArticlesSorted({int articleAmount, SortKeyArticle sortKeyArticle})

Above you see the instance on top and the possible methods and functions which you can use.

Getting Started

This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Libraries

access_token_delete
add_item(s)_to_checkout
article
blog
checkout
checkout_associate_customer
checkout_complete_free
checkout_customer_disassociate
checkout_discount_code_apply
checkout_discount_code_remove
checkout_email_update
checkout_giftcard_remove
checkout_giftcards_append
checkout_shipping_address_update
checkout_shipping_line_update
collection
complete_checkout_free
complete_checkout_visa
create_checkout
customer_access_token_create
customer_address_create
customer_address_delete
customer_address_update
customer_create
customer_default_address_update
customer_recover
customer_reset
customer_reset_by_url
customer_update
enums
get_all_blogs
get_all_collections_optimized
get_all_orders
get_all_products_from_collection_by_id
get_all_products_on_query
get_blog_by_handle
get_checkout_info_requires_shipping
get_checkout_information
get_checkout_without_shipping_rates
get_collections
get_collections_by_ids
get_customer
get_metafileds_from_product
get_n_articles_sorted
get_n_products
get_product_recommendations
get_products
get_products_by_handle
get_products_by_ids
get_shop
get_web_url
get_x_collections_and_n_products_sorted
get_x_products_after_cursor
get_x_products_after_cursor_within_collection
get_x_products_on_query_after_cursor
mixins
models
order
product
remove_checkout_items
shop
shopfiy_error
shopify
shopify_auth
shopify_blog
shopify_checkout
shopify_config
shopify_customer
shopify_store
shopify_user
simple_shopify
sort_key_article
sort_key_blog
sort_key_collection
sort_key_order
sort_key_product
sort_key_product_collection