机器状态界面UIbug修复
This commit is contained in:
@@ -18,7 +18,6 @@ class RunningStatusPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _RunningStatusPageState extends State<RunningStatusPage> {
|
class _RunningStatusPageState extends State<RunningStatusPage> {
|
||||||
|
|
||||||
final _dispatcher = sl<NetMessageDispatcher>();
|
final _dispatcher = sl<NetMessageDispatcher>();
|
||||||
late StreamSubscription<RawPacket> _sub;
|
late StreamSubscription<RawPacket> _sub;
|
||||||
|
|
||||||
@@ -90,13 +89,9 @@ class _RunningStatusPageState extends State<RunningStatusPage> {
|
|||||||
final currentDevice = deviceState.selectedDevice;
|
final currentDevice = deviceState.selectedDevice;
|
||||||
|
|
||||||
if (currentDevice != null) {
|
if (currentDevice != null) {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text("数据刷新成功!"), duration: Duration(seconds: 1)));
|
||||||
const SnackBar(content: Text("数据刷新成功!"), duration: Duration(seconds: 1)),
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text("暂无设备,无法刷新"), duration: Duration(seconds: 1)));
|
||||||
const SnackBar(content: Text("暂无设备,无法刷新"), duration: Duration(seconds: 1)),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,9 +101,7 @@ class _RunningStatusPageState extends State<RunningStatusPage> {
|
|||||||
final currentDevice = deviceState.selectedDevice;
|
final currentDevice = deviceState.selectedDevice;
|
||||||
|
|
||||||
if (currentDevice == null) {
|
if (currentDevice == null) {
|
||||||
return const Scaffold(
|
return const Scaffold(body: Center(child: Text("加载中...")));
|
||||||
body: Center(child: Text("加载中...")),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@@ -191,10 +184,7 @@ class _RunningStatusPageState extends State<RunningStatusPage> {
|
|||||||
SliverFillRemaining(
|
SliverFillRemaining(
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: const EdgeInsets.all(16),
|
margin: const EdgeInsets.all(16),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)),
|
||||||
color: Colors.white,
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
child: _isCardView ? _buildCardContentView() : _buildChartContentView(),
|
child: _isCardView ? _buildCardContentView() : _buildChartContentView(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -218,7 +208,8 @@ class _RunningStatusPageState extends State<RunningStatusPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildCardContentView() {
|
Widget _buildCardContentView() {
|
||||||
return Padding(
|
return SingleChildScrollView(
|
||||||
|
// 添加 SingleChildScrollView 使内容可滚动
|
||||||
padding: const EdgeInsets.all(20.0),
|
padding: const EdgeInsets.all(20.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
|||||||
Reference in New Issue
Block a user