import 'package:flutter/material.dart';
import 'package:recording_tool/core/platform/app_platform_info.dart';

enum AppEnvironment { dev, staging, prod }

class EnvironmentValues {
  const EnvironmentValues({
    required this.environment,
    required this.baseUrl,
    required this.enableNetworkLog,
  });

  final AppEnvironment environment;
  final String baseUrl;
  final bool enableNetworkLog;
}

class AppConfig {
  AppConfig._();

  static late EnvironmentValues current;
  static AppPackageInfo? packageInfo;

  static const appName = '飞行极控录像工作台';
  static const designSize = Size(375, 812);

  static void configure({
    required AppEnvironment environment,
    AppPackageInfo? packageInfo,
  }) {
    AppConfig.packageInfo = packageInfo;
    current = switch (environment) {
      AppEnvironment.dev => const EnvironmentValues(
        environment: AppEnvironment.dev,
        baseUrl: 'https://example.com/api',
        enableNetworkLog: true,
      ),
      AppEnvironment.staging => const EnvironmentValues(
        environment: AppEnvironment.staging,
        baseUrl: 'https://example.com/api',
        enableNetworkLog: true,
      ),
      AppEnvironment.prod => const EnvironmentValues(
        environment: AppEnvironment.prod,
        baseUrl: 'https://example.com/api',
        enableNetworkLog: false,
      ),
    };
  }
}
