Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

The YouCan E-commerce platform SDK for Flutter/Dart, built for a better developer experience.

License

NotificationsYou must be signed in to change notification settings

anasfik/Youcan_flutter_sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


YouCan API


GitHubStar on GitHubGitHub contributorsGitHub commit activityGitHub top languageGitHub language count

A wrapper into the YouCan platform API that enables developers to extend its features inside a Dart/Flutter project


YOU CAN HELP THIS PROJECT MAINTAINED CONTINUOUSLY BY THE AUTHOR WITH A STAR ✨✨



Motivation

Well, we might need a flexible and easy way to exchange requests from this API to our project, this could get developers more unnecessary extra work such as dealing with configuring and using the API's multiple endpoints, loose types of data, HTTP requests, modeling data...

This library aims to cover the developers from all those sides and provide easy call methods that bring them to their goals.

NOTE: This is still under development

Documentation

Get the full documentation of all that this library offersfrom this link

Usage

Store configuration

To configure this library to get the data directly from your store, you will need to set it like this:

voidmain() {YouCan.instance.storeLink='https://example.youcan.shop';// change it with your store's link}

Authentication

You can authenticate your customers to your store by calling thelogin() andcreate() methods on the customers instance like this:

// LoginString loginToken=awaitYouCan.instance.customers.login(        email:"YOUR EMAIL HERE",        password:"YOUR PASSWORD HERE",      );// Sign Up.CustomerCreationResponse customerCreationResult=awaitYouCan.instance.customers.create(        email:"YOUR EMAIL HERE",        password:"YOUR PASSWORD HERE",        confirmPassword:"THE PASSWORD CONFIRMATION HERE",      );

Get Products

To get a List` with all your store's products:

List<Product> products=awaitYouCan.instance.products.all();

Get Reviews

You can also get a product's reviews asList<Review> like this:

List<Product> products=awaitYouCan.instance.products.all();Product oneProduct= products.first;List<Review> review=await oneProduct.reviews();

Get Categories

to get all your store's categories asList<Category>, you will need to do this:

List<Category> categories=awaitYouCan.instance.categories.all();

Querying

Search

Search queries are made easy:

List<Product> products=awaitYouCan.instance.products.search("YOUR SEARCH TEXT").all();

Pagination

Pagination queries are also made easy, this example will get us the second page's products :

List<Product> products=awaitYouCan.instance.products.pagination(2).all();

Limit

You can also limit the requested elements to a specific number

List<Product> products=awaitYouCan.instance.products.limit(10).all();

Combining Queries

in brief, you can query your targets (products, reviews...) based on your store's implementation way, this means that you can query by categories, pages, and limiting elements... :

List<Product> products=awaitYouCan.instance.categories.category("Category id").products.pagination(2).limit(15).all();

Contact

You can get in contact with your users using thesendMessage() :

bool isSent=awaitYouCan.instance.contact.sendMessage(email:'email',subject:'subject',message:'message',),

Contributing

Our open-source project is making a difference in the E-commerce/Flutter community and we need your help to continue improving and expanding it. any kind of contribution is welcome.

Thank you!

License

MIT LicenseCopyright (c) 2023 GwhyyyPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp