- Using the
latencyAlgolia application. If you use thelatencyapplication, you can’t customize records or index configurations (such as settings, Rules, or synonyms). - Using your own Algolia application. To do this, you must send your data to your Algolia index.
Run the Ecommerce UI template
- Install Flutter
- Fork the Flutter Ecom UI Template repository
- Clone the forked repository to your local machine
- Install the dependencies:
flutter pub get - Configure the environment variables
- Start the application:
flutter run
Connect your Algolia app to the UI
Change the values of the Algolia credentials in thelib/credentials.dart file.
To use the sample data from Algolia’s Ecommerce UI demo, leave the values as they are.
The following variables are used:
| Name | Value |
|---|---|
applicationID | Your Algolia Application ID |
searchOnlyKey | Your Algolia Search API Key |
hitsIndex | Your Algolia index name |
suggestionsIndex | Your Algolia Query Suggestions index name |
API client
To use the Algolia API from your Dart app, you have these options:- Use the Dart API client (used in this guide)
- Call the API methods directly using the
httppackage.
Structure
If you want to experiment with customization, the Ecommerce UI template is structured as follows:lib/data: services and data providerslib/model: model objects for products data representationlib/ui/screens: applications screens and their componentslib/ui/widgets: standalone UI widgets used on multiple screens
Use your own data and configurations
The demo application data and configurations can be found in thedataset folder as JSON files that you can upload to Algolia:
products_configuration.jsonproducts_dataset.jsonproducts_query_suggestions_configuration.jsonproducts_query_suggestions_dataset.json
Example product record
The following is an example of a typical product record:JSON