HomePage class
The main home page of the CulicidaeLab application.
This stateful widget represents the primary interface that users see when opening the app. It provides a tabbed interface with five main sections:
- Home: Welcome screen with feature overview and navigation
- Classification: Camera-based mosquito identification using AI
- Gallery: Mosquito species information and visual gallery
- Diseases: Disease information related to mosquitoes
- Map: Interactive mosquito activity map (WebView)
Architecture & State Management
The widget manages navigation state using IndexedStack for efficient memory usage and state preservation across tabs. It integrates with:
- ClassificationViewModel for ML model initialization
- LocaleProvider for internationalization support
- Service locator pattern for dependency injection
Key Features
- Bottom Navigation: Five-tab navigation with custom icons
- Language Selection: Multi-language support (EN, ES, RU) via app bar menu
- Model Preloading: Automatic PyTorch Lite model initialization on startup
- Responsive Design: Gradient background and adaptive layouts
- State Preservation: Maintains state across tab switches using IndexedStack
- Error Handling: Graceful model loading failure handling
Navigation Structure
HomePage (IndexedStack)
├── Home Tab (Welcome screen with feature cards)
├── Classification Tab (ClassificationScreen)
├── Gallery Tab (MosquitoGalleryScreen)
├── Diseases Tab (DiseaseInfoScreen)
└── Map Tab (WebViewScreen)
Performance Considerations
- Uses IndexedStack to maintain widget state across navigation
- Preloads ML model asynchronously to avoid blocking UI
- Implements proper lifecycle management for model loading
- Optimizes memory usage by lazy-loading tab content
Localization Support
The screen supports multiple languages through:
- Dynamic language switching via app bar menu
- Localized navigation labels and content
- Proper text direction and formatting support
- Persistent language preference storage
See also:
- ClassificationScreen for AI-powered mosquito identification
- MosquitoGalleryScreen for species information gallery
- DiseaseInfoScreen for disease information
- LocaleProvider for language management
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- HomePage
Constructors
Properties
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _HomePageState -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited