我的页面开发ui
This commit is contained in:
@@ -16,6 +16,22 @@ class TopStatusBar extends StatelessWidget {
|
||||
// 监听全局设备状态
|
||||
final deviceState = context.watch<DevicesCubit>().state;
|
||||
final device = deviceState.selectedDevice;
|
||||
ControlMode _parseControlMode(String modeString) {
|
||||
switch (modeString.toUpperCase()) {
|
||||
case 'BLE':
|
||||
return ControlMode.BLE;
|
||||
case 'LOCAL':
|
||||
return ControlMode.LOCAL;
|
||||
case 'TCP':
|
||||
return ControlMode.TCP;
|
||||
case 'NONE':
|
||||
return ControlMode.NONE;
|
||||
case 'OTHER':
|
||||
return ControlMode.OTHER;
|
||||
default:
|
||||
return ControlMode.NONE;
|
||||
}
|
||||
}
|
||||
|
||||
// 监听局部遥控状态
|
||||
final remoteState = context.watch<RemoteControlCubit>().state;
|
||||
@@ -61,7 +77,7 @@ class TopStatusBar extends StatelessWidget {
|
||||
const Spacer(),
|
||||
|
||||
// TODO
|
||||
_buildControlModeChip(,remoteState.runningStatusModel.controlMode),
|
||||
_buildControlModeChip( _parseControlMode(remoteState.runningStatusModel.controlMode)),
|
||||
|
||||
const SizedBox(width: 8),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user