opticore 1.0.20
opticore: ^1.0.20 copied to clipboard
OptiCore is a lightweight micro-framework for Flutter that simplifies and optimizes your app development
[Beta 1.0.20] #
New Features #
- Refactored Parsing Methods:
- Renamed:
toDoubleOrDefault→toDoubletoMapOrDefault→toMaptoListOrDefault→toListtoBoolOrDefault→toBool
- Renamed:
- Safe Execution Utility:
SafeCall.execute: Handles async operations safely with optional default values.- New Void Execution: Runs operations without returning a value.
- Async State Management:
AsyncValue.guard: A structured way to handle async operations.- New Async States:
AsyncInitial,AsyncLoading,AsyncData,AsyncError
AsyncBloc<T>: Streamlines async BLoC handling with built-in state management.
- Navigation Enhancements:
customCanPop: Customizable navigation pop behavior.NotFoundConfig: Centralized handling for missing routes.
[Beta 1.0.19] #
New Features #
- OptiKit CLI Integration:
- Introduced OptiKit CLI to enhance the interaction between the OptiCore package and its command-line interface.
- The CLI now offers powerful commands to update version and build numbers, streamline builds, and automate common tasks, ensuring seamless integration with the package ecosystem.
Improvements #
- Optimized the overall workflow by synchronizing package updates with CLI operations, resulting in a more cohesive and efficient development experience.
[Beta 1.0.18] #
New Features #
- Reusable Widget:
- Added
FlexibleCheckboxwidget for customizable checkbox functionality. - Introduced
DioLoggerfor logging network requests and responses.
- Added
- Enhanced analyzer warnings to ensure better detection of potential issues, improving code maintainability.
[Beta 1.0.17] #
New Features #
- Extended Context Utilities:
- Added
textScaleFactorfor retrieving the text scale factor. - Added
isLandscapeandisPortraitto determine screen orientation. - Added
screenSizefor getting the device screen size. - Added
devicePixelRatioto access the screen's pixel density. - Added
safeAreaInsetsto get safe area padding values. - Added
isDarkModeto check if the device is in dark mode.
- Added
- Enhanced DateTime Utilities:
- Added
toDateTimeOrDefaultto safely parse a string into aDateTime, with a default fallback. - Added
toDateTimeOrNullto convert a string toDateTime?, returningnullif parsing fails.
- Added
- Advanced Grouping Extensions:
- Introduced
groupBy,groupByCount, andgroupByWithDefaultfor flexible list grouping. - Added
groupBySumandgroupByAveragefor numeric aggregations. - Implemented
groupByCustomAggregationto allow custom aggregation logic. - Included
groupByAndMap,groupByMax, andgroupByMinfor structured data grouping. - Added
groupByToSet,groupByToMap, andgroupByToValuefor different map structures.
- Introduced
- Hex Color Conversion:
- Added
toColorWithAlphato convert a hex string to aColorwith a custom alpha value.
- Added
- Enhanced JSON Parsing:
- Added
isValidJsonto check if a string is valid JSON. - Introduced
safeJsonDecodeWithDefaultfor safely decoding JSON with a fallback. - Added
safeJsonDecodeAsMapandsafeJsonDecodeAsListfor parsing JSON into structured types. - Implemented
prettyPrintJsonfor formatted JSON output. - Introduced
safeJsonDecodeToObjectfor parsing JSON directly into objects. - Added
safeJsonDecodeKeyandsafeJsonDecodeNestedfor safely extracting specific values. - Added
safeJsonDecodeToListObjectsfor parsing lists of objects.
- Added
- Functional Programming Helpers:
- Introduced
letOrElse,also, andtakeIffor functional-style data transformations.
- Introduced
- List Enhancements:
- Added
filterNonNullto removenullvalues from a list. - Introduced
safeGetto safely retrieve an item at a given index. - Added
firstNonNullto get the first non-null element. - Implemented
mergeUniqueto merge lists while keeping only unique elements. - Improved deduplication with
cleanandcleanBy. - Added
sortedfor safely sorting lists without modifying the original. - Introduced
reversedListfor reversing a list without mutation.
- Added
- Advanced Map Parsing:
- Introduced
safeObject,safeList,safeInt,safeDouble,safeBool, andsafeStringfor structured JSON parsing. - Improved
addIfNotNullto conditionally add values to a map. - Added
safeGetNestedfor deep key lookups. - Introduced
safeGetfor retrieving values with safety checks. - Implemented
deepMergeto merge two maps deeply. - Added
toMapfor transforming objects into map structures.
- Introduced
- Navigation Enhancements:
- Fully restructured the navigation extension for better usability.
- Renamed
routetorouteBuilderfor clarity.
- Parsing Extensions:
- Added
toIntOrNullandtoIntOrDefaultfor integer conversion. - Introduced
toDoubleOrNullandtoDoubleOrDefaultfor safe double conversion. - Added
toMapOrNullandtoMapOrDefaultfor structured map parsing. - Implemented
toListOrNullandtoListOrDefaultfor safely handling lists. - Added
toBoolOrNullandtoBoolOrDefaultfor boolean conversion. - Included
isNumericto validate if a string contains numeric data. - Added
capitalizeFirstOnlyandcapitalizeFirstfor text transformations.
- Added
- Precache Optimizations:
- Added
precacheAssetandprecacheNetworkfor caching assets and network images. - Renamed
precacheSvgAssettoprecacheSvgfor consistency.
- Added
- Safe Handling Utilities:
- Introduced
orDefaultto provide default values for nullable types. - Added
nullIfEqualsto replace specific values withnull. - Implemented
toSafeInt,toSafeBool, andtoSafeDoublefor enhanced safety.
- Introduced
- String Manipulation:
- Added
toCamelCasefor converting strings to camel case. - Introduced
maskSensitiveInfofor masking sensitive data. - Added
truncatefor shortening text with ellipsis. - Implemented
removeWhitespacefor trimming excessive spaces.
- Added
- Theme Enhancements:
- Introduced
toggleThemeto programmatically switch themes. - Added
secondaryColorto easily access secondary theme colors.
- Introduced
New Reusable Widgets: #
- TruncatedText: A widget that dynamically truncates overflowing text.
- DoubleBackExit: A widget that handles double-tap to exit functionality.
[Beta 1.0.16] #
New Features #
- TextInputHelper:
- Introduced
handleEgyptPhoneInputto automatically remove the leading0when the country code is+20.
- Introduced
- New Text Formatters:
- EgyptPhoneNumberInputFormatter: Provides the same functionality as
handleEgyptPhoneInputbut operates independently of controller listeners as a formatter. - ForceLTRInputFormatter: Ensures input text is forced to display in a left-to-right (LTR) direction.
- EgyptPhoneNumberInputFormatter: Provides the same functionality as
- Internet Connectivity Enhancements:
- Added
Stream<InternetStatus>asinternetConnectionStreamfor real-time internet connection monitoring. - Introduced
isConnectedvariable that updates dynamically based on stream listening. - Implemented
startListeningToConnectivityfor initializing global internet connectivity monitoring in the app's top-level widget.
- Added
- App Bar Configuration:
- Added
onBackcallback to customize the behavior of the back button navigation.
- Added
Improvements #
-
FlexibleListView:
- Default scroll direction updated to vertical for a more intuitive user experience.
-
String Extensions:
- Added
forceLTRextension to handle foreign language strings when used alongside Arabic versions.
- Added
-
Code Refactoring:
- Separated text formatters into individual files for improved clarity and organization.
[Beta 1.0.15] #
New Features #
- RequestBodyType Enum:
- Added a new
RequestBodyTypeenum to handle API request body types. - Supports
formDataandrawData(JSON) formats. - Default body type is set to
rawData(JSON).
- Added a new
- Static ToastHelper:
- Replaced the singleton instance of
ToastHelperwith a static implementation for better performance and global accessibility.
- Replaced the singleton instance of
Improvements #
- Unauthorized Handling:
- Updated the mechanism for handling unauthorized scenarios.
- Ensures consistent behavior and improved error messaging.
- Dependency Updates and Code Refactoring for enhanced performance and stability.
[Beta 1.0.14] #
New Features #
- UnAuthenticatedConfig: Added a new configuration class to handle unauthenticated scenarios more effectively.
- ApiResponseConfig: Introduced a new configuration class for handling custom API response messages, such as request timeout, network issues, and generic errors.
- New Extensions:
safeJsonEncode: A safer way to encode JSON, ensuring exceptions are handled gracefully.safeJsonDecode: A safer way to decode JSON, preventing errors with malformed or empty JSON strings.let: An extension for executing a block of code on non-null values, improving code readability.
Improvements #
- Configuration Setup: Simplified configuration setup:
- Removed any config setup except for app config related to unloaded data when using remote localization.
- Use the
instantiatemethod for managing each configuration separately.
- NetworkConfig: Added a new
removeHeadersmethod for enhanced control over network headers. - Functions Converted to Getters:
toColor: Converts a string to a color value.precacheSvgAsset: Handles precaching of SVG assets.precacheNetwork: Handles precaching of network images.precacheAsset: Handles precaching of asset images.
Bug Fixes #
- Resolved an issue with states not rendering correctly in specific scenarios.
[Beta 1.0.13] #
New Features and Enhancements #
Extensions
- Align Extensions:
- Added
alignBottomEndandalignBottomStartfor quick alignment to bottom corners.
- Added
- Positioned Extension Enhancements:
- Updated
PositionedExtensionto utilizePositionedDirectionalinstead ofPositioned, ensuring better support forTextDirectionin layouts.
- Updated
Reusable Widgets
- AutoScrollWhenFocused:
- Ensures a child widget scrolls into view when it gains focus.
- ExpandableText:
- Displays text with a "Read more/Read less" toggle for better readability in constrained layouts.
- FlexibleGridView:
- A dynamic
GridViewthat adjusts to the height of its children.
- A dynamic
- FlexibleListView:
- Displays a scrollable list of items with dynamically varying heights.
- HideOnScroll:
- Animates visibility of a child widget based on scroll direction, perfect for headers or floating action buttons.
- IndexScroller:
- Provides functionality to scroll to a specific index in a list effortlessly.
- LazyIndexedStack:
- Enhanced with transition duration customization for smoother animations.
- TopScroller:
- Listens for and responds to scroll-to-top gestures, improving navigation flow.
Helper Classes
- AsyncHelper:
- Added utilities for managing asynchronous tasks:
executeSequentially: Ensures tasks execute in sequence without overlap.catchAnimationCancel: Gracefully handlesTickerCanceledexceptions in animations.
- Added utilities for managing asynchronous tasks:
- ClipboardHelper:
- Simplified interaction with the system clipboard:
copyText: Copies a string to the clipboard, with error handling for empty strings.pasteText: Retrieves plain text from the clipboard.copyWithResult: Provides a boolean result indicating success or failure of the copy operation.getClipboardData: Fetches rawClipboardDatafor advanced use cases.
- Simplified interaction with the system clipboard:
- SnapScrollSize:
- Introduced a custom
ScrollPhysicsfor snapping scroll positions to a fixed interval. - Features include:
- Smooth snapping animations.
- Support for velocity-based adjustments.
- Seamless integration with existing scrolling mechanisms.
- Introduced a custom
General Improvements #
- Code Refactoring:
- Optimized logic in reusable components to improve maintainability and performance.
- Enhanced Documentation:
- Comprehensive examples and usage guides for new additions, ensuring easier adoption.
[Beta 1.0.12] #
New Features and Enhancements #
- New Extension: Added the
PositionedExtensionfor improved widget positioning.- Provides utility methods:
positioned: Wraps a widget withPositionedDirectionalfor precise positioning.positionedFill: Wraps a widget withPositioned.fillfor edge-to-edge placement.positionedDirectional: Wraps a widget withPositioned.directionalto support text direction forstartandendpositions.
- Includes detailed documentation and examples for easy usage.
- Provides utility methods:
- Enhancements to Existing Extensions:
- Updated and refined older extensions for better consistency and usability.
- Code Refactor:
- Improved
LazyIndexedStackto stop unnecessary rebuilding of child widgets, optimizing performance.
- Improved
[Beta 1.0.11] #
Code Optimizations and Documentation Updates #
- Documentation Update: Enhanced documentation with clearer examples and more detailed explanations for new widgets and extensions.
[Beta 1.0.10] #
Enhancements and New Features #
- LazyIndexedStack Widget: Introduced
LazyIndexedStackfor optimized performance by deferring the loading of non-visible children. - SizedBox Extension: Added extensions for more flexible
SizedBoxcreation with methods likewidth,height,box,expand,alignedBox,paddedBox, andflexible. - SVG Widget Customization: Enhanced the customization options for
SvgWidget, allowing for more flexible and efficient use in applications.
[Beta 1.0.9] #
Enhancements and New Features #
- App Bar Logic: Handle app bar selection based on
scaffoldConfigandappBarData. - ScaffoldConfig: Added
copyWithmethod for easier object modification. - BlocProvider Fix: Corrected baseContext issue.
- Widget Extensions: Added
expandedandflexibleextensions for better layout handling. - Content Builder: Enhanced functionality.
- NullNonRenderState: Added
NullNonRenderStateclass.
[Beta 1.0.8] #
Minor Updates #
- Code Refinement: Improved internal code structure for better maintainability and readability.
[Beta 1.0.7] #
Enhancements and New Features #
AlignmentExtension: Added alignment methods likealignTopStart,alignCenter, etc., to easily align widgets using theAlignwidget.CenterExtension: Introduced thecentergetter to simplify centering widgets within their parent using theCenterwidget.EmptyPadding: Added shorthand methodsphfor vertical andpwfor horizontal padding, making it easier to add padding to widgets.PaddingExtension: Enhanced with methods for custom directional padding (paddingOnly), uniform padding (paddingAll), and symmetric padding (paddingSymmetric).VisibilityExtension: Added theanimatedOpacitymethod to toggle visibility with animation, allowing widgets to fade in/out.
Improvements #
- AppBarConfig: Enhanced the
AppBarConfigwith additional properties to customize app bars further. - Leading Widget: Improved handling of the
LeadingWidgetinCoreAppBarfor better consistency. - CoreAppBar: Polished and refined the
CoreAppBarfor a more consistent and efficient experience.
[Beta 1.0.6] #
Improvements #
- Enhanced code formatting for better readability.
- Fixed all warnings and analysis issues for a cleaner codebase.
[Beta 1.0.5] #
Enhancements and New Features #
- Updated Dependencies: Upgraded the package dependencies to ensure compatibility, security, and performance improvements.
SvgWidgetEnhancements: Made thetypeparameter required, ensuring more robust and predictable behavior when using theSvgWidget.CoreSheetImprovements: Added aSafeAreato the child ofCoreSheet, enhancing the user interface by preventing content from being obscured by system UI elements.- Theme Extension: Introduced a new
ThemeExtensionto provide developers with an extended theming capability, enabling more customized and consistent styling across the application.
Fixes #
CoreAssetsIssue Resolved: Fixed an issue withCoreAssetspaths to ensure proper resolution and loading of assets when the package is used in other projects.
[Beta 1.0.4] #
Enhancements and New Features #
ArabicToEnglishNumberFormatter: Added a utility for converting Arabic numerals to English numerals for consistent number formatting across locales.ScrollBehaviorHelper: Introduced a custom implementation ofMaterialScrollBehaviorto provide platform-specific scroll physics. This improves the scrolling experience on iOS, Android, macOS, and other platforms.LifecycleEventHelper: A new class that observes app lifecycle changes, enabling developers to run custom actions when the app is resumed or suspended. It provides optionalresumeCallBackandsuspendingCallBackparameters for handling specific lifecycle states.- Download Method Enhancement: Fixed an issue with the
HTTPMethod.downloadcase in the Dio integration, including improved handling of download progress through theonReceiveProgresscallback. - Fixed
onSendProgressIssue: Resolved issues with tracking upload progress in the DioonSendProgresscallback. AfterLayoutMixin: Introduced a mixin to trigger actions after the first layout of a widget has been rendered. This ensures that layout-dependent logic is executed after the widget tree has been fully built.- Safe List Value Fix: Corrected issues with safe access to list values, ensuring null safety and preventing runtime errors.
- Enhanced
ContentBuilderandBaseScreen: Improved handling of content rendering and base screen management to optimize app flow and usability. - Enhanced
CoreSetup: Refined theCoreSetupclass by incorporating theAfterLayoutMixinto manage the configuration initialization process more effectively. The_initializeConfigurationsmethod now allows the use ofonBeforeConfigApplyfor handling actions before configuration is applied.
Improvements #
- Default Scroll Behavior: The
ScrollBehaviorHelperis now the default class for scroll behavior, enhancing scrolling performance with platform-specific optimizations. - Configuration Handling: Added
checkerboardRasterCacheImages,checkerboardOffscreenLayers,showPerformanceOverlay,locale,scaffoldMessengerKey, andscrollBehavioras configurable options inCoreSetupto allow fine-grained control over app behavior and performance. - Improved Config Initialization: The
CoreSetupclass now supports more flexible configuration management by providing hooks likeonBeforeConfigApply, ensuring that configurations are applied in a structured, sequence-sensitive manner.
Fixes #
- Improved Error Handling: Addressed minor issues in the error-handling logic, ensuring more robust behavior when handling edge cases and null values.
- Resolved Layout Timing Issues: Fixed issues with the timing of layout-dependent operations using
AfterLayoutMixin, ensuring smoother UI rendering.
[Beta 1.0.3] #
Enhancements and New Features #
- Integrated dependencies into the package export to simplify usage. These dependencies can now be accessed directly through the package, eliminating the need for separate installations:
flutter_bloctalkertalker_dio_loggerdiobot_toastfont_awesome_flutterlottieequatableflutter_svginternet_connection_checker_plusconnectivity_pluscached_network_imagemodal_bottom_sheet
Improvements #
- Simplified the developer experience by bundling common dependencies into the package, making it easier to set up and use.
Fixes #
- Minor adjustments to the package structure to improve compatibility with bundled dependencies.
[Beta 1.0.2] #
Enhancements and New Features #
- Added comprehensive documentation for all string-related extensions, improving clarity and ease of use.
- Enhanced error handling in string formatting extensions to ensure robust and fail-safe operations.
- Improved Arabic to English number conversion logic ensuring better handling of edge cases.
- Refactored formatPrice method for better performance and readability.
- Streamlined the formatDate method to handle malformed date strings gracefully.
Fixes #
- Fixed minor inconsistencies in null-checking logic for nullable strings.
- Resolved an issue where invalid date strings would not default to the current date properly.
[Beta 1.0.1] #
Enhancements and Optimizations #
- Improved code quality by addressing warnings and enhancing linting rules to comply with best practices.
- Optimized the code for better performance, including refactoring certain components and reducing redundant logic.
- Enhanced analyzer warnings to ensure better detection of potential issues, improving code maintainability.
- Added Example to demonstrate the package’s structure and usage, making it easier for developers to understand and integrate the package into their projects.
- Made minor UI adjustments to enhance the user experience in various components.
- Improved documentation for better understanding of the package's architecture and future extensibility.
[Beta 1.0.0] #
Initial Release (Beta) #
- Initial version of the package, laying the foundation for future development.
- Introduced core functionality for OptiCore, including essential components for UI state management, error handling, and animations.
- Released a structured, scalable architecture designed to accommodate future feature enhancements and optimizations, with placeholders for upcoming improvements.