dreamic 0.0.11
dreamic: ^0.0.11 copied to clipboard
A general-purpose package for Flutter/Firebase apps.
0.0.11 #
Added #
- Test Utilities - New testing support for widgets that use Dreamic components
- Added
MockAppCubitclass for widget testing with configurable network, auth, and app states - Added
initializeTappableActionForTesting()to prevent timer-related test failures - Added
wrapWithMockAppCubit()helper for easy test setup with BlocProvider - Exported test utilities from main package for consumer access
- Supports dynamic state changes during tests via setter methods
- Added
Documentation #
- TESTING_GUIDE.md - Comprehensive testing guide with examples for:
- Testing TappableAction widgets with various configurations
- Testing network-dependent features and state transitions
- Testing authentication-dependent features
- Testing loading states and error scenarios
- Advanced patterns including async operations, golden tests, and complex state combinations
- Complete working examples and common issue solutions
- DREAMIC_FEATURES_GUIDE.md - Added Testing section with quick start guide and best practices
- SETUP_NEW_PROJECT.md - Renamed from SETUP_DREAMIC.md for clarity
0.0.10 #
Fixed #
- Test Compatibility - Logger and AppConfigBase now handle GetIt not being initialized (e.g., in test environments)
- Added try-catch blocks to safely handle cases where RemoteConfigRepoInt is not available
- Logger defaults to debug level when AppConfigBase.logLevel cannot be retrieved
- Prevents crashes when using logging utilities in unit tests without full app initialization
0.0.9 #
Changed #
- Reduced Log Verbosity - Version checking and app lifecycle logs now use verbose level (
logv) instead of debug level (logd)- App resume/pause lifecycle events moved to verbose logging
- Version check details and comparisons moved to verbose logging
- Remote Config status checks moved to verbose logging
- Only critical events remain at debug level: actual version updates (required/recommended) and Remote Config changes
- Significantly reduces log noise during normal app operation
0.0.8 #
Fixed #
- Web Platform Logging - Logger now uses
print()instead ofdebugPrint()in release mode on web to ensure logs appear in browser console (debugPrint is compiled away in release builds) - Firebase Crashlytics Web Support - Added platform checks to prevent runtime errors on web where Crashlytics is not supported
Changed #
- Error Reporting Configuration - Added detailed configuration logging in
appInitErrorHandling()to help verify error reporting setup - Firebase Initialization - Removed automatic Firebase initialization from
appInitErrorHandling(). Firebase must now be initialized viaappInitFirebase()first when using Crashlytics
Documentation #
- Updated ERROR_REPORTING_GUIDE.md with Quick Start Checklist and clearer Sentry integration best practices
- Enhanced error_reporter_example.dart with step-by-step integration examples
0.0.7 #
Documentation #
- Updated ERROR_REPORTING_GUIDE.md and error_reporter_example.dart with improved Sentry integration examples
0.0.6 #
Added #
- EnvironmentType Enum - Type-safe environment configuration
- New
EnvironmentTypeenum with five values:emulator,development,test,staging,production AppConfigBase.environmentTypenow returns enum type instead of string- Added
AppConfigBase.environmentTypeStringconvenience getter for string value - Includes
fromString()method for parsing--dart-definevalues - Provides IDE autocomplete support and compile-time type checking
- Exhaustive switch statement checking for better code safety
- New
- Centralized App Version Methods in
AppConfigBasegetAppVersion()- Returns cachedPackageInfoinstancegetAppVersionString()- Returns version string (e.g., "1.0.0")getAppBuildNumber()- Returns build number string (e.g., "42")getAppRelease()- Returns formatted release string (e.g., "my-app@1.0.0+42")- Cached implementation for better performance
- Works correctly on Flutter Web where
PackageInfocan have issues
- Exported AppConfigBase in main library file (
dreamic.dart)- Makes
AppConfigBaseandEnvironmentTypeavailable to package users
- Makes
Changed #
- Updated Sentry Integration Documentation - Comprehensive updates across all docs
- All examples now use Sentry's recommended
appRunnerpattern withSentryFlutter.init() - Integrated
appRunIfValidVersion()in allappRunnerexamples for automatic version checking - Updated
ERROR_REPORTING_GUIDE.mdwith three clear integration approaches:- Approach A:
appRunner(RECOMMENDED) - Simplest, no custom ErrorReporter needed - Approach B:
appRunnerwith Dreamic Config - For integration with Dreamic's configuration system - Approach C: Manual Integration (Advanced) - Full control with ErrorReporter interface
- Approach A:
- Updated
DREAMIC_FEATURES_GUIDE.mdwith complete examples usingappRunnerand version checking - Updated
error_reporter_example.dartwith detailed documentation for all three approaches - All examples now use
AppConfigBase.environmentType.valueandAppConfigBase.getAppRelease()
- All examples now use Sentry's recommended
- Centralized Version Information - Refactored to use
AppConfigBasemethods- Updated
app_version_check.dartto useAppConfigBase.getAppVersion() - Updated
app_version_update_service.dartto use centralized version method - Updated
app_cubit.dartto use centralized version method - Updated
app_update_debug_widget.dartto useAppConfigBase.getAppVersionString() - Removed duplicate
package_info_plusimports across 5 files
- Updated
Fixed #
- Environment Configuration - More flexible and type-safe
- Environment type now supports all standard environments (emulator, dev, test, staging, prod)
- Backward compatible with existing
--dart-define=ENVIRONMENT_TYPE=valueconfiguration - Smart defaults:
developmentin debug mode,productionin release mode
Documentation #
- ERROR_REPORTING_GUIDE.md
- Added "Build Configuration (dart-define)" section with ENVIRONMENT_TYPE documentation
- Restructured Sentry Integration section with clear approach comparisons
- Added examples showing
appRunIfValidVersion()integration - Updated all code examples to use type-safe
EnvironmentTypeenum - Added troubleshooting section for wrapper-based setup
- DREAMIC_FEATURES_GUIDE.md
- Added environment type documentation with enum examples
- Updated all Sentry examples to show
appRunnerpattern - Added "Complete Example" sections showing recommended patterns
- Updated build configuration examples with proper environment and release usage
Notes #
- 100% Backward Compatible - All existing code continues to work
- String values via
--dart-define=ENVIRONMENT_TYPE=productionstill work exactly the same - Existing error reporting configurations unchanged
- No breaking changes to any APIs
- String values via
- Migration Path - Easy upgrade from string to enum
- Use
.valueproperty to get string value when needed - Use
environmentTypeStringgetter as convenience method - Existing configurations work without modification
- Use
0.0.5 #
Added #
- BaseFirestoreModel - New abstract base class for intelligent Firebase serialization
- Context-aware serialization (Firestore, Cloud Functions, local storage)
- Separate methods for create vs update operations (
toFirestoreCreate(),toFirestoreUpdate()) - Support for data migration with
toFirestoreRaw() - Cloud Functions integration with
toCallable() - Configurable timestamp field management
- Custom post-processing hooks
- SmartTimestampConverter - Enhanced timestamp converter supporting multiple formats
- Handles Firestore Timestamp objects
- Supports Cloud Functions Map format
- Works with milliseconds and ISO strings
- Nullable and non-nullable variants
- ConnectionToaster - Optional network status toast notifications
- Shows "Connecting..." toast when network connection is lost
- Automatically dismisses when connection is restored
- Smart behavior: doesn't show during app startup/resume by default
- Configurable delay before showing toast (defaults to immediate)
- Optional
showOnInitialConnectionflag for showing during app load - Integrated into
AppRootWidgetas opt-in feature
- Comprehensive documentation in
docs/- Complete usage guide with examples (
MODEL_SERIALIZATION_GUIDE.md) - Embedded example models covering different use cases
- Service implementations with real-world patterns (CRUD, batch operations, transactions, and more)
- Complete usage guide with examples (
Changed #
- Enhanced
model_converters.dartwith new Smart converters - Exported data models and converters in main library file
- AppRootWidget now supports optional
ConnectionToasterintegration- Added
useConnectionToasterparameter (defaults tofalsefor backward compatibility) - Added
showConnectionToastOnInitialConnectionparameter to control toast behavior during app startup - Added
connectionToastDelayparameter for customizing toast display timing - ConnectionToaster wraps entire app content at top level when enabled, ensuring toasts appear above all UI
- Added
Notes #
- 100% Backward Compatible - All existing converters continue to work exactly as before
- No breaking changes to existing APIs
- New features are opt-in only
- Both old and new approaches can coexist in the same project
0.0.4 #
- Upgraded dependencies
0.0.3 #
- Initial public release.