import 'package:flutter/material.dart';
import 'package:flutterflow_ui/flutterflow_ui.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/model/BleDeviceData.dart';

class DoubleBlueteethDeviceCompoentWidget extends StatefulWidget {
  final BleDeviceData masterDevice; // 主设备
  final BleDeviceData? slaveDevice; // 从设备（可为空）

  // 构造函数，接受参数
  const DoubleBlueteethDeviceCompoentWidget({
    super.key,
    required this.masterDevice,
    this.slaveDevice,
  });

  @override
  State<DoubleBlueteethDeviceCompoentWidget> createState() =>
      _DoubleBlueteethDeviceCompoentWidgetState();
}

class _DoubleBlueteethDeviceCompoentWidgetState
    extends State<DoubleBlueteethDeviceCompoentWidget> {
  @override
  void setState(VoidCallback callback) {
    super.setState(callback);
  }

  @override
  void initState() {
    super.initState();
  }

  @override
  void dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      width: double.infinity,
      decoration: BoxDecoration(
        color: Color(0xFF242835),
        borderRadius: BorderRadius.circular(20.rpx),
      ),
      child: Padding(
        padding: EdgeInsetsDirectional.fromSTEB(30.rpx, 36.rpx, 0, 52.rpx),
        child: Column(
          mainAxisSize: MainAxisSize.max,
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Container(
              width: double.infinity,
              decoration: BoxDecoration(),
              child: Text(
                'AITH-V3',
                style: TextStyle(
                  fontFamily: 'Inter',
                  color: Color(0xFFF6FAFD),
                  fontSize: 30.rpx,
                  letterSpacing: 0.0,
                ),
              ),
            ),
            Container(
              width: double.infinity,
              decoration: BoxDecoration(),
              child: Row(
                mainAxisSize: MainAxisSize.max,
                children: [
                  Text(
                    '信号强度：-36dBm',
                    style: TextStyle(
                      fontFamily: 'Inter',
                      color: Color(0xFFEBF2F8),
                      fontSize: 26.rpx,
                      letterSpacing: 0.0,
                    ),
                  ),
                  Text(
                    'SN：12',
                    style: TextStyle(
                      fontFamily: 'Inter',
                      color: Color(0xFFF5F9FD),
                      fontSize: 26.rpx,
                      letterSpacing: 0.0,
                    ),
                  ),
                ].divide(SizedBox(width: 40.rpx)),
              ),
            ),
            Container(
              width: double.infinity,
              decoration: BoxDecoration(),
              child: Text(
                '蓝牙地址：48:CA:43:B1:B3:B2',
                style: TextStyle(
                  fontFamily: 'Inter',
                  color: Color(0xFFF6FAFD),
                  fontSize: 26.rpx,
                  letterSpacing: 0.0,
                ),
              ),
            ),
            Container(
              width: double.infinity,
              decoration: BoxDecoration(),
              child: Text(
                'mac：48CA43B1B3B0',
                style: TextStyle(
                  fontFamily: 'Inter',
                  color: Color(0xFFF6FAFD),
                  fontSize: 26.rpx,
                  letterSpacing: 0.0,
                ),
              ),
            ),
            Container(
              width: double.infinity,
              decoration: BoxDecoration(),
              child: Row(
                mainAxisSize: MainAxisSize.max,
                children: [
                  Text(
                    '网络：在线',
                    style: TextStyle(
                      fontFamily: 'Inter',
                      color: Color(0xFFEBF2F8),
                      fontSize: 26.rpx,
                      letterSpacing: 0.0,
                    ),
                  ),
                  Row(
                    mainAxisSize: MainAxisSize.max,
                    children: [
                      Text(
                        '传感器：',
                        style: TextStyle(
                          fontFamily: 'Inter',
                          color: Color(0xFFEBF2F8),
                          fontSize: 26.rpx,
                          letterSpacing: 0.0,
                        ),
                      ),
                      Text(
                        '可绑定',
                        style: TextStyle(
                          fontFamily: 'Inter',
                          color: Color(0xFF1AD2B5),
                          fontSize: 26.rpx,
                          letterSpacing: 0.0,
                        ),
                      ),
                    ],
                  ),
                ].divide(SizedBox(width: 145.rpx)),
              ),
            ),
            Container(
              width: double.infinity,
              decoration: BoxDecoration(),
              child: Text(
                '版本：02409.0301',
                style: TextStyle(
                  fontFamily: 'Inter',
                  color: Color(0xFFF6FAFD),
                  fontSize: 26.rpx,
                  letterSpacing: 0.0,
                ),
              ),
            ),
            Divider(
              thickness: 2.rpx,
              color: Colors.white,
            ),
            Container(
              width: double.infinity,
              decoration: BoxDecoration(),
              child: Text(
                'AITH-V3',
                style: TextStyle(
                  fontFamily: 'Inter',
                  color: Color(0xFFF6FAFD),
                  fontSize: 30.rpx,
                  letterSpacing: 0.0,
                ),
              ),
            ),
            Container(
              width: double.infinity,
              decoration: BoxDecoration(),
              child: Row(
                mainAxisSize: MainAxisSize.max,
                children: [
                  Text(
                    '信号强度：-36dBm',
                    style: TextStyle(
                      fontFamily: 'Inter',
                      color: Color(0xFFEBF2F8),
                      fontSize: 26.rpx,
                      letterSpacing: 0.0,
                    ),
                  ),
                  Text(
                    'SN：12',
                    style: TextStyle(
                      fontFamily: 'Inter',
                      color: Color(0xFFF5F9FD),
                      fontSize: 26.rpx,
                      letterSpacing: 0.0,
                    ),
                  ),
                ].divide(SizedBox(width: 40.rpx)),
              ),
            ),
            Container(
              width: double.infinity,
              decoration: BoxDecoration(),
              child: Text(
                '蓝牙地址：48:CA:43:B1:B3:B2',
                style: TextStyle(
                  fontFamily: 'Inter',
                  color: Color(0xFFF6FAFD),
                  fontSize: 26.rpx,
                  letterSpacing: 0.0,
                ),
              ),
            ),
            Container(
              width: double.infinity,
              decoration: BoxDecoration(),
              child: Text(
                'mac：48CA43B1B3B0',
                style: TextStyle(
                  fontFamily: 'Inter',
                  color: Color(0xFFF6FAFD),
                  fontSize: 26.rpx,
                  letterSpacing: 0.0,
                ),
              ),
            ),
            Container(
              width: double.infinity,
              decoration: BoxDecoration(),
              child: Row(
                mainAxisSize: MainAxisSize.max,
                children: [
                  Text(
                    '网络：在线',
                    style: TextStyle(
                      fontFamily: 'Inter',
                      color: Color(0xFFEBF2F8),
                      fontSize: 26.rpx,
                      letterSpacing: 0.0,
                    ),
                  ),
                  Row(
                    mainAxisSize: MainAxisSize.max,
                    children: [
                      Text(
                        '传感器：',
                        style: TextStyle(
                          fontFamily: 'Inter',
                          color: Color(0xFFEBF2F8),
                          fontSize: 26.rpx,
                          letterSpacing: 0.0,
                        ),
                      ),
                      Text(
                        '可绑定',
                        style: TextStyle(
                          fontFamily: 'Inter',
                          color: Color(0xFF1AD2B5),
                          fontSize: 26.rpx,
                          letterSpacing: 0.0,
                        ),
                      ),
                    ],
                  ),
                ].divide(SizedBox(width: 145.rpx)),
              ),
            ),
            Container(
              width: double.infinity,
              decoration: BoxDecoration(),
              child: Text(
                '版本：02409.0301',
                style: TextStyle(
                  fontFamily: 'Inter',
                  color: Color(0xFFF6FAFD),
                  fontSize: 26.rpx,
                  letterSpacing: 0.0,
                ),
              ),
            ),
          ].divide(SizedBox(height: 37.rpx)),
        ),
      ),
    );
  }
}
