import 'package:flutter/foundation.dart'; import 'uploader.dart'; enum RegistrationState { idle, registering, success, failed } /// Live aircraft/session state, shared by the Go Fly launch screen and the /// Flight Control overlay. [_HomePageState] owns the DJI/uploader plumbing and /// pushes updates here; the screens observe it via [AnimatedBuilder]. class FlightModel extends ChangeNotifier { String sdkVersion = '…'; RegistrationState registration = RegistrationState.idle; String? registrationError; bool connected = false; String? model; int? satellites; bool? isFlying; String? flightMode; double? altitude; double? latitude; double? longitude; // Phone's own GPS (independent of the drone's fix above); streamed to the // server as a location fallback for the Web App's automatic bounding box. double? phoneLatitude; double? phoneLongitude; int? batteryPercent; UploadStatus upload = UploadStatus.disabled; bool get registered => registration == RegistrationState.success; /// Notify observers after a batch of field writes. void bump() => notifyListeners(); }