milsat_modules_flutter 1.3.4
milsat_modules_flutter: ^1.3.4 copied to clipboard
Comprehensive Flutter package for geospatial data collection systems. Includes user management, dynamic form rendering, data export/sync, and hierarchical location services with Clean Architecture.
1.3.3 - 2025-12-18 #
Bug Fixes & Code Quality #
- FIXED: Removed debug print statements from
TokenRefreshInterceptorfor cleaner production code - FIXED: Removed debug print statements from
DataService._saveConfigToDatabasefor cleaner code - FIXED: Corrected endpoint name for IntelligenceWallet TransferIUnit in ppqEndpoints list
API Endpoints #
- ADDED: IntelligenceWallet TransferIUnits endpoint to ppqEndpoints list for proper token refresh handling
- ENHANCED: Expanded ppqEndpoints list with comprehensive API endpoint coverage including:
- Authentication endpoints (login, logout, token refresh)
- Profile management endpoints
- OTP verification endpoints
- File handling endpoints
- Intelligence wallet endpoints
- Payment services endpoints
- Nigeria dataset endpoints
Debugging & Developer Experience #
- ADDED: Debug logging to
DataServicefor improved database operation visibility during development - ADDED: Debug logging to
AuthTokenManagerfor better token management visibility - ADDED: Debug logging to
TokenRefreshInterceptorfor token handling and request processing insights
Data Service #
- ADDED: Optional
skipWorkFrameCheckparameter toDataService.importConfig()for flexible work frame validation - ENHANCED: Work frame validation can now be bypassed when needed for special use cases
Error Handling #
- IMPROVED: Enhanced error handling in
TokenRefreshInterceptorwith safe null checks - IMPROVED: Enhanced
AuthResponsemodel with safe null checks to prevent runtime errors
1.3.1 - 2025-12-16 #
Network & Configuration #
- ADDED:
ModulesConfig.getApiClient()- Centralized access to ApiClient instance - ENHANCED: Exposed ApiClient through ModulesConfig instead of UserConfig for better separation of concerns
- IMPROVED: Network service integration with proper dependency injection access
Authentication #
- ENHANCED: Dual auth support (PPQ/Enum) with dynamic endpoint selection
- ADDED:
usePpqAuthflag to ModulesConfig for auth provider switching (default: true) - IMPROVED: Token refresh interceptor supports both PPQ (
api/connect/token) and Enum (connect/token) endpoints - ENHANCED: AuthTokenManager with dynamic refresh token body generation based on auth provider
- ADDED: Client credentials (client_id/client_secret) support for Enum auth provider
- IMPROVED: Logout functionality across all layers (data source, repository, service)
Breaking Changes:
ModulesConfig.initialize()now accepts optionalusePpqAuthparameter (defaults to true for backward compatibility)
Migration Guide:
// For PPQ auth (default - no change needed)
await ModulesConfig.initialize(
baseUrl: 'your-base-url',
ppqBaseUrl: 'your-ppq-url',
);
// For Enum/Standard auth
await ModulesConfig.initialize(
baseUrl: 'your-base-url',
ppqBaseUrl: 'your-ppq-url',
usePpqAuth: false,
);
// Access ApiClient
final apiClient = ModulesConfig.getApiClient();
1.3.0 - 2025-11-09 #
Authentication & Token Management #
- NEW: Automatic token refresh interceptor for Dio HTTP client
- NEW:
AuthTokenManager- Centralized token management with expiry tracking - NEW:
TokenRefreshInterceptor- Proactive token refresh before expiration - ENHANCED: Token storage with expiry time calculation
- ENHANCED: Refresh token support in auth responses
- IMPROVED: Session management with automatic token renewal (60-second buffer before expiry)
- ADDED: Mutex-based thread-safe token refresh to prevent concurrent refresh attempts
Technical Details:
- Token refresh happens automatically before API requests if token expires within 60 seconds
- Handles 401 errors with automatic retry after token refresh
- Clears tokens gracefully on refresh failure
- Updated
SharedPrefKeyswithrefreshTokenandtokenExpiryTimekeys - Updated
AuthResponsemodel to include refresh token field - Integration with unified
ApiClientfor all network requests
Form Widget Optimizations #
- FIXED: Date picker widget - Proper conditional execution on initial values
- FIXED: Time picker widget - Proper conditional execution on initial values
- FIXED: Signature widget - Proper conditional execution on initial values
- FIXED: Picture widget - Proper conditional execution on initial values
- ENHANCED: All form widgets now use
TextEditingControllerfor proper state management (date/time pickers) - IMPROVED: Conditional logic execution timing - no longer triggers before dependent widgets are created
- ADDED:
_setContentWithoutConditionals()method for initial load without side effects - ADDED:
_executeConditionalsNow()method for deferred conditional execution - ADDED:
_needsConditionalExecutionflag to track when conditionals should run - ENHANCED: All form widgets now properly handle
mountedchecks in setState calls - IMPROVED: Widget lifecycle management with proper disposal and state updates
Widget-Specific Changes:
- Date Picker: Now uses controller instead of initialValue for dynamic updates
- Time Picker: Now uses controller instead of initialValue, removed unnecessary parameters
- Signature & Picture: Optimized conditional execution without controllers (as intended)
Technical Pattern:
// Conditionals execute in postFrameCallback for initial values
if (_needsConditionalExecution) {
WidgetsBinding.instance.addPostFrameCallback((_) {
if (mounted) _executeConditionalsNow();
});
}
// Conditionals execute immediately for user actions
widget.field.conditionals?.forEach((conditional) {
_executeConditionals?.call(conditional);
});
Bug Fixes #
- FIXED: Form widgets triggering conditionals during initialization causing dependency issues
- FIXED: Controllers not updating when values change programmatically
- FIXED: Initial values not executing conditionals after dependent widgets are ready
1.2.9 - 2025-10-31 #
Module Updates #
- ENHANCED: Various module optimizations and performance improvements
- UPDATED: Minor internal enhancements and code cleanup
- IMPROVED: General stability improvements
1.2.8 - 2025-10-28 #
Network Layer Refactor #
- REFACTORED: Major improvements to
api_client.dartandresponse_handler.dartfor better reliability and maintainability - ENHANCED: Improved request/response handling
- IMPROVED: Error handling and response parsing logic
Dependency Update #
- UPDATED: Minor dependency update in
milsat_modules_flutter.dart
Documentation #
- UPDATED: README.md with new usage examples, badges, and improved structure
- UPDATED: Changelog and pubspec.yaml for latest release
1.2.7 - 2025-10-27 #
Map Module Refactor & Enhancements #
- REFACTORED: Geometry entity now uses a strongly typed coordinates list for improved type safety
- ENHANCED: Map geometry base and polygon classes updated for new Mapbox API compatibility
- IMPROVED: Polygon and point annotation click listeners now use modern tap event handling
- ENHANCED: Centroid calculation and multi-polygon support for work area visualization
- UPDATED: Symbol generator refactored for Flutter 3.35+ and improved icon creation
- FIXED: Various annotation and geometry event handling bugs
Developer Notes #
- Refactoring improves maintainability and future extensibility of map features
- New tap event handling aligns with latest Mapbox and Flutter APIs
- Symbol generation now more robust and customizable
Bug Fixes & Improvements #
- FIXED: Label overflow issues in form widgets for better text display
- ENHANCED: Exposed data utilities in map module for better accessibility
- IMPROVED: Form presentation widget rendering and layout
Technical Details #
- Fixed text overflow in
global_widget.dartwith improved text wrapping - Exposed additional data utilities through map module exports
- Enhanced widget rendering stability
1.2.6 - 2025-10-23 #
Data Service Enhancements #
- NEW:
getSurveyById()method - Retrieve specific survey by ID - ENHANCED: Survey retrieval with improved error handling and validation
- IMPROVED: Current survey state management - automatically sets current survey when found
- ENHANCED: Survey lookup functionality with comprehensive exception handling
Technical Details #
- Added new survey lookup method with ID-based filtering
- Improved survey state management for better user experience
- Enhanced error handling for missing surveys with descriptive messages
- Optimized survey retrieval from configuration files
1.2.4 - 2025-10-23 #
Major Updates #
πΊοΈ Map Module - Complete Rewrite
- NEW: Complete Mapbox integration with
mapbox_maps_flutterdependency - NEW: Advanced geometry drawing capabilities (Point, Line, Polygon)
- NEW: Interactive map service with touch/click handling and debouncing
- NEW: Work area visualization and management
- NEW: Undo/Redo functionality for map actions using action stack
- NEW: Dynamic icon generation for map symbols and points
- NEW: Map camera controls with smooth animations
- NEW: Feature zoom and navigation capabilities
- NEW: Base map management and switching
- NEW: Memory optimization for low-end devices
- ENHANCED: Geometry validation and error handling
- ENHANCED: Clean Architecture implementation for map domain
New Map Classes:
MapService- Main map service with full Mapbox integrationMapGeometryBase,MapGeometryPolygon- Geometry drawing and managementMapActionStackManager- Undo/redo systemSymbolGenerator- Dynamic icon creation- Multiple geometry models and entities
- Comprehensive map constants and configurations
π Data Module Enhancements
- NEW:
isConfigOrSurveyImported()- Check if specific forms are imported - NEW:
getAllSurveyFormsForAParticularSurvey()- Get all forms for a survey - NEW:
getAllSurveys()- Retrieve all available surveys - ENHANCED: Better error handling and result patterns
- ENHANCED: Survey form retrieval and management
π§ Dependencies
- ADDED:
mapbox_maps_flutter: ^2.11.0for advanced mapping capabilities
ποΈ Architecture Improvements
- ENHANCED: Feature-first Clean Architecture maintained across new map module
- ENHANCED: Proper separation of concerns in map domain/data layers
- ENHANCED: Comprehensive error handling with custom exceptions
1.2.3 - 2025-09-20 #
Features & Improvements #
- ENHANCED: Form builder improvements and optimizations
- ENHANCED: Location form widgets and functionality
- ENHANCED: Network layer optimizations
- FIXED: Various bug fixes and stability improvements
1.2.2 1.2.0 - 2025-09-20 #
Authentication & User Management #
- ENHANCED: Login performance optimizations to reduce authentication time
- ENHANCED: User authentication flow improvements
- ENHANCED: Network layer optimizations for better performance
- ENHANCED: User repository and data source improvements
Form Builder Updates #
- ENHANCED: Dynamic form rendering capabilities
- ENHANCED: Form validation improvements
- ENHANCED: Widget rendering optimizations
1.1.9 1.1.0 - 2025-09-20 #
Location Services #
- ENHANCED: Location form components and functionality
- NEW: Date picker widget for location forms
- ENHANCED: Location data management
- IMPROVED: Location service reliability
Form Enhancements #
- ENHANCED: Form builder architecture
- ENHANCED: Dynamic form validation
- ENHANCED: Form widget rendering
- ENHANCED: Form data handling
1.0.9 1.0.3 - 2025-09-20 #
1.0.2 - 2025-09-16 #
User Management Expansion #
- NEW: Create account endpoint integration
- NEW: OTP (One-Time Password) creation and management
- NEW: Password reset functionality
- NEW: Enhanced user authentication flow
- ENHANCED: User service architecture
- ENHANCED: Remote data source implementations
Models & Services #
- NEW:
CreateAccountModelfor account creation - NEW:
ResetPasswordModelfor password management - ENHANCED: User repository with expanded functionality
- ENHANCED: API client improvements
1.0.1 - 2025-09-16 #
Module Configuration & Setup #
- NEW: Complete module configuration system
- ENHANCED: Dependency injection setup
- ENHANCED: Project structure organization
- ENHANCED: Build and deployment configuration
1.0.0 - 2025-09-16 #
Initial Stable Release #
This release introduces the first stable version of milsat_modules_flutter, a comprehensive Flutter package for geospatial data collection, user management, dynamic form rendering, data export/sync, and hierarchical location services. Built with feature-first Clean Architecture, each module is independent and can be used standalone or integrated together.
Core Modules
- Common Module: Shared entities, error/result models, network utilities, and configuration
- User Module: Authentication, user management, project compendium, white-label config, and verification address support
- Form Module: Dynamic form rendering, validation, conditional logic, script evaluation, and reusable UI widgets
- Data Module: Data management, export, sync, survey entities, and configuration import
- Location Module: Hierarchical location services, CSV-based data management, polling units, wards, LGAs, and more
Architecture
- Feature-first Clean Architecture: Each module follows clean architecture principles
- Dependency injection: Comprehensive DI setup with GetIt
- Modular design: All modules can be used independently or together
- Domain-driven: Each module exports domain entities, repository interfaces, and service APIs
Dependencies & Compatibility
- Flutter: Compatible with Flutter >=3.8.1
- Dart SDK: ^3.8.1
- Core Dependencies:
- Dio for HTTP client
- Flutter Bloc for state management
- GetIt for dependency injection
- Sqflite for local database
- And many more specialized packages
Testing & Documentation
- Unit Tests: Comprehensive test coverage
- Integration Tests: End-to-end testing support
- Documentation: Complete API documentation and usage examples
Assets & Resources
- CSV Data: Preloaded location data (INEC PU, NIPOST locations, zones)
- JSON Schemas: Configuration file validation schemas
- Multi-platform: Support for iOS, Android, and other Flutter platforms
See README and API documentation for detailed usage examples and integration guides.