远程遥控界面编写

This commit is contained in:
CC
2026-01-19 18:24:24 +08:00
parent 289e706337
commit 32b702fb6d
48 changed files with 1118 additions and 303 deletions

View File

@@ -7,8 +7,13 @@ import '../bloc/remote_control_cubit.dart';
class RightJoystickArea extends StatelessWidget {
final bool isLocked;
final double width;
const RightJoystickArea({super.key, required this.isLocked});
const RightJoystickArea({
Key? key,
required this.isLocked,
required this.width,
}) : super(key: key);
@override
Widget build(BuildContext context) {
@@ -22,7 +27,7 @@ class RightJoystickArea extends StatelessWidget {
duration: const Duration(milliseconds: 300),
opacity: isLocked ? 0.3 : 1.0, // 锁定后变透明/灰色
child: CCJoystick(
radius: 100, // 对应 size(200.dp)
radius: width, // 对应 size(200.dp)
axisHint: AxisHint.leftRight, // 关键:指定为左右控制
onValueChanged: (value) {
// 对应 viewModel.updateOriginX(x)
@@ -35,12 +40,12 @@ class RightJoystickArea extends StatelessWidget {
),
),
),
const SizedBox(height: 8),
const SizedBox(height: 18),
// 2. 底部文字:对应 Text("左右控制", color = Color.Gray)
const Text(
Text(
"左右控制",
style: TextStyle(
color: Colors.grey,
color: Colors.white.withValues(alpha: 0.5),
fontSize: 12,
fontWeight: FontWeight.w500,
),