import 'package:flutter/material.dart';
import 'package:flyinsono/lab/color/lab_colors.dart';
import 'package:flyinsono/lab/pages/lab_export/widgets/widgets.dart';
import 'package:flyinsono/lab/style/lab_box_decoration.dart';
import 'package:get/get.dart';
import 'index.dart';

class LabExportPage extends GetView<LabExportController> {
  const LabExportPage({
    Key? key,
    this.initArguments,
  }) : super(key: key);
  final dynamic initArguments;

  // 主视图
  Widget _buildView() {
    return Container(
      padding: EdgeInsets.all(10),
      child: Column(
        children: [
          //  FileTypeSelector(),
          Expanded(
            child: _buildMainContent(),
          ),
          SizedBox(height: 10),
          ExportConfigPanel(),
        ],
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return GetBuilder<LabExportController>(
      init: LabExportController(
        tabHashCode: this.hashCode,
        initArguments: initArguments,
      ),
      builder: (_) {
        return Scaffold(
          backgroundColor: LabColors.base300,
          body: SafeArea(
            child: _buildView(),
          ),
        );
      },
    );
  }

  Widget _buildMainContent() {
    return Container(
      decoration: LabBoxDecoration.base,
      child: Row(
        children: [
          PatientSwitcher(),
          Container(
            width: 1,
            color: LabColors.base400,
          ),
          Expanded(
            child: ImageDataView(),
          ),
        ],
      ),
    );
  }
}
