iws_experiments 0.0.1
iws_experiments: ^0.0.1 copied to clipboard
A Flutter package for managing A/B testing and feature experiments with pre-built UI components and API integration.
example/README.md
IWS Experiments Examples #
This directory contains examples demonstrating how to use the iws_experiments package.
Examples Included #
- basic_usage.dart - Basic experiment fetching and toggling
- experiment_list_example.dart - Using the ExperimentList widget
- experiment_tile_example.dart - Using the ExperimentListTile widget
- custom_ui_example.dart - Building custom UI with experiment data
- complete_app_example.dart - A complete Flutter app integrating all features
Running the Examples #
Setting up the API Key #
Before running any example, make sure to set your API key:
flutter run --dart-define=IWS_API_KEY=your_api_key_here
Running Individual Examples #
Each example is a standalone Dart file that demonstrates specific functionality. You can incorporate these patterns into your own application.
Example Overview #
Basic Usage #
Shows how to:
- Fetch experiments
- Fetch user-specific experiments
- Toggle experiment participation
- Handle errors
Experiment List Widget #
Demonstrates:
- Displaying all experiments in a list
- Handling experiment updates
- User-specific experiment views
Experiment Tile Widget #
Shows:
- Displaying individual experiments
- Toggle functionality
- Loading states
Custom UI Example #
Illustrates:
- Building custom interfaces with experiment data
- Advanced filtering and sorting
- Custom styling
Complete App Example #
A full Flutter application that:
- Integrates all package features
- Shows best practices
- Demonstrates proper error handling
- Includes navigation and state management