import 'package:fis_i18n/i18n.dart';
import 'package:fis_theme/theme.dart';
import 'package:fis_ui/index.dart';
import 'package:flutter/material.dart';
import 'package:flyinsono/architecture/define.dart';

import 'index.dart';

/// 远程诊断
class RemoteMaintenancePage extends FisView<RemoteMaintenanceController> {
  const RemoteMaintenancePage({Key? key}) : super(key: key);

  FWidget _buildOuterBox() {
    return FContainer(
      margin: EdgeInsets.all(5),
      decoration: BoxDecoration(
        border: Border.all(
          color: FTheme.ins.colorScheme.line,
        ),
        borderRadius: BorderRadius.circular(4),
      ),
      child: FColumn(
        children: [
          FRow(
            children: [
              FIcon(
                Icons.tune_rounded,
                color: FTheme.ins.colorScheme.primary,
              ),
              FText(i18nBook.realTimeConsultation.probesAndApplications.t),
            ],
          ),
          FAlign(
            alignment: Alignment.centerLeft,
            child: FWrap(
              spacing: 5,
              runAlignment: WrapAlignment.start,
              runSpacing: 5,
              children: [
                FContainer(
                  alignment: Alignment.center,
                  color: Colors.amberAccent,
                  height: 30,
                  width: 70,
                  child: FText(
                    'F4-12L',
                    textAlign: TextAlign.center,
                    style: TextStyle(
                      color: Colors.white,
                    ),
                  ),
                ),
              ],
            ),
          ),
          FDivider(),
          FAlign(
            alignment: Alignment.centerLeft,
            child: FWrap(
              spacing: 5,
              runAlignment: WrapAlignment.start,
              runSpacing: 5,
              children: [
                FContainer(
                  alignment: Alignment.center,
                  height: 30,
                  width: 70,
                  child: FText(
                    'F4-12L',
                    textAlign: TextAlign.center,
                    style: TextStyle(
                      color: Colors.white,
                    ),
                  ),
                ),
              ],
            ),
          ),

          // FExpanded(child: )
        ],
      ),
    );
  }

  @override
  FWidget build(BuildContext context) {
    return FRow(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        FExpanded(
          child: FColumn(
            crossAxisAlignment: CrossAxisAlignment.end,
            children: [
              FContainer(
                height: 150,
                child: FRow(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    FContainer(
                      width: 150,
                    ),
                    FExpanded(child: _buildOuterBox()),
                  ],
                ),
              ),
              FExpanded(
                child: FContainer(
                  decoration: BoxDecoration(
                    color: Colors.black,
                  ),
                  child: FSizedBox(
                    width: double.infinity,
                    child: FImage.network(
                      'https://flyinsono-bj-1300984704.cos.ap-beijing.myqcloud.com/20221226204344.gif',
                      fit: BoxFit.cover,
                    ),
                  ),
                ),
              ),
            ],
          ),
        ),
        FContainer(
            width: 300,
            child: FColumn(
              children: [
                FExpanded(
                  flex: 5,
                  child: _buildOuterBox(),
                ),
                FExpanded(
                  flex: 6,
                  child: _buildOuterBox(),
                )
              ],
            ))
      ],
    );
  }
}
