ClassificationScreen class

Main screen for mosquito species classification and identification.

This screen provides a comprehensive interface for users to:

  • Image Selection: Choose images from camera or gallery for analysis
  • AI Processing: Real-time classification with progress indicators
  • Results Display: Show species information, confidence scores, and inference timing
  • Disease Assessment: Access detailed information about associated disease risks
  • Research Contribution: Submit observations with location data and notes

State Management Architecture

The screen uses the Provider pattern with ClassificationViewModel to manage complex state transitions and business logic. State flow includes:

Initial → Image Selected → Processing → Results → Submission
   ↓           ↓             ↓          ↓          ↓
Empty UI → Preview → Loading → Species → Success

UI State Handling

The screen dynamically adapts its interface based on current state:

  • Empty State: Shows upload hints and action buttons
  • Image Preview: Displays selected image with analyze button
  • Processing State: Shows loading indicator with progress message
  • Results State: Rich display of classification results and actions
  • Submission State: Success confirmation with submission details
  • Error State: User-friendly error messages with retry options

Interactive Elements

  • Action Buttons: Camera, gallery, and reset functionality
  • Result Cards: Expandable cards with species and disease information
  • Navigation: Deep links to species and disease detail screens
  • Bottom Sheets: Modal disease risk information display
  • Form Integration: Observation submission with location and notes

Key Features:

  • Responsive image capture and selection
  • Real-time AI classification processing
  • Comprehensive disease risk assessment
  • Research-grade observation submission with metadata
Inheritance

Constructors

ClassificationScreen({Key? key})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build(BuildContext context) Widget
Builds the main UI for the classification screen.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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