import 'package:flutter/material.dart';
import 'package:flyinsono/lab/color/lab_colors.dart';
import 'package:flyinsono/lab/pages/lab_batch_analysis/index.dart';
import 'package:flyinsono/lab/pages/lab_export/index.dart';
import 'package:flyinsono/lab/pages/lab_import/index.dart';
import 'package:flyinsono/lab/pages/lab_record_info/view.dart';
import 'package:flyinsono/lab/pages/lab_task/index.dart';
import 'package:flyinsono/lab/router/lab_route_names.dart';

class LabRouter {
  // static List<GetPage> getRouters() {
  //   return [
  //     GetPage(
  //       name: LabRouteNames.Login,
  //       page: () => LabLoginPage(),
  //       binding: LabLoginBinding(),
  //     ),
  //     GetPage(
  //       name: LabRouteNames.Main,
  //       page: () => LabMainPage(),
  //       binding: LabMainBinding(),
  //     ),
  //   ];
  // }

  static Widget createSubPageByRouteName(String name, {dynamic initArguments}) {
    switch (name) {
      case LabRouteNames.Import:
        return LabImportPage(initArguments);
      case LabRouteNames.Export:
        return LabExportPage(initArguments: initArguments);
      case LabRouteNames.TaskList:
        return LabTaskPage(
          key: GlobalKey(), // 为了实现多开，必须加 key
        );
      case LabRouteNames.RecordInfo:
        return LabRecordInfoPage(
          key: GlobalKey(), // 为了实现多开，必须加 key
          initArguments: initArguments,
        );
      case LabRouteNames.BatchAnalysis:
        return LabBatchAnalysisPage(
          initArguments: initArguments,
        );
      // case LabRouteNames.CreateProject:
      //   return LabCreateProjectPage();
      default:
        return Container(
          color: LabColors.base300,
          child: Center(
            child: Text(
              name,
              style: TextStyle(fontSize: 30, color: LabColors.text800),
            ),
          ),
        );
    }
  }
}
