flexi_cart 1.0.3+2
flexi_cart: ^1.0.3+2 copied to clipboard
A versatile and reactive cart solution for Flutter apps, supporting grouping, notes, delivery, quantity control, and custom logic.
1.0.3+2 #
- feat: add shouldNotifyListeners option to restoreFromCache
1.0.3+1 #
- refactor: move cart persistence methods to FlexiCart and rename CartCacheProvider
- Moves
toMap,saveToCache, anddeleteFromCachemethods from theFlexiCartPersistenceextension directly into theFlexiCartclass. - Renames
CartCacheProvidertoICartCacheProviderand updates all usages. - The
providerparameter insaveToCache,deleteFromCache, andrestoreFromCacheis now required.
1.0.3 #
- Added cart persistence with
saveToCache,restoreFromCacheanddeleteFromCache - Added functionality to save, restore, and delete cart state using a
CartCacheProvider. This includes: FlexiCartPersistenceextension withtoMap,toJsonString,saveToCache,restoreFromCache, anddeleteFromCachemethods.CartCacheProviderabstract class for custom cache implementations.restoreFrommethod inFlexiCartto restore state from another cart instance.- Serialization support for
CartOptions,BehaviorOptions, andValidatorOptions. - New tests for cart persistence using
shared_preferences. - Example app demonstrating cart caching.
1.0.2+3 #
- Added optional focusNode parameter to CartInput widget
1.0.2+2 #
- Added textInputAction and onSubmitted callbacks to CartInput widget
1.0.2+1 #
- Added AutoFocus to
CartInputwidget.
1.0.2 #
- Added
keepZeroOrNullQuantityItemsoption to behavior options
1.0.1 #
- introduced a new
throwWhenDisposedboolean option toBehaviorOptions. When set totrue(default), the cart will throw aCartDisposedExceptionif an attempt is made to modify it after it has been disposed. When set tofalse, such attempts will be silently ignored.
1.0.0+1 #
- Reduces the width of screenshots in
README.mdfrom200to165for better layout. - Minor code formatting changes include removing an extra newline in
cart_hooks_test.dartand adjusting spacing incart_hooks.dart.
1.0.0 #
Breaking changes: #
- Removed 'onDisposed' from flexi_cart.dart, use hooks.onDisposed instead.
- Removed 'onAddItem' from flexi_cart.dart, use hooks.onItemAdded instead.
- Removed 'onDeleteItem' from flexi_cart.dart, use hooks.onItemDeleted instead.
- Removed 'removeItemCondition' from flexi_cart.dart, use options.behaviorOptions.itemFilter instead.
- Removed 'setMetadata' from flexi_cart.dart, use setMetadataEntry instead.
- Removed 'getMetadata' from flexi_cart.dart, use getMetadataEntry instead.
- Removed 'removeMetadata' from flexi_cart.dart, use removeMetadataEntry instead.
Features: #
- Added 'options' to flexi_cart.dart, which includes all previous options and more.
- Added 'options.validatorOptions' to CartOptions.
- Added 'options.behaviorOptions' to CartOptions.
0.4.0+2 #
updates the following screenshots with improved image quality and file size:
currencies.pngfresh_market.pngfresh_market_vertical.pngmulti_cart.pngshine_beauty.pngshiny_eats.pngThe images have been processed to enhance clarity while reducing overall file sizes.
0.4.0+1 #
- update unit tests to use
CartCurrencyclass - update README to include
CartCurrencyusage examples - update example app to demonstrate
CartCurrencyfunctionality
0.4.0 #
New methods:
applyExchangeRate(CartCurrency cartCurrency): Multiplies all item prices by the given exchange rate and sets the cart's currency.removeExchangeRate(): Reverts item prices to their original values before the last exchange rate application.
A new class CartCurrency is introduced to hold the currency code and exchange rate.
Tests have been added to verify:
- Correct price multiplication after applying an exchange rate.
- Restoration of original prices after removing an exchange rate.
- No change if
removeExchangeRateis called without a currency applied. - Price updates when multiple exchange rates are applied sequentially (the new rate is applied to the current prices, not the original ones).
0.3.0 #
- Added a private
_metadatamap to store key-value pairs. - Added a public getter
metadatawhich returns an unmodifiable view of the_metadata. - Introduced
setMetadata(String key, dynamic value)to add or update metadata entries. - Introduced
getMetadata<D>(String key)to retrieve metadata values by key. - Introduced
removeMetadata(String key)to remove metadata entries. - Ensured metadata is cleared during
reset(). - Metadata operations can optionally trigger listener notifications.
- The
reset()method now clears metadata, lock status, and logs, providing a more complete reset.
0.2.0 #
- Added
CartInputThemeas aThemeExtensionfor consistent styling. - Introduced
CartInputStyleto define visual and structural styles. CartInputnow supportsAxis.verticallayout and custom border styles.- Updated
CartInputto useAnimatedPhysicalModelfor styled layout with elevation. - Added
BuildContext.safeReadandsafeWatchextensions for safer Provider access. - Updated tests to cover new theming capabilities and widget enhancements.
- Updated dependencies in the example app.
- Minor refactor in
mixins.dartto prevent notifying listeners after disposal. - Corrected method name in README from
onCartChangedtoonChange. - introduces a new example application called
ShineShopAppthat showcases the usage of theflexi_cart - introduces a new example application called
Shiny Eatsthat showcases the usage of theflexi_cart - introduces a new example application called
Shpping Appthat showcases the usage of theflexi_cart
0.1.6 #
- Update the README to reflect current usage examples.
- Remove the deprecated
onCartChangedmethod fromICartPlugin. - Clean up internal calls to the removed method.
0.1.5 #
- Introduced new callbacks in the
ICartPlugininterface:onChange,onError, andonClose. These provide plugins with more granular notifications about the cart's lifecycle and state changes. onChange: Called whenever a change occurs in the cart.onError: Called when an error is thrown within the cart.onClose: Called just before the cart is disposed.- The deprecated
onCartChangedmethod will be removed soon. - Updated logging to include whether a listener was notified for cart actions.
- Added tests to verify plugin notifications for the new callbacks.
- Modified example to use the new plugin callbacks for printing cart logs, errors, and close events.
0.1.4 #
- Removed the
taxanddiscountfields from theCartItemclass incart_item.dart.
0.1.3 #
- Adds support for locking and unlocking the cart to prevent accidental modifications.
- Implements cart expiration with a set duration.
- Introduces internal logging for debugging cart changes.
- Implements Stream for state emission.
- Adds a plugin architecture for extending cart functionality.
- Includes a new
CartDiffclass to track differences between cart states. - Adds
setExpiration,lock,unlock,registerPluginandlogsoptions. - Enhances the README.md file with new usage examples.
- Adds unit tests for the new functionalities.
0.1.2 #
- Update Links update package metadata
0.1.1 #
- License Update: Changed the LICENSE file to the MIT License and updated the copyright to abed-supy-io.
- Pubspec Update: Updated the package description, version to 0.1.1, repository, issue tracker,
homepage and add
topicsto pubspec.yaml. - Cart Input Formatter: Modified the
formatEditUpdatemethod incart_input_formatter.dartto handle empty strings and special characters like ',' and '.' more gracefully. - Cart Test: added
decrementtest case inflexi_cart_test.dart. - Cart Input Widget: Added a condition to
_onTextChangedincart_input_widget.dartto handle zero quantity. - Cart Input Widget: remove unused
_quantityNotifier.removeListenerindispose. - Cart Mixins: remove unused
disposeinCartChangeNotifierDisposeMixin - FlexiCartTest: added
resetItemsandresettest case inflexi_cart_test.dart. - example: updated example app and add more test cases.
- FlexiCart: exported
mixins.dartinflexi_cart.dart. - FlexiCartInputTest: fix type in
CartInput. - Added
CONTRIBUTING.mdwith guidelines for contributing.
0.1.0 #
- Introduced
CartQuantityInputFormatterfor quantity fields, allowing customizable decimal precision. - Introduced
CartPriceInputFormatterfor price fields, allowing customizable decimal precision. - Added
CartInputNumberFormatteras a base class to normalize Arabic digits, limit decimal places, and constrain values. - Deprecated
QuantityInputFormatter, advising to useCartQuantityInputFormatterinstead. - Improved documentation.
- Added various example on cart input.
- Adds
description,metadata,tax, anddiscountfields in theICartItemmodel - Added
CartChangeNotifierDisposeMixinto handle the disposal ofChangeNotifier. - Add flexi-cart formatter and mixin tests.
- Add flexi-cart input test.
0.0.9 #
- Added
ChangeNotifierDisposeMixinto prevent callingnotifyListeners()after dispose. - Updated test cases to include
shouldNotifyListenersoption and assertDateTimetype.
0.0.8 #
- Removed
removeNullQuantityoption & fixed cart logic.
0.0.7 #
- Added
removeNullQuantityoption.
0.0.5 #
- Allowed
,inCartInputwidget. - Added group methods in cart.
0.0.4 #
- Added
setNote()&setDeliveredAt()functions instead of setters, withshouldNotifyListenerstoggle.
0.0.3 #
- Added
Ordableproperty.
0.0.2 #
- Updated README file.
0.0.1 #
- Initial version.